Presentation PPT - Flight Status & Tracking System
Video Demo -
Flight.Status.project.mp4
A comprehensive system for real-time flight status updates, designed to notify users about tagged flights through email and SMS. Built with FastAPI, MongoDB, RabbitMQ, and React.
The Real-Time Flight Status Tracking System provides users with real-time updates on flight statuses. Users can tag specific flights they want to monitor, and receive updates through email and SMS.
- Real-time flight status updates
- Notifications via email and SMS for tagged flights
- Search for flights by departing, arriving, flight number, and departure date
- User-friendly interface for tagging and monitoring flights
- Backend: FastAPI
- Database: MongoDB
- Message Queue: RabbitMQ
- Frontend: React, Typescript
- Python 3.x
- Node.js
- MongoDB
- RabbitMQ
-
Clone the repository:
git clone https://github.com/yourusername/flight-status-tracker.git cd flight-status-tracker/backend
-
Install dependencies:
fastapi pydantic uvicorn pymongo python-dotenv requests twilio pika
Create and Activate Virtual Environment
```sh
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
```
-
Create a
.env
file with the following variables:MONGODB_CONNECTION_STRING=your_mongodb_connection_string MAILGUN_API_KEY=your_mailgun_api_key MAILGUN_DOMAIN=your_mailgun_domain NOTIFICATION_TO_EMAIL=your_email TWILIO_ACCOUNT_SID=your_twilio_account_sid TWILIO_AUTH_TOKEN=your_twilio_auth_token TWILIO_PHONE_NUMBER=your_twilio_phone_number NOTIFICATION_TO_PHONE=your_phone_number
-
Run the FastAPI server:
uvicorn main:app --reload
-
Navigate to the frontend directory:
cd ../frontend
-
Install dependencies:
npm install
-
Start the React development server:
npm start
- Visit the frontend URL (usually
http://localhost:3000
). - Use the search form to find flights.
- Tag flights to monitor them.
- Receive real-time updates for tagged flights.
- URL:
/api/flights
- Method:
GET
- Query Parameters:
departing
,arriving
,flightNo
,departureDate
- URL:
/api/flights/update
- Method:
POST
- Body: JSON containing flight details
@app.get("/api/flights")
async def get_flights(departing: str, arriving: str, flightNo: str, departureDate: str):
query = { ... }
flights = list(flights_collection.find(query, {"_id": 0}))
return flights
def send_email_notification(flight):
response = requests.post(
f"https://api.mailgun.net/v3/{MAILGUN_DOMAIN}/messages",
auth=("api", MAILGUN_API_KEY),
data={"from": f"Flight Notifications <mailgun@{MAILGUN_DOMAIN}>",
"to": NOTIFICATION_TO_EMAIL,
"subject": f'Flight {flight["flightNumber"]} Status Update',
"text": f'Flight {flight["flightNumber"]} status changed to {flight["status"]}. Gate: {flight["gate"]}, Departure Time: {flight["departureTime"]}, Arrival Time: {flight["arrivalTime"]}.'})
const handleSubmit = (e) => {
e.preventDefault();
fetchFlights(formData);
};
const tagFlight = (flight) => {
setTaggedFlights([...taggedFlights, flight]);
};
Contributions are welcome! Please submit a pull request or open an issue to discuss improvements or features.