Go-Htmx-Auth-Example Tailwind Templates

Go Htmx Auth Example

A simple authentication example built with Go, Gorilla Toolkit, PostgreSQL, HTMX, and Tailwind CSS.

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. โœ…

Top categories

Loading Svelte Themes