This project is a flight status board built with ReactJS that displays the status of various flights. It also includes a feature to send email notifications to users.
- Displays flight status in a table.
- Fetches flight data from an external API.
- Sends email notifications for delayed flights.
- Node.js
- npm (Node Package Manager)
- ReactJS
-
Clone the repository:
git clone https://github.com/Harshitjoc/Flight_Status_And_Notification.git cd Flight_Status_And_Notification/server -
Install the dependencies:
npm install
OR
npm i
-
Create a
.envfile in thebackenddirectory and add your email credentials:
- Check
.env.samplefile
-
Start the backend server:
node index.js
-
Navigate to the
clientdirectory:cd ../client -
Install the dependencies:
npm install
-
Start the ReactJS development server:
npm start
The project is divided into two main parts:
- Backend: A Node.js and Express.js server that handles sending email notifications.
- Frontend: A ReactJS application that displays flight statuses and sends requests to the backend for email notifications.
index.js: The main file that sets up the Express server and handles email sending using Nodemailer.
src/components/FlightTable.js: The main React component that fetches flight data from an API and displays it in a table.src/index.js: The entry point for the React application.
The backend server uses the following environment variables:
- SENDER_EMAIL: The email address from which notifications will be sent.
- SENDER_EMAIL_PASS: The password for the email account.
- RECEIVER_EMAIL: The email address in which notifications will be received.
- Ensure both the backend and frontend servers are running.
- Open the frontend application in your browser (typically at
http://localhost:3000). - The flight statuses will be displayed in a table.
- If there are any delayed flights, an email will be sent to the specified email address with a list of all delayed flights.