Home

Awesome

TemplUI Quickstart

Get started with TemplUI, an enterprise-ready UI component library for Go and Templ. This template provides a pre-configured setup for building professional web applications with TemplUI components.

Features

Security

This template is CSP-compliant out of the box through TemplUI's built-in security features:

If you plan to add external scripts (like HTMX or highlight.js), you'll need to:

  1. Add the CSP middleware
  2. Configure allowed script sources

See the Documentation for details.

Prerequisites

Before starting, ensure you have these tools installed:

For installation instructions, visit our documentation.

Setup

  1. Clone the Repository

    git clone https://github.com/axzilla/templui-quickstart.git
    cd templui-quickstart
    
  2. Install Dependencies

    go mod tidy
    
  3. Configure Tailwind Since we're using TemplUI as a package, you need to configure Tailwind to process its components:

    a. Get your Go path:

    go env GOPATH
    

    b. Add the path to your tailwind.config.js content array:

    content: [
      "./**/*.{html,templ,go}",
      "${GOPATH}/pkg/mod/github.com/axzilla/templui@*/**/*.{go,templ}", // Replace ${GOPATH} with your actual Go path
    ];
    

Development

Start the development server with hot reload:

make dev

Your application will be running at http://localhost:7331

Deployment

This template includes a production-ready Dockerfile for easy deployment:

# Build the image
docker build -t templui-app .

# Run the container
docker run -p 8090:8090 templui-app

Your application will be available at http://localhost:8090

Learn More

Contributing

Issues and pull requests are welcome! Please read our contributing guidelines before submitting a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.