Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/amanmandal-m/flurn_booking_system_backend

This is Flurn Company Assignment this is for booking seats backend system .
https://github.com/amanmandal-m/flurn_booking_system_backend

cors csvtojson dotenv express-js mongoose node-js render swagger-docs swagger-ui

Last synced: about 2 months ago
JSON representation

This is Flurn Company Assignment this is for booking seats backend system .

Awesome Lists containing this project

README

        

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



Swagger



## Backend Deployment Link



Railway



## Schema Design



Seats Schema

```js
{
_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

```js
{
_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