Go-Htmx-Auth-Example π
A simple authentication example built with Go, Gorilla Toolkit, PostgreSQL, HTMX, and Tailwind CSS.
β¨ Features
- π Session-Based Authentication
- π‘οΈ CSRF Protection
- β‘ HTMX Frontend Interactions
- π¨ Tailwind CSS Styling
π οΈ Stack
- π§Ή Language: Go
- π§ Framework: Gorilla Toolkit (
mux
, securecookie
, csrf
, etc.)
- π’οΈ Database: PostgreSQL
- π¨ CSS Framework: Tailwind CSS
π Getting Started
π Prerequisites
- πΉ Go (>=1.21)
- π PostgreSQL (running and configured)
- π° Node.js (for Tailwind CLI)
π₯ Installation
git clone https://github.com/Abhishek2010dev/Go-Htmx-Auth-Example.git
cd Go-Htmx-Auth-Example
β
Set up your PostgreSQL database and update connection settings if needed inside the project.
π οΈ Building Tailwind CSS
Before running the app, build the Tailwind CSS output:
npx @tailwindcss/cli -i ./style/input.css -o ./static/css/output.css
π Running the App
go run cmd/api/main.go
The server will start and listen on localhost:4000 by default. π
ποΈ Folder Structure
cmd/api/ β main Go application
internal/ β handlers, models, utilities
migrations/ β database migration scripts
style/ β TailwindCSS input file
static/css/ β output CSS file
templates/ β HTML templates (with HTMX)
π Credits
Thanks to the awesome tools:
π License
This project is licensed under the MIT License. β