How brprb08/aircraft-tracking-system works
Main Components
• Frontend Application:
• Built in React with TypeScript and Leaflet for mapping.
• Key components include UI elements (e.g., AircraftPage, Login, Signup) and services (API calls and Socket.IO client connections).
• Backend Server:
• Developed in Node.js/Express with TypeScript.
• Organized into subcomponents like DAO, routes, services, middlewares (authentication, rate limiting), validation, and utility functions.
• Manages REST API endpoints (user management, aircraft data operations) and broadcasts real-time updates via Socket.IO.
• Database:
• MongoDB (with Mongoose) is used to persist aircraft and user data.
• Data persistence layer and its interaction with the backend.
• Hardware Integration (Raspberry Pi):
• Contains Python scripts (e.g., plane-collect.py) interfacing with dump1090 to capture ADS-B data.
• Acts as the data source that pushes real-time aircraft information to the backend.
• External Services:
Relationships and Data Flow
• Data Flow from Hardware to Backend:
• Raspberry Pi (with ADS-B antenna, SDR dongle) running Python scripts collecting aircraft data.
• Backend Processing:
• API endpoints for user registration, login, adding/updating aircraft, and deleting records.
• Data validation (using Joi) followed by storage or in-memory caching.
• Real-time broadcasting through Socket.IO to connected clients.
• Frontend Interaction:
• React app, highlighting its connection to the backend via both RESTful API calls and a persistent WebSocket connection.
• Real-time data presentation on the Leaflet map; aircraft markers update based on backend events.
• Database Connection:
Architectural Patterns and Design Principles
• Separation of Concerns:
• Distinguish between the frontend and backend, ensuring API boundaries are clear.
• The backend components (data access, business logic, validation, and middleware) should be grouped to show layered architecture.
• Real-Time Communication:
• Use of Socket.IO for bidirectional real-time data broadcasting between the backend and frontend.
• Security Measures:
• Hardware Integration as an External Data Source:
• ADS-B data collection as an edge component that feeds into the central backend.
Final Recommendations
• Be as detailed as possible by breaking down the system into the distinct modules outlined above.
• Integration of real-time data from hardware into the application ecosystem, clearly showing the update paths from data capture to final rendering on the map.