command
module
Version:
v0.0.0-...-2f685a5
Opens a new window with list of versions in this module.
Published: Aug 3, 2024
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
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
-
Clone this repository:
git clone https://github.com/MathisVerstrepen/htmx_templ_template.git
cd htmx_templ_template
-
Install dependencies:
go mod tidy
-
Install Air for live reload:
go install github.com/air-verse/air@latest
alias air="~/go/bin/air"
-
Install templ CLI tool:
go install github.com/a-h/templ/cmd/templ@latest
-
Install tailwind dependencies:
npm install
-
Run the development server:
air
-
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
-
Build the binary:
go build -o bin/server
-
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
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.