A modern, fully configured starter template for building fast, type-safe web applications using Go, HTMX, Tailwind CSS, Alpine.js, and Templ. This stack provides an incredible developer experience with type safety from your database all the way to your HTML.
- 📜 Type-Safe Templates: Using Templ for compile-time checked templates
- 🔥 Hot Reload: Using Air for instant feedback during development
- 🎨 HTMX + Tailwind: Modern, interactive UIs without complex client-side JavaScript
- 🛠️ Modern JS Utilities: Alpine.js for lightweight interactivity
- 📱 Responsive Design: Mobile-first approach with Tailwind CSS
At least the following major versions are required (when installing on your local machine):
- Go v1.25
- npm v11.4
- node v24.4
- Air v1.63.0
- Templ CLI 0.3.943
- GNU Make 3.81 (recommended, but optional)
Or just use Docker for everything:
- Docker 28.1 (recommended, but optional)
- Start the server using either local setup or Docker (see below).
- Open your browser and navigate to
http://localhost:<app-port>(default is 8080). - Play with HDA (interactions, dynamic content loading, etc.) and see changes instantly with hot reload!
- Play with API
- get clicks count:
curl http://localhost:8080/api/v1/clicks - increment clicks count:
curl -X POST http://localhost:8080/api/v1/clicks/increment
- get clicks count:
-
Install dependencies
make prep
-
Build Tailwind and Go
make build
-
Run the application with Hot Reload using Air
make air
Either do make prep (will also install Go/Node dependencies on the host machine) or copy .env.example to .env and modify as needed.
-
Build the Docker image
make docker-build
-
Run the Docker container
make docker-up
-
Stop the Docker container
make docker-down
In both cases, open your browser and navigate to:
http://localhost:<local-port>Note: The <app-port> should match the APP_PORT in your .env file.
If you get an error that a port is already taken, you can change the port in the .env file or kill the process using it:
sudo lsof -i -P | grep LISTEN | grep :<PORT>Then kill the process using the PID:
sudo kill -9 <PID>To remove a package, use the following command:
go mod edit -dropreplace <package>
go mod tidyIf you used go install package@latest then to remove:
go install package@none
go clean -cache -modcacheThere is an in detail explanation of how the hot reloading works in this article.