This project is a web application that provides endpoints for various functionalities related to aircraft health and flight paths. It is built using FastAPI and serves as the backend for a dashboard application.
- Clone the repository:
git clone https://github.com/your-username/dashboard-project.git
- Navigate to the project directory:
cd dashboard-project
- Install dependencies:
pip install -r requirements.txt
- Start the server:
uvicorn main:app --reload
orpython -m api_code.app
- The API will be running on
http://localhost:8000
/health
: Returns a dictionary indicating the health of the application./aircraft
: Endpoint to get information about an aircraft./get_paths
: Endpoint to retrieve optimal routes from a source to a destination./nearest_airport
: Endpoint to identify the nearest airport to a provided airplane's current position.
https://docs.google.com/document/d/19fTsFrE78WA_-lMUVYW7ewuKmu67s4tXvbep-iNR0Eg/edit
fastapi
: FastAPI framework for building APIs.numpy
: Numerical computing library.uvicorn
: ASGI server for FastAPI.openap
: Library for calculating aircraft emissions.traffic
: Library for working with airport data.json
: Library for working with JSON data.
main.py
: Entry point for the application.api_code/algorithms/
: Implementation of a graph data structure and path algorithm.api_code/utils/
: Implementation of all util helpers.
This project visualizes flight paths on a map using React and Leaflet. It fetches real-time flight data, displays it on the map, and provides an optimal path for the selected flight. Additionally, it includes a comprehensive Health Dashboard to monitor the status and health of specific flights.
- Real-time Flight Data Visualization: Displays domestic and international flights on a map with distinct icons.
- Flight Details: View details such as flight ID, number, altitude, velocity, aircraft model, departure, and arrival airports.
- Optimal Path Calculation: Calculate and display the optimal path for a selected flight.
- Health Dashboard: A separate dashboard to view the health status of different flights, including maintenance history, emissions data, and nearby assistance information.
Ensure you have the following installed on your system:
- Node.js (v12 or later)
- npm (v6 or later)
-
Clone the repository:
-
Install dependencies:
npm install
-
Start the development server:
npm start
This will launch the application and open it in your default browser at http://localhost:3000
.
-
View Domestic and International Flights:
- Domestic flights are marked with a specific icon.
- International flights have a different icon.
- Click on any flight marker to see flight details in a popup.
-
Finding Optimal Path:
- In the popup, click the "Find Optimal Path" button.
- A loading spinner will indicate the processing of the request.
- Once the optimal path is fetched, it will be displayed on the map.
-
Searched Flight:
- If you search for a specific flight, its details and position will be highlighted on the map.
- You can also find the optimal path for a searched flight if it's a domestic flight.
-
Navigate to Health Dashboard:
- Go to the Health Dashboard page from the main navigation menu.
-
Search for Flight Health Information:
- Enter a flight number in the search input and press Enter.
- The dashboard will display the health status and other relevant details of the flight.
-
Flight Health Information:
- The Health Dashboard provides information such as:
- The dashboard also provides details about the nearest airport to the flight's current position, including the airport's name, latitude, longitude, elevation, GPS code, IATA code, city, and website link.
- Detailed emissions data for the flight, including CO2, H2O, SOx, and NOx emissions, is displayed along with corresponding graphs.
- The maintenance history of the flight is displayed in a table, showing past maintenance events and their details.
- The Health Dashboard provides information such as:
- Go to the Health Dashboard page from the main navigation menu.
- Enter a flight number (e.g., "AA123") in the search input and press Enter.
- The dashboard will display the health status and other relevant details of the flight.
-
MapComponent.jsx:
- Handles the rendering of the map using
react-leaflet
. - Displays flight markers and paths.
- Fetches and displays the optimal path for selected flights.
- Handles the rendering of the map using
-
HealthDashboard.js:
- Manages the state and rendering of the Health Dashboard.
- Fetches health data for a specific flight and displays it.
- Displays information such as emissions data, nearby assistance, and maintenance history.
-
App.js:
- Main application component that integrates
MapComponent
,HealthDashboard
, and manages state.
- Main application component that integrates
{
"src": [latitude, longitude],
"des": [latitude, longitude],
"on_air": true
}
{
"fly_status": "Can Fly",
"paths": [
[[lat1, lng1], [lat2, lng2], ...],
...
]
}
- React
- Leaflet
- Axios
- react-icons
https://docs.google.com/document/d/1tK_Lih3fDHWXxiw3JL9phlDDjgW2f2o5RuyHbiVDQQA/edit?usp=sharing