AeroSentry is a two-system, trusted weather intelligence platform designed to enhance aviation safety by providing pilots and ground control with real-time, dynamic, and predictive weather analysis.
It acts as a digital co-pilot, transforming raw, complex aviation weather data into an interactive 3D visualization with actionable insights, including automatic hazard detection and route adjustments.
AeroSentry is built as a two-part system, ensuring that both the flight crew and ground control have access to synchronized, role-specific intelligence.
- Interactive 3D Globe: A fully interactive globe that visualizes dynamic flight paths and weather conditions in a rich, intuitive interface.
- Real-time Weather Integration: Seamlessly integrates with the
aviationweather.govAPI to fetch and decode live METAR, TAF, and SIGMET reports. - Intelligent Checkpoint Analysis: An advanced algorithm that evaluates weather conditions at multiple calculated checkpoints between the departure and destination airports, not just at the endpoints.
- Dynamic Rerouting: Automatically detects when a flight path intersects with high-risk thunderstorm zones (SIGMETs) and calculates a safer, alternative route.
- Visual Weather Dashboard: A clean, heads-up display of critical weather statistics that updates in real-time as flight conditions change.
- AI-Powered Assistant: An integrated chatbot providing pilots with instant, context-aware weather summaries, regulatory information, and safety suggestions.
- Secure Authentication: A robust, JWT-based authentication system that provides distinct, permission-based access for pilots and administrators.
- Comprehensive Monitoring Dashboard: Access to deeper weather analytics and monitoring tools for a fleet-level overview.
- Data Integrity: Includes logic for weather spoofing detection to flag suspicious or manipulated data transmissions (future implementation).
- Enhanced Intelligence Access: Full, unfiltered access to all weather intelligence data to support critical decision-making from the ground.
The backend of AeroSentry is built on a modern, high-performance Node.js stack chosen for its asynchronous nature and robust ecosystem.
The application uses Express.js, a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
- Asynchronous by Nature: Node.js and Express excel at handling I/O-bound operations, such as making multiple simultaneous network calls to fetch METARs, TAFs, and SIGMETs. Using
Promise.all, we can fire off all data requests concurrently, dramatically reducing response times. - Middleware Architecture: Express uses a powerful middleware system, which is perfect for creating reusable logic for authentication, logging, and error handling. Our
verifyTokenMiddlewareis a prime example, protecting routes by checking for a valid JWT before any other logic runs.
axios: A promise-based HTTP client for making requests to the external aviation weather APIs.jsonwebtoken(jwt): Used to create and verify the secure JSON Web Tokens for our authentication system.bcryptjs: A library to hash passwords for secure storage and comparison (recommended over plain text).csv-parser: A streaming CSV parser used for high-performance, in-memory loading of theairports.csvdatabase at startup.geographiclib-geodesic&@turf/turf: A powerful duo for geospatial analysis:geographiclib-geodesiccalculates the true geodesic path (shortest line on Earth's surface) for accurate route plotting.@turf/turfprovides the computational geometry engine to represent flight paths and hazardous weather zones as GeoJSON objects, enabling the core intersection logic for rerouting.
The application logic follows a secure and efficient flow from user authentication to final data delivery.
-
Authentication (
/login):- A user (pilot or admin) submits their credentials.
- The server validates them against the user database.
- If successful, the server generates and returns a secure JWT (JSON Web Token).
-
Mission Briefing (
/mission-briefing/:departure/:destination):- The pilot makes a request, including the JWT in the
Authorizationheader. - The
verifyTokenMiddlewareguard intercepts the request to verify the JWT's validity and the user's role before allowing the request to proceed. - Concurrent Data Fetching: The server uses
Promise.allto fire offaxiosrequests for all necessary data (coordinates, METAR, TAF, SIGMETs) at once. - Analysis & Rerouting:
- The route is calculated and broken down into segments using
geographiclib. - SIGMETs are parsed into GeoJSON
Polygonobjects using Turf.js. - The code iterates through each flight segment, checking if it intersects with a SIGMET polygon using
turf.booleanIntersects. - If a hazard is detected, the
findSigmetReroutefunction calculates a detour by creating a new waypoint.
- The route is calculated and broken down into segments using
- Response Assembly: All processed data—departure/destination weather, the final (potentially rerouted) flight path, and overall risk—is compiled into a single JSON response for the frontend.
- The pilot makes a request, including the JWT in the
Follow these instructions to get the AeroSentry backend up and running on your local machine.
- Node.js (v16 or higher recommended)
- npm (usually comes with Node.js)
-
Clone the repository:
git clone https://github.com/your-username/aerosentry.git cd aerosentry -
Create a
.envfile in the root of the project and add your secret key:PORT=8000 SECRET_KEY="your_super_secret_jwt_key_that_is_long_and_secure"
-
Install the required dependencies:
npm install
-
Download the Airport Database:
- Download the
airports.csvfile from OurAirports.com. - Place it in the root directory of the project.
- Download the
-
Run the application:
node server.js
The API will now be running at
http://localhost:8000.
The API provides the following core endpoints:
| Method | Endpoint | Description | Access |
|---|---|---|---|
POST |
/login |
Authenticates a user and returns a JWT access token. | Public |
GET |
/mission-briefing/:departure/:destination |
Provides a full weather briefing for a route. Requires a valid JWT. | Pilot/Admin |
GET |
/admin/analytics |
(Example) An endpoint for fetching administrative data. | Admin |
Contributions are welcome! If you'd like to improve AeroSentry, please feel free to fork the repository and submit a pull request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for more details.
- Weather Data: aviationweather.gov
- Airport Data: OurAirports.com
- Framework: Express.js
- 3D Globe: Globe.gl