A modern Go web app starter using Templ, Tailwind CSS, and Air for live reloading.
-
Air: Live-reload for Go apps
Install via:go install github.com/cosmtrek/air@latest
git clone https://github.com/radiaku/gotailwinds.git
cd gotailwinds
make installThis will:
- Install
templ(Go HTML templating tool) - Install TailwindCSS
- Initialize npm
- Create
bin/directory
Create a .env file in the root with:
APP_PORT=8080
TEMPL_PROXY_PORT=8787make initThis will:
- Create
tailwind.config.js - Setup
static/css/tailwind.css - Run Tailwind in dev mode
make runThis will:
- Start
templin watch mode - Start the Go server with
airfor live reload
make tailwind| Command | Description |
|---|---|
make build |
Build production binary in bin/ |
make build-local |
Build binary to bin/main |
make templ |
Run templ generate with live proxy (watch mode) |
make tailwind |
Watch the tailwinds |
make notify |
Notify proxy-only templ generate mode |
gotailwinds/
├── cmd/
│ └── main/ # Main entry point
├── static/ # Static files (CSS, JS, images)
├── view/ # Templ view components
│ ├── layout/
│ └── partial/
├── bin/ # Build output
├── .env
├── makefile
└── README.md
https://github.com/radiaku/gotailwindsdemo
MIT