How 0xpuncker/go-jwt-auth-api works
Main Components
a) Client Layer:
• External clients/applications that will consume the API
• HTTP/REST requests coming in
b) API Layer:
• Fiber Web Framework as the main HTTP server
• Routes layer (/routes)
• Controllers layer (/controllers)
• JWT Authentication middleware
c) Data Layer:
• Models layer (/models)
• Database layer (/database)
• PostgreSQL database
Component Relationships
Client Requests → API Layer → Business Logic → Data Layer → Database
Key Flows to Highlight
a) Authentication Flow:
1. Client sends credentials
2. JWT middleware validates
3. Token generation/validation
4. Protected route access
b) Data Flow:
1. HTTP request hits routes
2. Routes direct to controllers
3. Controllers interact with models
4. Models communicate with database through GORM
Technical Details
Labels for:
• Fiber Framework
• JWT Authentication
• GORM ORM
• PostgreSQL
• Key Go packages used
Additional Notes
• Version information for major components
• Error handling paths
• Secure vs non-secure endpoints
• How authentication flows through the system
• Where different types of requests are handled
• How the data moves between layers
• Where security is implemented
• How the database integration works