This projects shows how to build a minimal full stack web app using Go, HTMX, Templ and Tailwindcss with Authentication (OAuth).
Checkout the Full Stack GO project to learn more about the project structure.
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
.
Don't forget to check the .env.example
file and inject those environment variables into your environment, it's optimized for the cloud enviroment so it's recommended to inject them at runtime, for example using direnv.
If you want to inject them manually into a
.env
, install go-dotenv and adjust theconfig/config.go
file to read the.env
file instead.
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