Skip to content

radiaku/gotailwinds

Repository files navigation

GoTailwinds

A modern Go web app starter using Templ, Tailwind CSS, and Air for live reloading.

📦 Prerequisites

  • Go

  • Node.js + npm

  • Air: Live-reload for Go apps
    Install via:

    go install github.com/cosmtrek/air@latest

🚀 Quick Start

1. Clone and Install Dependencies

git clone https://github.com/radiaku/gotailwinds.git
cd gotailwinds
make install

This will:

  • Install templ (Go HTML templating tool)
  • Install TailwindCSS
  • Initialize npm
  • Create bin/ directory

2. Configure .env

Create a .env file in the root with:

APP_PORT=8080
TEMPL_PROXY_PORT=8787

3. Initialize Tailwind

make init

This will:

  • Create tailwind.config.js
  • Setup static/css/tailwind.css
  • Run Tailwind in dev mode

4. Run the App

make run

This will:

  • Start templ in watch mode
  • Start the Go server with air for live reload

5. Run and watch tailwinds changes

make tailwind

🔨 Other Make Targets

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

📁 Project Structure

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

★ Demo

https://github.com/radiaku/gotailwindsdemo


📄 License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published