Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Auth System - Hexagonal Architecture 🚀

A professional Authentication System built with Go, following Hexagonal Architecture (Ports & Adapters) principles to ensure a decoupled, testable, and maintainable codebase.

🏗️ Architecture

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).

✨ Features

  • 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.

🛠️ Tech Stack

  • Language: Go 1.22+
  • Database: PostgreSQL
  • Security: JWT (v5), Bcrypt
  • DB Driver: pgx (v5)

🚀 Getting Started

1. Clone the repository

git clone https://github.com/SalvucciFacundo/auth-go.git
cd auth-go

2. Database Setup

Ensure PostgreSQL is running and execute the schema.sql script:

psql -U your_user -d auth_db -f schema.sql

3. Run the Application

go run cmd/api/main.go

🛣️ API Endpoints

  • POST /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.

About

Authorization system made with GO

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages