Go-Htmx-Auth-Example

module
v0.0.0-...-b779c1c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2025 License: MIT

README ΒΆ

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

Directories ΒΆ

Path Synopsis
cmd
api command
internal
dto
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL