How cedrickchee/skel works
Main Components
a. Client Layer:
• Supported clients (SPAs, mobile apps, standalone services)
• CORS-enabled endpoints with trusted origins
b. API Gateway/Proxy Layer:
• Caddy reverse proxy (handling HTTPS/TLS termination)
• Rate limiting middleware
• CORS middleware
c. Application Layer (Core API):
• Main API server (port 4000)
• Route handlers (/v1/healthcheck, movies, users endpoints)
• Authentication/Authorization system
• Middleware components (logging, panic recovery, rate limiting)
d. Service Layer:
• Mailer service (SMTP)
• JSON logging service
• Validation service
• Data models and business logic
e. Data Layer:
• PostgreSQL database
• Migration system
• Connection pool management
Relationships and Data Flow
• HTTP/HTTPS traffic flow from clients through Caddy to API
• Database connections and pooling
• Email notifications flow
• Authentication token flow
• Migration process flow
Specific Implementation Details
Configuration Management:
• Environment variables
• Command-line flags
• Development/Staging/Production environments
Security Features:
• Rate limiting
• CORS protection
• Authentication tokens
• Permission system
Monitoring & Debugging:
• Health check endpoint
• Metrics endpoint (/debug/vars)
• JSON structured logging
Deployment Architecture
Production setup:
• Single Ubuntu Linux server
• Systemd service management
• Database location
• Caddy reverse proxy configuration
[External Clients] → [HTTPS/443] → [Caddy Reverse Proxy]
• ↓
[Rate Limiter] → [CORS Middleware] → [API Server :4000]
• ↓
• ┌─────────────┬─────────────┬─────────────┐
• ↓ ↓ ↓ ↓
• [User Service] [Movie Service] [Auth Service] [Mail Service]
• ↓ ↓ ↓ ↓
• [Data Models] ← [Connection Pool] → [PostgreSQL]
Additional Notes
Annotations for:
• Database migration paths
• Configuration options
• Deployment commands
• Health check endpoints
• Metrics collection points