Skip to content

advanced-computer-lab/WeekEnd-developers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JetAway

Build Status

Project Description

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.

Motivation

The motive behind this project is to facilitate the flight reservation process by enhancing the searching and selection processes.

Tech

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.

Features

The user is able to..

  • Search & Filter through a list of available flights based on his desired criteria

alt text

  • Choose his seats on the flight alt text

  • Reserve and pay for his reservation online using his credit card

  • Download his reservation ticket. (BONUS) alt text

  • 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.

  • Check the weather of the city he is travelling to. (BONUS) alt text

  • 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) alt text
  • 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.

Installation

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

Tests to validate the features and functionalities have been tested using unit tests (jest) and using postman

Contribute

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

API Reference

Payement

  POST /user/payement

Payement for a reservation.

Body Type Description
Amount string Required. The amount to be paid by the user

Edit Payement

  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

Cancel Reservation

  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

Email Cancellation

  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.

Email Reservation

  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

Email Partial Refund

  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

Edit 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

Edit 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 all flights

  GET /admin/get_all_flights

Get flight

  GET /admin/get_flight/${flightID}
Parameter Type Description
flightID string Required. id of flight to fetch

Create flight

  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 flight

  DELETE /admin/delete_flight/${flightID}
Parameter Type Description
flightID string Required. id of flight to delete

Update flight

  PATCH /admin/update_flight/${flightID}
Parameter Type Description
flightID string Required. id of flight to update

Edit reservation

  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 all summaries

  GET /user/summaries
Body Type Description
{Token} json Required. Token containing information about the user

Create summary

  POST /user/summaries
Body Type Description
{ DepartureFlight, ReturnFlight, DepartureBooking, ReturnBooking } json Required. information about departure and return trips

Get all upcoming flights

  GET /user/all_flights
Body Type Description
N/A N/A Fetches all upcoming flights in the future

Get all return flights that the user has not booked yet

  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 all flights which their departure dates are in the future

  GET /user/available_flights/${Token}
Body Type Description
{ Token } json Fetches all the available flights which their departure dates are in the future

Reserve flight

  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|

Login

  POST /login
Body Type Description
{Username, Password} json Login using username and password

Register

  POST /register
Body Type Description
{ Username, Email, Password, FirstName, LastName, Admin, HomeAddress, CountryCode, TelephoneNumbers, PassportNumber } json Inserts the user in the database

Get flight

  GET /get_flight/:flightID
Parameter Type Description
flightID string Required. Id of a flight to be fetched

Edit user data

  PATCH /edit_user/:Token
Parameter Type Description
Token string Required.Token for authenticating users' data

Get user

  GET /get_user/:Token
Parameter Type Description
Token string Required.Token for authenticating users' data

Change user password

  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

Request reset password

  POST /requestResetPassword
Parameter Type Description
Token string Token for authenticating users' data
Body Type Description
{email} json user email

Reset password

  POST /resetPassword
Body Type Description
{Token, newPassword} json Token for authenticating users' data and new password

Code style

  • A space between parameters

  • Curly brace { of conditions and functions on the same line

  • Semicolon is not manditory

  • Horizontal indents are manditory

Roadmap

  • Deployement

  • Logging in with Google & Facebook

Credits

antd: https://ant.design/
Material UI: https://mui.com/
React icons: https://react-icons.github.io/react-icons/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published