How stunext/goboilterplate works
Main Components
a. HTTP Layer:
• Router component (from app/router)
• Middleware chain (from app/middlewares):
• CORS
• GZIP
• JWT
• Logger
• Recovery
• Security
• Redirect
b. Application Layer:
• Controllers (from app/controllers)
• Home Controller
• Users Controller
• Helpers (from app/helpers)
• Auth Helper
• Validator Helper
c. Data Layer:
• Models (from app/models)
• User Model
• Profile Model
• Auth Model
• UserProfile Model
• Database Configuration (from config/database.go)
• Cache Configuration (from config/cache.go)
d. Additional Components:
• Console/Scheduler (from app/console)
• Documentation (Swagger)
• Test Suite
Relationship Flows
• Blue: HTTP/External Interface Layer
• Green: Application/Business Logic Layer
• Orange: Data/Persistence Layer
• Gray: Support Services
[Client Requests] → [Echo HTTP Server]
• ↓
[Middleware Chain] → [Router Layer]
• ↓
[Controllers] ←→ [Helpers]
• ↓
[Models Layer] ←→ [GORM]
• ↓
[Database/Cache]
Component Descriptions
Use these symbols and notations:
• Rectangles: Main components
• Hexagons: External services/interfaces
• Diamonds: Decision points (middleware)
Additional Elements
Supporting elements:
• Version information
• Environment configurations (.env)
• API endpoints grouping
• Middleware order of execution
Technical Details
• Echo framework integration points
• GORM database connections and pooling
• Middleware chain sequence
• Authentication flow
• Request/Response cycle
• Error handling paths
• The HTTP request lifecycle
• Authentication and authorization flow
• Data persistence patterns
• API structure and grouping
• Middleware functionality
• Testing boundaries
Remember to include a clear indication of:
• Entry points (HTTP, Console)
• Security boundaries
• Data flow directions
• Component dependencies
• Integration points
This will provide a comprehensive view of the system while maintaining clarity and usefulness for development and maintenance purposes.