Git Product home page Git Product logo

bookifly's Introduction

BookiFLY

Intro

This is a RESTAPI made for Flight Booking Web Application

Description

For Admins

Admin can create a flight by providing the following ->
Origin
Destination
Flight name
Seat Configuration for each class

Seat Configuration for a particular class->
Seats in a row
Number of rows
Base Price

When the admin creates a flight then he/she has to provide the seat configuration for each and every class

Classes ->
First Class
Business Class
Economy Class

After that every seat in each class will be populated with a seat number and a unique system generated PNR which is a 8 digit alpha - numeric code

1st digit of the PNR -> shows the class
F -> First Class
B -> Business Class
E -> Economy Class
2nd digit of the PNR -> shows the seat number in each class
F1 -> Seat number 1 in First Class
B2 -> Seat number 2 in Business Class
E3 -> Seat nunber 3 in Economy Class
Remaining digits -> randomly generated

For Users

User can select the origin and the destination
After he selects the origin and the destiantion all the flights available for that route will be displayed to the user
After that user needs to select a particular flight and provide the class in which he/she wants the ticket in.
After that according to the selection entire seat map for that particular flight and class will be displayed to the user
Now user can select any seat by providing seat number and PNR
Ticket for that particular user will be generated

Tech Stack

Javascript
Node.js
Express.js
MongoDB
Mongoose

Salient Features

Implementation of Middlewares
Implementation of Controllers
Implementation of Error Handlers
Implementation of Async Handlers
User Authentication and Authorization
Admin Authentication and Authorization
CRUD operations
Password Hashing
JWT Token Generation
JWT Token Verification
Implementation of Public Routes
Implementation of Protected Routes
Relationship Handling in MongoDB

Dependencies

npm i nodemon
npm i express
npm i mongoose
npm i express-async-handler
npm i bcrypt
npm i jsonwebtoken
npm i dotenv
npm i cors

Running the server

npm run dev

Content of .env file

PORT
CONNECTION_STRING -> for connecting to our Database
ACCESS_TOKEN_SECRET_USER
ACCESS_TOKEN_SECRET_ADMIN

API DOCS

For Admins

CRUD Operation HTTP Method API Endpoint Type
Sign Up POST /admins/signup public
Login POST /admins/login public
Post a flight POST /admins/post private

For Users

CRUD Operation HTTP Method API Endpoint Type
Sign Up POST /users/signup public
Login POST /users/login public
Select source and destination POST /users/selectSD private
Select a flight POST /users/selectFlight private
Select a seat POST /users/selectSeat private

API Testing

API testing is done by Thunder Client and Postman is used for publishing the API DOCS provided in the description.

Images

For Admins

image
image
image
image

For Users

image
image
image
image
image
image
image
image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.