templ_ui_library

command module
v0.0.0-...-2f685a5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Templ UI Library

Material UI components for Go web applications using the templ templating engine, htmx and Tailwind CSS.

Prerequisites

  • Go 1.21 or later
  • templ CLI tool
  • Docker (optional, for containerization)

Getting Started

  1. Clone this repository:

    git clone https://github.com/MathisVerstrepen/htmx_templ_template.git
    cd htmx_templ_template
    
  2. Install dependencies:

    go mod tidy
    
  3. Install Air for live reload:

    go install github.com/air-verse/air@latest
    alias air="~/go/bin/air"
    
  4. Install templ CLI tool:

    go install github.com/a-h/templ/cmd/templ@latest
    
  5. Install tailwind dependencies:

    npm install
    
  6. Run the development server:

    air
    
  7. Open your browser and navigate to http://localhost:4269

Project Structure

.
├── assets
│   └── css
│   └── favicon
│   └── images
├── components
├── handlers
├── models
├── services
├── ui
├── main.go
├── Dockerfile
├── go.mod
├── go.sum
└── README.md
└── .air.toml
└── .env

Development

  • Use air to start the development server with live reload.
  • Add new routes in main.go.
  • Create handlers in the /handlers directory.
  • Add templ components in the /components directory.

Building for Production

  1. Build the binary:

     go build -o bin/server
    
  2. Run the production server:

     ./bin/server
    

Docker Support

Build the Docker image:

docker compose build

Run the container:

docker compose up

License

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
templ: version: v0.2.747
templ: version: v0.2.747

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL