Skip to content

Amanmandal-M/Flurn_Booking_System_Backend

Repository files navigation

Booking Service Backend

About


This is Flurn Company Assignment this is for booking seats.


Clone Repository

git clone https://github.com/Amanmandal-M/Flurn_Booking_System_Backend.git

Installation

npm i -g nodemon
npm install / npm i

Start the Backend server

node index.js

nodemon index.js

Note : You can use any of them


MVC Structure

├── index.js
├── configs
|    └── db.js
├── models
|    └──  seatsModel.js
|    └──  seatsPricingModel.js
├── routes
|    └── seatRouter.js
|    └── bookingRouter.js
├──controllers
|    └── dataConverterController.js
|    └── seatController.js

Note:

  • Before doing anything first create .env file and put PORT , MONGO_URI
  • PORT is for listening the server.
  • MONGO_URI is for running database and store your data in database so put your mongo link.

Swagger API documentation


Backend Deployment Link


Schema Design


Seats Schema

{
    _id: ObjectId,
    id: {
        type: String,
        required: true
    },
    seat_identifier: {
        type: String,
        required: true
    },
    seat_class: {
        type: String,
        required: true
    },
    is_booked : {
        type: Boolean,
        required: false
    }
}

Seats Pricing Schema

{
    _id: ObjectId,
    id: {
        type: String,
        required: true,
    },
    seat_class: {
        type: String,
        required: true,
    },
    min_price: {
        type: String,
        default: null,
    },
    normal_price: {
        type: String,
        required: true,
    },
    max_price: {
        type: String,
        default: null
    },
}

Endpoints

METHOD ENDPOINT DESCRIPTION STATUS CODE
GET /api/seats This endpoint should allow users for retrieving all seats data. 200
GET /api/seats/:id This endpoint should allow users to for retrieving a single seats by ID. 200
POST /api/seats This endpoint is for for adding new seat data. 200
POST /api/seatPricing This endpoint is for for adding new seat pricing data. 200
DELETE /api/seats/:id This endpoint is for deleting seats data by ID. 202
DELETE /api/seatPricing/:id This endpoint is for deleting seats Pricing data by ID. 202

Releases

No releases published

Packages

No packages published