An end to end htmx and go-templ template using echo for the web server and mage for deployment. Other than that this is unopinionated so bring all your other favorite technologies :)
Go
Templ
HTMX
Echo
Mage
For the frontend libraries it uses tailwindcss and daisyUI for styling. You can easily integrate alpine-js if you desire.
- Install npm in your path
brew install node; brew install npm
- Install mage in your path
brew install mage
. See https://magefile.org/ for other installation instructions - Run
mage install
- Run
mage run
- Open http://localhost:7331 (the server is listening on :4433 but templ injects a watcher with an autoreload script)
When you make changes to your templ files or any of your go code everything will regenerate and then autoreload your web page
mage run
- Run an interactive development environment that will automatically reload on any file change. Listens on port :4433 and has an autoreload page on :7331
mage install
- Install all the dependencies
mage templ
- Do a one time regeneration of your templ files
mage build
- Do a one time build of the go files
mage tidy
- Run go mod tidy
I usually use postgres and sqlc and they work great. If people start to use this and want to see that added in I'll do so.
Yea I know it's spelled with an 'a' :] I was trying to come up with a name that was easier to say and interact with than 'htmx-templ-template' and gothem is what I came up with.