How aymanamkassou/flight-route-visualizer works
Project Type & Purpose
• It’s a full-stack application with a clear separation between the backend (implemented in C++ for core algorithms and the HTTP server) and the frontend (a Next.js-powered interactive visualization interface).
• The project focuses on aviation route visualization with real-time pathfinding features (using Dijkstra’s algorithm and BFS) and animated simulations of aircraft movement.
Main Components
a. Frontend:
– Next.js application under the “frontend/flight-route-visualizer” directory.
– Key modules/components:
• Interactive Map (components/Map.tsx)
• Visualization Controls (components/VisualizationControls.tsx)
• Animation Information and hooks (e.g., usePathAnimation.ts)
• Global styling and layout (app/layout.tsx, globals.css)
– Role: Presents the visualization, interacts with users, and sends API requests to the backend.
b. Backend:
– C++ server found in the “backend/src” directory.
– Key submodules:
• Graph Module: Contains the CSR graph and node representations (files in backend/src/graph)
• Server Module: Implements the HTTP server and REST API endpoints (backend/src/server)
• Utilities: DataLoader for reading airports and waypoints information (backend/src/utils)
• Main entry-point: (backend/src/main.cpp) which boots the server.
– Role: Processes API requests, loads and manipulates aviation data, and computes optimal paths.
c. Data Sources:
– Airport data (backend/data/airports.json)
– Waypoint data (backend/data/waypoints.csv)
– These feed into the pathfinding algorithms and are utilized during server startup/data loading.
Relationships and Interactions
• The frontend sends HTTP requests to the backend’s API endpoints (e.g., GET /api/graph and POST /api/find-path).
• The backend receives requests, invokes corresponding graph algorithms (Dijkstra/BFS), accesses structured data (using DataLoader), and returns computed path data and visualization steps.
• The real-time responses provide the frontend with information to animate the route and aircraft movement on the map.
Architectural Patterns & Principles
• Clear separation of concerns with distinct frontend and backend modules.
• The backend follows a modular design: segmentation into graph, server, and utility components for better maintainability.
• The use of CSR (Compressed Sparse Row) data structures is an optimization strategy for in-memory graph representations.
• RESTful API design for easy interaction between the client and server.
Relevant Technologies, Frameworks, and Libraries
• Backend: C++, cpprestsdk for HTTP server functionality, and possibly Boost libraries.
• Frontend: Next.js, React (components/hooks), Tailwind CSS for styling, and JavaScript/TypeScript for interactivity.