How raphaeltarita/skullgame-server works
Main Components
a) External Interface Layer:
• HTTP/HTTPS Endpoints (represented as an API Gateway)
• WebSocket Connection Handler (planned future feature)
• Static Site Server (optional feature)
b) Authentication System:
• JWK Authentication Service
• Auth Store
• User Management
c) Game Core:
• Games Manager
• Game Controller
• State Management System
• Move Handlers
d) Configuration System:
• Config Provider
• Environment Config
• Features Config
• Auth Config
Component Relationships
[Client] ←→ [API Gateway] → [Auth System] → [Game Core]
• ↑ ↑ ↑
• [Configuration System]──┘
Specific Implementation Details
• Blue: External interfaces (HTTP endpoints, WebSocket)
• Green: Authentication components
• Red: Game core components
• Yellow: Configuration components
• Gray: External storage/files
Detailed Component Breakdown
a) API Gateway (Endpoints):
• Connection to auth middleware
• WebSocket upgrade path
b) Authentication System:
• JWK validation flow
• To AuthStore
• Link to user configuration
c) Game Core:
• GamesManager as central coordinator
• Individual Game instances
• State Management system
• Move Handlers hierarchy
d) Configuration:
• Config file relationships
• Environment variable integration
• Feature toggles
Additional Elements
Supporting components:
• Server-config directory with certificates
• Logging system (Logback)
• Thread pool for game management
Data Flow Indicators
• Authentication flow
• Game state updates
• Configuration loading
• Move processing pipeline
Specific Architectural Notes
• Separation between auth and game logic
• State management system's central role
• Modular move handler system
• Configuration injection points
Technical Stack Indicators
• Ktor framework
• Kotlin/JVM runtime
• JWK authentication
• Logback logging
Scale and Performance
Indicate:
• Thread pool limitations
• Concurrent game handling
• State management boundaries
Remember to include version or environment indicators if the system behavior varies between development and production configurations.