Skip to content

Complete project setup for Go + Tailwind + HTMX with hot reloading

Notifications You must be signed in to change notification settings

ajaen4/goth-complete-setup

Repository files navigation

🚀 GOTH Stack Complete Setup

Go Version HTMX Tailwind CSS Alpine.js Templ

A modern, fully configured starter template for building fast, type-safe web applications using Go, HTMX, Tailwind CSS, Alpine.js, and Templ. This stack provides an incredible developer experience with type safety from your database all the way to your HTML.

✨ Features

  • 📜 Type-Safe Templates: Using Templ for compile-time checked templates
  • 🔥 Hot Reload: Using Air for instant feedback during development
  • 🎨 HTMX + Tailwind: Modern, interactive UIs without complex client-side JavaScript
  • 🛠️ Modern JS Utilities: Alpine.js for lightweight interactivity
  • 📱 Responsive Design: Mobile-first approach with Tailwind CSS

🚀 Quick Start

Prerequisites

  • Go v1.23.2 or higher
  • npm v10.9.0
  • node v23.2.0
  • Air v1.61.1
  • Templ CLI v0.2.778

Installation

Install dependencies:

npm install

Running Locally

Start the development server:

make run

This will:

  • Start the Templ proxy server on the value of TEMPL_PROXY_PORT defined in the .env file.
  • Start the Go server on the value of APP_PORT, also defined in the .env file.
  • Enable hot reloading for all file changes.

Access the application at:

http://localhost:<TEMPL_PROXY_PORT>

Running as Container

  1. Build the container:
docker build -t <image-tag> .
  1. Run the container:
docker run --rm \
  --env-file .env \
  -p <local-port>:<app-port> \
  -t <image-tag>

Access the containerized application at:

http://localhost:<local-port>

Note: The <app-port> should match the APP_PORT in your .env file.

In detail explanation

There is an in detail explanation of how the hot reloading works in this article.

About

Complete project setup for Go + Tailwind + HTMX with hot reloading

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published