How aberdeenrss/flightmanagementserver works
Main Components
• API Gateway / Web Server: This is represented by the “app/main.py” file and is launched via Uvicorn. It is the entry point for incoming requests.
• Controllers: Under the “app/controller” directory, you have various controllers handling HTTP endpoints for authentication, flight data, commands, vessel operations, and a dedicated “socketio” submodule to handle real-time, bi-directional communication.
• Models: The “app/models” directory defines various data models (e.g., flight, vessel, user) which structure the data being processed.
• Helpers and Middleware: “app/helper” offers utility functions and “app/middleware” (including authentication middleware) provide request-level processing such as auth-checks.
• Configuration: “app/config.py” is where various settings reside, impacting how the system behaves (which could optionally be overridden by command-line settings).
• Deployment & CI/CD: Files in “.github/workflows” (e.g., deployment and testing YAML) and the Dockerfile indicate automated deployments and containerization.
Relationships and Interactions
• The Uvicorn server acts as the entry point, routing HTTP requests to appropriate controllers.
• Controllers call services to perform business logic, authentication/authorization, and data access.
• Services connect to the database (MongoDB) and perform CRUD operations via the data_access modules.
• Middleware (like the auth middleware) is interposed before controllers to ensure authenticated requests.
• The socketio controllers handle live real-time connections, which likely communicate with similar service layers to dispatch commands in real time.
• The API endpoints and WebSocket endpoints are both provided, showing a separation between synchronous API calls and asynchronous, real-time communications.
Architectural Patterns and Design Principles
• MVC-like Decomposition: Although not strictly MVC, there is a clear separation (models, controllers, services) that provides modularity.
• Layered Architecture: The controllers, middleware, and services form layers that isolate concerns (presentation, business logic, and data persistence).
• Containerization and CI/CD: The Dockerfile and GitHub workflows denote a deployment rather than monolithic architecture and continuous integration practices.
Relevant Technologies and Frameworks
• Python 3.9+ for the language environment.
• Likely FastAPI or a similar ASGI framework (implied by Uvicorn in the run command).
• MongoDB as the primary data storage (from the “mongodb/mongodb_connection.py”).
• GitHub Actions for continuous integration and deployment.
• Docker for container orchestration.
Detail
• Don’t overcomplicate but ensure you capture all essential architectural elements: API endpoints (both HTTP and real-time), security/auth flow, business logic delegation, and database connectivity.