Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search Sign up Reseting focus

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

README.md

Latest commit

History

246 lines (181 loc) · 5.25 KB

README.md

File metadata and controls

246 lines (181 loc) · 5.25 KB

Event Booking System

Overview

The Event Booking System is a web application built with Node.js, TypeScript, Express.js, and MongoDB. It provides functionality for managing events and booking tickets. The system supports creating events, booking tickets with limits, and printing tickets.

Features

Live Demo

You can access the live version of the application here.Please note that it may take around 10-20 seconds for the demo to spin up.

API Endpoints

Events

POST /api/events

< "name": "Music Concert", "date": "2024-09-15T19:00:00Z", "totalTickets": 100 >
< "success": true, "data": < "_id": "64c5f6d4e8a84e30c8b5fcd0", "name": "Music Concert", "date": "2024-09-15T19:00:00.000Z", "totalTickets": 100, "bookedTickets": 0, "remainingTickets": 100, "__v": 0 >, "message": "Event created successfully" >

GET /api/events

< "success": true, "data": [ < "_id": "64c5f6d4e8a84e30c8b5fcd0", "name": "Music Concert", "date": "2024-09-15T19:00:00.000Z", "totalTickets": 100, "bookedTickets": 0, "remainingTickets": 100 > ], "message": "Events retrieved successfully" >

GET /api/events/:id

< "success": true, "data": < "_id": "64c5f6d4e8a84e30c8b5fcd0", "name": "Music Concert", "date": "2024-09-15T19:00:00.000Z", "totalTickets": 100, "bookedTickets": 0, "remainingTickets": 100 >, "message": "Event retrieved successfully" >

Bookings

POST /api/bookings

< "userId": "64c5f6d4e8a84e30c8b5fcd1", "eventId": "64c5f6d4e8a84e30c8b5fcd0", "quantity": 5 >
< "success": true, "data": < "_id": "64c5f6d4e8a84e30c8b5fcd2", "userId": "64c5f6d4e8a84e30c8b5fcd1", "eventId": "64c5f6d4e8a84e30c8b5fcd0", "quantity": 5, "timestamp": "2024-08-02T12:34:56.000Z", "__v": 0 >, "message": "Booking created successfully" >

GET /api/bookings

< "success": true, "data": [ < "_id": "64c5f6d4e8a84e30c8b5fcd2", "userId": "64c5f6d4e8a84e30c8b5fcd1", "eventId": "64c5f6d4e8a84e30c8b5fcd0", "quantity": 5, "timestamp": "2024-08-02T12:34:56.000Z" > ], "message": "Bookings retrieved successfully" >

DELETE /api/bookings/:id

< "success": true, "message": "Booking canceled" >

POST /api/bookings/print-ticket

< "bid": "64c5f6d4e8a84e30c8b5fcd2" >