A lightweight, modular authentication service built in Go with PostgreSQL, designed with simplicity and scalability in mind.
- Session & token-based authentication
- Login activity tracking with metadata
- Seed script for mock data generation
- PostgreSQL-backed with SQL migrations
- Clean modular project structure
- Makefile for easy command execution
auth-service-2.0/
├── cmd/api/ # API entry point
├── internal/repository/ # Database access (users, sessions, logs)
├── internal/resources/ # Shared error definitions, constants
├── internal/db/ # Seed logic
├── migrations/ # DB migration files
├── Makefile # Useful dev commands
└── go.mod / go.sum # Go dependencies
git clone <repo-url>
cd auth-service-2.0Create a .env file or export manually:
DB_ADDR=postgres://postgres:password@localhost:5432/auth_service_db?sslmode=disablemake migrate-upmake runGenerate mock data:
make seed count=10This will create 10 users, sessions, and logs.
For feedback or contributions, feel free to open an issue or pull request.