How ddanielcruz/serverless-clean-architecture works
Main Components
a) Client-Facing Layer:
• API Gateway (entry point for HTTP requests)
• Authentication/Authorization layer (shown by the authorizer function)
b) Application Core:
• Lambda Functions (organized by domain)
• User management (sign-up, sign-in)
• Session management
• Notes management
• Audio processing
c) Domain Services:
• Notes Domain
• Security Domain
• Users Domain
d) Infrastructure Services:
• AWS Services
• S3 (audio storage)
• SES (email service)
• Transcribe (speech-to-text)
• RDS PostgreSQL (data persistence)
• OpenAI GPT-4 (summarization)
┌─────────────────────────────────────────────────────────────┐
• Client Applications │
• ┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• API Gateway │
• Custom Authorizer │
• ┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Lambda Functions │
• ┬────────────────┬────────────────┬─────────┤
• User Functions │Session Functions│ Note Functions │ Queue │
• ┴────────────────┴────────────────┴─────────┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Domain Services │
• ┬────────────────┬────────────────┬─────────┤
• User Domain │Security Domain │ Notes Domain │ │
• ┴────────────────┴────────────────┴─────────┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Infrastructure Layer │
• ┬──────────┬──────────┬──────────────┬───────────┤
• S3 │ SES │Transcribe│ PostgreSQL │ GPT-4 │
• ┴──────────┴──────────┴──────────────┴───────────┘
Important Flows to Highlight
a) Authentication Flow:
• Client → API Gateway → Authorizer → Session Management
• Token refresh and validation paths
b) Creation Flow:
• Audio upload → S3 → Lambda trigger
• Transcription request → AWS Transcribe
• Summarization → GPT-4
• Storage → PostgreSQL
Additional Elements
• Version/environment indicators
• Scaling points and serverless boundaries
• Configuration dependencies
• Monitoring and logging points
Implementation Details
• Rectangles: Services and main components
• Hexagons: Lambda functions
• Diamonds: Decision points