Code Monkey home page Code Monkey logo

air-ticket-booking-mock-3's Introduction

Air Ticket Booking

 routes: {
            userRoute: {
                register: { METHOD: "POST", ENDPOINT: '/api/register', DESCRIPTION: 'This endpoint should allow users to register. Hash the password on store' },
                login: { METHOD: "POST", ENDPOINT: '/api/login', DESCRIPTION: 'This endpoint should allow users to login. Return JWT token on successful login.' }
            },
            flightRouter: {
                getAllFlight: { METHOD: "GET", ENDPOINT: '/api/flights', DESCRIPTION: 'This endpoint should return a list of all available flights.' },
                getFlightById: { METHOD: "GET", ENDPOINT: '/api/flights/:id', DESCRIPTION: 'This endpoint should return the details of a specific flight identified by its ID.' },
                addNewFlight:{ METHOD: "POST", ENDPOINT: '/api/flights', DESCRIPTION: ' This endpoint should allow users to add new flights to the system.' },
                updateFlightData:{ METHOD: "PUT / PATCH ", ENDPOINT: '/api/flights/:id', DESCRIPTION: 'This endpoint should allow users to update the details of a specific flight identified by its ID.' },
                deleteFlightById:{ METHOD: "DELETE", ENDPOINT: '/api/flights/:id', DESCRIPTION: 'This endpoint should allow users to delete a specific flight identified by its ID.' }
            },
  
        }

Instructions:

  • Read the entire question carefully for at least 15 mins, understand it and then code it.
  • Commit your code every 30min with a proper commit message to your repository (we will monitor every commit)
  • Use Node, Express, Mongo (NEM) for backend.

Problem Statement:

The task is to create backend for a Air Ticket booking system that allows users to book flights for their desired destinations.

Instructions:

The system should be built using Node.js, Express.js, and MongoDB (NEM) as the backend stack.

  • The backend should have the following models
  • User Model
{
  _id: ObjectId,
  name: String,
  email: String,
  password: String
}
  • Flight Model
{
  _id: ObjectId,
  airline: String,
  flightNo: String,
  departure: String,
  arrival: String,
  departureTime: Date,
  arrivalTime: Date,
  seats: Number,
  price: Number
}
  • Booking Model
{
	 _id: ObjectId,
	 user : { type: ObjectId, ref: 'User' },
	 flight : { type: ObjectId, ref: 'Flight' }
}

The following API routes should be developed to achieve the required functionality:

  • **Populate all the Object ID’s in the API response.
METHOD ENDPOINT DESCRIPTION STATUS CODE
POST /api/register This endpoint should allow users to register. Hash the password on store 201
POST /api/login This endpoint should allow users to login. Return JWT token on successful 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. (Populate the entire flight and user data, and not just id’s 200
PUT/PATCH /api/dashboard/:id This endpoint should allow the user to edit / update a booking. 204
DELETE /api/dashboard/:id This endpoint should allow the user to delete a booking 202

Important Note :

  • Write proper documentation for your API’s clearly specifying what should be the body of your POST API’s, what are the different response API will return. (On your GitHub Readme). You are free to use Postman Documentation or Swagger to implement this.
  • Make a video demonstrating that all the API endpoints are working correctly and giving right expected output. Use Postman or ThunderClient to demonstrate this.
  • ***Make sure the video is demonstrating working of all the endpoints clearly in detail, failing to do so may after your scores.

Submission:

  • Submit Backend deployed link
  • Submit GitHub Repo with proper API documentation Readme
  • Submit Recorded Video Drive Link (Make sure it is made public)

Rubrics:

  • Node
  • Express
  • Mongo
  • Backend API
  • Code cleanliness and folder structure.

air-ticket-booking-mock-3's People

Contributors

rbhomale17 avatar

Watchers

 avatar

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.