For backend Code(and detailed API docs) : https://github.com/heysujal/hack-to-hire-backend
Video
ezgif-3ba160bb3064b3.mp4
User View
/admin route
Changing the status of Flight 1003 From "Arrived" to "Delayed"
Notification Received on Tracker Page
npm i- Configure SERVER_URL and SERVER_ENDPOINT as per choice in
constants/api.ts npm run dev
- Departure Time: The time at which the flight will depart from the source.
- Arrival Time: The time at which the flight will reach the destination.
- App Notifications: User will be able see app notifications only if, he is on
/trackerroute and has subscribed for app notifications for a flight. If the user refreshes the app he will not get notifications again. - Flights: All flights are from IndiGo and their flight id starts with
6E(space is intentional)
- Frontend: React, CSS, JavaScript, TypeScript
- Backend: Express, Node.js,
- Database: MongoDB
- UI Frameworks: Magic UI, Tailwind CSS, Mantine.dev
- Frontend: Zustand, React Router DOM, ThunderClient
- Backend: Mongoose, bcrypt, Twilio, Nodemailer, Nodemon
- Enter flight details (flight ID is optional).
- View all matching flights.
- Expand results for more details.
- Subscribe using email, phone, or app notifications.
- Duplicate details for the same flightId will throw error.
- Route:
/admin - Access: Requires login. Upon login redirects to
/updateroute. For Signup no UI is there, only API is available. - Functionality:
- Enter a specific flightId to update details.
- Editable fields: Scheduled/actual arrival, scheduled/actual departure, gates, status.
- Read-only fields: Flight number, source, destination.
- On Clicking the update button the backend fetches all the subscribers for the particular flight_id and sends them notifications in their preferred way.
- wait for the alert message to show up.
-
Flights API (
/api/flights/):GET /- Get all flightsPOST /- Create a new flightGET /search- Search for flightsGET /:id- Get a flight by ID
-
Admin API (
/api/admin/):POST /signup- Admin signupPOST /login- Admin loginGET /flights/:id- Get flight details by IDPUT /flights/:id- Update flight details by ID
-
Subscription API (
/api/subscriptions/):POST /:flightId/subscribe- Add a subscriber to a flightGET /:flightId- Get all subscribers for a flight
- Models: Define the schema for flights, admins, and subscriptions.
- Controllers: Handle the business logic for each API endpoint.
- Routes: Define the endpoints and link them to the appropriate controllers.
- Admin Login: Uses bcrypt for password hashing and JWT for authentication.
I do not own any copyrighted images used in the webapp. They are either taken from Flaticon or IndiGo Website for sake of this project.







