A professional Authentication System built with Go, following Hexagonal Architecture (Ports & Adapters) principles to ensure a decoupled, testable, and maintainable codebase.
The project adheres to Hexagonal Architecture standards:
- Domain: Entities and Ports (interfaces). Zero external dependencies.
- Application: Services and Business Logic (Use cases).
- Infrastructure: Concrete implementations (Adapters) for HTTP and Persistence (PostgreSQL).
- User Registration with secure password hashing (
bcrypt). - JWT (JSON Web Tokens) based authentication.
- Security Middlewares for protected route management.
- Password management (Secure password change).
- PostgreSQL persistence using
pgx/v5.
- Language: Go 1.22+
- Database: PostgreSQL
- Security: JWT (v5), Bcrypt
- DB Driver: pgx (v5)
git clone https://github.com/SalvucciFacundo/auth-go.git
cd auth-goEnsure PostgreSQL is running and execute the schema.sql script:
psql -U your_user -d auth_db -f schema.sqlgo run cmd/api/main.goPOST /register: Register new users.POST /login: Authenticate and receive a JWT token.GET /me: (Protected) Authenticated user profile.POST /change-password: Secure password update.
Built with ❤️ for idiomatic Go practice.