High-Level Architecture#
text
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Web Client │ │ Mobile Client │ │ External API │
└─────────┬───────┘ └─────────┬───────┘ └─────────┬───────┘
│ │ │
└──────────────────────┼──────────────────────┘
│
┌─────────────▼─────────────┐
│ API Gateway │
│ (Rate Limiting, Auth) │
└─────────────┬─────────────┘
│
┌─────────────▼─────────────┐
│ BFF Service │
│ (Backend for Frontend) │
└─────────────┬─────────────┘
│
┌────────────────────────┼────────────────────────┐
│ │ │
┌───────▼────────┐ ┌─────────▼────────┐ ┌────────▼────────┐
│ Auth Service │ │ Content Service │ │ AI Service │
└────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
└────────────────────────┼────────────────────────┘
│
┌─────────────▼─────────────┐
│ Data Layer │
│ (PostgreSQL, Redis, S3) │
└───────────────────────────┘
Service Categories#
Core Services#
- Authentication Service - User management, JWT tokens, permissions
- Content Service - Course materials, media, versioning
- AI Service - LLM orchestration, RAG, multi-agent systems
- Conversation Service - Chat history, threading, real-time
Supporting Services#
- BFF Service - Backend for Frontend aggregation
- Media Service - File storage, CDN, processing
- Notification Service - Push notifications, email, SMS
- Moderation Service - Content safety, policy enforcement
Infrastructure Services#
- STT Service - Speech-to-text processing
- TTS Service - Text-to-speech synthesis
- Knowledge Service - Graph database, semantic search
- RAG Service - Retrieval-augmented generation
Data Architecture#
Primary Data Stores#
- PostgreSQL - Primary relational database
- Redis - Caching and session storage
- Neo4j - Knowledge graph and relationships
- S3/MinIO - Object storage for media files
Data Flow Patterns#
- Write Path: Client → API → Service → Database
- Read Path: Database → Service → API → Client
- Cache Pattern: Read-through/write-through caching
- Event Streaming: Async processing for background tasks
Security Architecture#
Authentication & Authorization#
- JWT Tokens - Stateless authentication
- RBAC - Role-based access control
- MFA - Multi-factor authentication support
- API Keys - Service-to-service authentication
Security Layers#
- Network Level - TLS, firewalls, VPC isolation
- Application Level - Input validation, rate limiting
- Data Level - Encryption at rest and in transit
- Monitoring - Security event logging and alerting
Deployment Architecture#
Container Strategy#
- Docker - Containerized services
- Kubernetes - Orchestration and scaling
- Helm Charts - Package management
- GitOps - ArgoCD for continuous deployment
Environment Strategy#
- Development - Local development with Docker Compose
- Staging - Production-like environment for testing
- Production - Multi-zone high-availability deployment
Auto-generated system architecture documentation