This projects shows how to build a minimal full stack web app using Go, HTMX, Templ and Tailwindcss. Everything from the backend and no JavaScript shenanigans.
All the HTML are stored in *.templ
files in the /views
and /components
directories.
The /handlers
directory contains the Go handlers for the different routes that serve those Templ components.
There are a few tools that you need to install to run the project. So make sure you have the following tools installed on your machine.
- Templ (for the UI layer)
- Tailwindcss CLI (CSS styling library)
- Migrate (for DB migrations)
- Air (for live reloading)
Adittionally, it's recommended to install a syntax highlighting and templ LSP integration: the official Templ documentation.
Firstly make sure you have a MySQL database running on your machine or just swap for any storage you like under /store
.
Then, for the best development experience, run the project in 3 different processes by running:
air # for the go server live reloading
make tailwind # for the tailwindcss live reloading
make templ # for the templ files live generation and reloading
This will create a live reloading experience in the browser with real-time changes to the UI and the Go server.