How zhashkevych/todo-app works
Main Components
A. External Layer (Client Interface)
• REST API Endpoints (using Gin Framework)
• Swagger Documentation (noted from docs/ directory)
B. Application Layers (following Clean Architecture):
1. Handler Layer (Controllers)
• Auth Handler
• Item Handler
• Handler
• Middleware
2. Service Layer (Business Logic)
• Auth Service
• Todo Item Service
• Todo List Service
3. Repository Layer (Data Access)
• PostgreSQL Repositories
• Auth Repository
• Todo Item Repository
• Todo List Repository
C. Infrastructure
• PostgreSQL Database
• JWT Authentication
• Configuration Management (Viper)
[Client/External Requests] (Top)
• ↓
[API Layer (Gin Framework + Middleware)]
• ↓
[Service Layer]
• ↓
[Repository Layer]
• ↓
[Database Layer] (Bottom)
Specific Elements
a) API Layer:
• Main endpoint groups (/auth, /items, /lists)
• Middleware placement
• Swagger integration
b) Service Layer:
• Separation of concerns between auth, items, and lists
• Service interfaces and implementations
• Where business logic resides
c) Repository Layer:
• PostgreSQL connection handling
• Database models (user.go, todo.go)
• Migration handling
d) Infrastructure:
• Configuration management (configs/config.yml)
• Docker container relationships
• Graceful Shutdown handling
Technical Details to Highlight
• Gin Framework as the HTTP router
• JWT for authentication
• SQLx for database operations
• Viper for configuration
• Docker for containerization
• Migration handling