![](https://private-user-images.githubusercontent.com/35245789/322225894-5582c5b9-8cdb-4106-9208-27a283620284.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzMTc4NzMsIm5iZiI6MTcyNDMxNzU3MywicGF0aCI6Ii8zNTI0NTc4OS8zMjIyMjU4OTQtNTU4MmM1YjktOGNkYi00MTA2LTkyMDgtMjdhMjgzNjIwMjg0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDA5MDYxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdhODYwYjMzN2MyMGE0ODBjZDRkYWRiY2U0OTIzNjVkZDJkZmQwZjcwZmYyZDVhZTM4NzY2ZDhiNzIzNTEzMTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Vr3yLFbY--r3WOEyrR5AQUhwnNJnE33DzhMKlKPQ_E4)
- Developed a booking app where one can book movies and see their last booking details.
- Created a submit button that on click makes a booking if all the required data(movie name, slot, least one ticket) is selected.
- After the successful booking, all selection are cleared.
- If booking successful, then the last booking is updated without making a new GET request.
- Used localStorage to store temporary selection made by the user.
- MERN stack
- React JS.
- Mongo DB.
- Node JS., Express JS.
-
Set up environment variables:
-
Create a
.env
file in thesrc
directory. -
Add the following variables to the
.env
file, replacing the placeholder values with your actual credentials:MONGO_URI="your_MongoDb_uri"
-
Again Create a
.env
file in thesrc/client
directory. -
And again add:
REACT_APP_URL="Your backend server url " (optional by default set to http://localhost:3000)
-
-
Install dependencies and run server:
cd src/client
npm install
npm start
cd src/
npm install
npm start
Endpoint | Description | Method | Request Body | Response Format (Example) |
---|---|---|---|---|
/api/booking |
last booking details | GET | None | {movie:string, slot:string, seats:{A1?:number , A2?:number, A3?:number, A4?:number, D1?:number, D2?:number}} And If no Booking exist: {message: "no previous booking found" } |
/api/booking |
Book seat | POST | {movie:string, slot:string, seats:{A1?:number , A2?:number, A3?:number, A4?:number, D1?:number, D2?:number}} |
{movie:string, slot:string, seats:{A1?:number , A2?:number, A3?:number, A4?:number, D1?:number, D2?:number}} |