Skip to content

ayushi9797/mock_6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mock_6

Air Ticket Booking

Air Ticket Booking

✈️✈️✈️✈️✈️✈️✈️✈️✈️✈️✈️✈️

TECH_STACKS

  • Nodejs

Modules

  • Nodemon
  • express
  • bcrypt

REQUIREMENTS

  • USER ABLE TO REGISTER
  • USER ABLE TO LOGIN
  • AUTHENTICATION PROVIDED FOR VISTING DIFFERENT ROUTES
  • USER BOOK THE FLIGHT
  • USER GET THE FLIGHT
  • USER UPDATE THE FLIGHT
  • USER DELETE THE FLIGHT

Database

  • Mongodb
METHOD ENDPOINT DESCRIPTION STATUS CODE
POST /api/register This endpoint should allow users to register. 201
POST /api/login This endpoint should allow users to login. 201
GET /api/flights This endpoint should return a list of all available flights. 200
GET /api/flights/:id This endpoint should return the details of a specific flight identified by its ID. 200
POST /api/flights This endpoint should allow users to add new flights to the system. 201
PUT / PATCH /api/flights/:id This endpoint should allow users to update the details of a specific flight identified by its ID. 204
DELETE /api/flights/:id This endpoint should allow users to delete a specific flight identified by its ID. 202
POST /api/booking This endpoint should allow the user to book flights. 201
GET /api/dashboard This point should list all the bookings so far with the user and flight details. 200

The backend should have the following models

User Model

👥👤

{

  "name": "String",
  "email": "String",
  "password": "String"
}

🔏
{
"name": "ayushi",
"email": "ayushi12@gmail.com",
"password": "1234"
}

🔓
{
"name": "ayushi",
"email": "ayushi12@gmail.com",

}

http://localhost:8080/register

http://localhost:8080/login

FLIGHT MODEL ✈️

{

"'airline'": "String",
"flightNo": "String",
"departure": "String",
"arrival": "String",
"departureTime": "Date",
"arrivalTime": "Date",
"seats": Number,
price: Number

}

{

"'airline'": "ayushi lines",
"flightNo": "78",
"departure": "shimla",
"arrival": "goa",
"departureTime": "05-16-2004",
"arrivalTime": "03-12-2000",
"seats": 9,
"price": 9000

}

CRUD OPERATION 📕📗📘📚

API for CRUD operations

POST REQUEST

-http://localhost:8080/flights

GET REQUEST

-http://localhost:8080/flights

GET BY ID

PATCH REQUEST

DELETE REQUEST

BOOKIngg routes

http://localhost:8080/dashboard

http://localhost:8080/booking