JetAway is a web-based airline reservation system with two phases one for the admin and another for the user. JetAway offers round trips for its users to search and reserve from. It also allows admins to create, edit and delete flights.
The motive behind this project is to facilitate the flight reservation process by enhancing the searching and selection processes.
JetAway uses a number of open source projects to work properly:
- React - Javascript framework for frontend
- [node.js] - An open source development platform for executing - server-side javascript code.
- [Express] - Node.js framework for creating servers and APIs
- MongoDB - NoSQL database management system.
The user is able to..
- Search & Filter through a list of available flights based on his desired criteria
-
Reserve and pay for his reservation online using his credit card
-
Edit his reservation and paying/getting the refund of the difference
-
Cancel his reservation and request a refund.
-
Email himself a copy of his reservation.
-
Reset his password through his email. (BONUS)
-
Change his password
-
View his profile.
The admin is able to..
- View available flight
- Create flights
- Edit flights.
- Delete flights.
- The system is protected for both entities through private routes. (BONUS)
- The interface between the frontend and the backend is protected by the use of the jsonwebtoken for data authentication.
- The data is validated in the front end and the backend interfaces.
- The user is informed and guided when errors occur.
Install Node.js. You can refer to this documents for installing Node.js https://nodejs.org/en/download/ then install the dependencies and start the server. For starting the backend server:
cd backend
npm i
node app
For starting the frontend:
cd frontend
npm i
npm start
Tests to validate the features and functionalities have been tested using unit tests (jest) and using postman
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
POST /user/payement
Payement for a reservation.
Body | Type | Description |
---|---|---|
Amount |
string |
Required. The amount to be paid by the user |
POST /user/edit_payement
Edits the payement of the user after he edits his reservation.
Body | Type | Description |
---|---|---|
Amount |
string |
Required. The amount to be paid by the user |
PATCH /user/cancel_reservation/${reservation_number}
Cancel a reservation of the user
Parameter | Type | Description |
---|---|---|
reservation_number |
string |
Required. The number of the reservation to cancel |
POST /user/email_cancellation
Email sent to the user upon cancellation of reservation
Body | Type | Description |
---|---|---|
ReservationNumber |
string |
Required. The number of the reservation |
Email |
string |
Required. The email of the user to send on |
TotalPrice |
string |
Required. The total price to be refunded |
FlightNumber |
string |
Required. The number of the flight in the cancelled reservation |
FirstName |
string |
Required. First name of the user |
LastName |
string |
Required. Last name of the user |
ReturnPrice |
string |
Required. |
POST /user/email_reservation
Email sent to the user upon his reservation
Body | Type | Description |
---|---|---|
FirstBooking |
string |
Required. The data of the departure trip |
SecondBooking |
string |
Required. The data of the return trip |
Email |
string |
Required. The total price to be refunded |
FirstName |
string |
Required. First name of the user |
LastName |
string |
Required. Last name of the user |
POST /user/email_edit_refund
Email sent to the user informing him of a partial refund upon editing his reservation
Body | Type | Description |
---|---|---|
price |
string |
Required. The amount to be refunded |
Email |
string |
Required. The total price to be refunded |
FirstName |
string |
Required. First name of the user |
LastName |
string |
Required. Last name of the user |
PATCH /user/edit_user/${Token}
Route for editing users' data
Body | Type | Description |
---|---|---|
id |
json |
Required. The id of the user |
Parameter | Type | Description |
---|---|---|
Token |
json |
Required. Token for authenticating the user |
GET /user/get_current_flights/${Token}
Route for finding current flights reserved by the user
Body | Type | Description |
---|---|---|
id |
json |
Required. The id of the user |
Parameter | Type | Description |
---|---|---|
Token |
json |
Required. Token for authenticating the user |
GET /admin/get_all_flights
GET /admin/get_flight/${flightID}
Parameter | Type | Description |
---|---|---|
flightID |
string |
Required. id of flight to fetch |
POST /admin/create_flight
Body | Type | Description |
---|---|---|
{AllowedBaggege, DepartureTime, ArrivalTime, DepartureCountry,Departure, DepartureAirport, ArrivalCountry, Arrival, ArrivalAirport |
json |
Required. body of flight to create |
DepartureTerminal, ArrivalTerminal, ArrivalTime, DepartureCountry,Departure, BusinessTotalSeats, BusinessPrice, EconomyTotalSeats |
| EconomyPrice, FirstClassPrice, FirstClassSeats}
DELETE /admin/delete_flight/${flightID}
Parameter | Type | Description |
---|---|---|
flightID |
string |
Required. id of flight to delete |
PATCH /admin/update_flight/${flightID}
Parameter | Type | Description |
---|---|---|
flightID |
string |
Required. id of flight to update |
PATCH /user/edit_reservation
Body | Type | Description |
---|---|---|
{booking, changedSeats, newSeats, oldChildren, Token} |
json |
Required. new seats to be booked and old seats to mark as available |
GET /user/summaries
Body | Type | Description |
---|---|---|
{Token} |
json |
Required. Token containing information about the user |
POST /user/summaries
Body | Type | Description |
---|---|---|
{ DepartureFlight, ReturnFlight, DepartureBooking, ReturnBooking } |
json |
Required. information about departure and return trips |
GET /user/all_flights
Body | Type | Description |
---|---|---|
N/A |
N/A |
Fetches all upcoming flights in the future |
POST /user/return_flights
Body | Type | Description |
---|---|---|
{ Departure, Arrival, DepartureDate, Token } |
json |
Fetches all the available return flights based on the departure flights that the user chose |
GET /user/available_flights/${Token}
Body | Type | Description |
---|---|---|
{ Token } |
json |
Fetches all the available flights which their departure dates are in the future |
POST /user/reserve/${flightID}
|Parameter| Body | Type | Description |
| :-------- | :------- | | :------- |:-------------------------------- |
| flightID
|| { FlightNumber, TotalPrice, Seats, Children, Token }
| json
| Reserves a flight forthe user based on the seats he chose|
POST /login
Body | Type | Description |
---|---|---|
{Username, Password} |
json |
Login using username and password |
POST /register
Body | Type | Description |
---|---|---|
{ Username, Email, Password, FirstName, LastName, Admin, HomeAddress, CountryCode, TelephoneNumbers, PassportNumber } |
json |
Inserts the user in the database |
GET /get_flight/:flightID
Parameter | Type | Description |
---|---|---|
flightID |
string |
Required. Id of a flight to be fetched |
PATCH /edit_user/:Token
Parameter | Type | Description |
---|---|---|
Token |
string |
Required.Token for authenticating users' data |
GET /get_user/:Token
Parameter | Type | Description |
---|---|---|
Token |
string |
Required.Token for authenticating users' data |
PATCH /change_password/:Token
Parameter | Type | Description |
---|---|---|
Token |
string |
Required.Token for authenticating users' data |
Body | Type | Description |
---|---|---|
{OldPassword, Password} |
json |
user old password and new password |
POST /requestResetPassword
Parameter | Type | Description |
---|---|---|
Token |
string |
Token for authenticating users' data |
Body | Type | Description |
---|---|---|
{email} |
json |
user email |
POST /resetPassword
Body | Type | Description |
---|---|---|
{Token, newPassword} |
json |
Token for authenticating users' data and new password |
-
A space between parameters
-
Curly brace { of conditions and functions on the same line
-
Semicolon is not manditory
-
Horizontal indents are manditory
-
Deployement
-
Logging in with Google & Facebook
antd: https://ant.design/
Material UI: https://mui.com/
React icons: https://react-icons.github.io/react-icons/