How run-us/run-us-server works
Main Components
a. API Layer (Controllers):
• Auth/User Management (AuthController, UserController)
• Crew Management (CrewController)
• Running Management (RunController, LiveRunningController)
• Record Management (RunRecordController)
b. Service Layer:
• User Services (Authentication, Authorization)
• Crew Services (Crew management, membership)
• Running Services (Live running, running records)
• WebSocket Services (Real-time running updates)
c. Data Layer:
• JPA Repositories
• Redis Cache
• In-Memory Storage
Architecture Patterns to Highlight
a. Domain-Driven Design (DDD):
• Clear boundaries between domains (user, crew, running)
• Domain models and their relationships
b. Clean Architecture:
• Controllers → UseCases → Services → Repositories
• Dependency flow
Specific Components and Their Relationships
[Client Applications]
• ↓
[Load Balancer/API Gateway]
• ↓
[API Layer]
• REST Controllers
• WebSocket Controllers
• ↓
[Service Layer]
• Authentication/Authorization
• Crew Management
• Running Management
• Record Management
• ↓
[Domain Layer]
• User Domain
• Crew Domain
• Running Domain
• ↓
[Persistence Layer]
• JPA Repositories
• Redis Cache
• In-Memory Storage
Important Technical Elements
• WebSocket connections for live running updates
• Redis for real-time data and caching
• JWT authentication flow
• Domain event handling
• Error handling and exception flow
Additional Details
• Security filter chain
• Async operations
• Caching points
• Validation flow
• Error handling paths
Integration Points
• WebSocket connections
• Redis pub/sub
• External auth providers
• Database connections
Key Relationships to Emphasize:
• User authentication flow
• Live running session management
• Crew membership handling
• Record keeping and statistics