How max2288/fly_school_game works
Main Components
• Game Client: Represented by game.py. This is the frontend part of the game where users register, authenticate, and play by controlling a small bird. It sends telemetry data (via keypresses) in real time to the server.
• API Server (Backend): Represented by main.py, which launches the FastAPI server. Complementary modules like config.py, database.py, and logger.py support configuration management, database interactions, and logging.
• Database: A PostgreSQL server running in a Docker container. The database schema is prepared via init_db.ddl, and the .env file connection parameters allow the FastAPI server to communicate with it.
Relationships and Interactions
• The Game Client transmits user inputs and telemetry data to the API server.
• The API server uses configuration settings (from config.py, .env variables) and logging (via logger.py) to operate properly.
• The CI/CD workflows trigger code quality checks and tests that ensure robust development practices.
Architectural Patterns and Technologies
• Separation of Concerns: The architecture distinctly separates the game client from backend services. The FastAPI server focuses solely on HTTP request handling while game.py is used for real-time interactions.
• Micro-architecture: Although not explicitly microservice-based (everything is in a single repository), there is a clear modular structure – game logic, API service, database connectivity, and logging are separated into different modules.
• Containerization: The use of Docker for running PostgreSQL underscores the importance of containerized services and deployment.
• Real-Time Communication: Emphasize that the API server receives real-time telemetry from the game, which guides the design of data flow and interaction handling.