A modern e-commerce backend service built with Hexagonal Architecture in Go
- π Authentication & Authorization
- π₯ User Management
- π¦ Product Management
- π Order Processing
- π³ Payment Integration
- π·οΈ Category Management
- πΉ Golang (Fiber) - Fast HTTP web framework
- π³ Docker - Containerization
- π PostgreSQL - Database
This project follows Hexagonal Architecture (Ports and Adapters) pattern:
core
- Business logic and domain modelshandlers
- HTTP handlers (API endpoints)repositories
- Database interactionsservices
- Application services
- Go 1.20 or higher
- Docker & Docker Compose
- PostgreSQL
- Clone the repository
git clone https://github.com/yourusername/hexagonal-go.git
- Navigate to project directory
cd hexagonal-go
- Run with Docker
docker-compose up -d
# Required environment variables
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASS=postgres
DB_NAME=ecommerce
JWT_SECRET=your-secret-key
POST /api/v1/auth/register # Register new user
POST /api/v1/auth/login # Login user
GET /api/v1/users/profile # Get user profile
GET /api/v1/products # List all products
POST /api/v1/products # Create product
GET /api/v1/products/:id # Get product details
PUT /api/v1/products/:id # Update product
DELETE /api/v1/products/:id # Delete product
POST /api/v1/orders # Create order
GET /api/v1/orders # List user orders
GET /api/v1/orders/:id # Get order details
.
βββ cmd/
β βββ main.go
βββ internal/
β βββ core/
β βββ handlers/
β βββ repositories/
β βββ services/
βββ tests/
βββ docker-compose.yml
βββ README.md