This is a sample backend for ticket booking system with the following features
- Search all the movies playing in a city
- Check all cinemas in which a movie is playing along with all the showtimes
- For each showtime, check the availability of seats
- User Sign up and login
- Book a ticket (No payment gateway integration. The tickets are for free 😏)
- Clone or Download the reposirtory.
- Open
/BookMyTicketsBackend/BookMyTicket.slnsolution file. - Build it.
- Run it! (Don't forget to set up the DB and change the connection string before running it 😉)
- In Visual Studio right click on
/BookMyTicketsBackend/BookMyTicket.DB/BookMyTicket.DB.sqlprojproject file. - Click on
Schema Comparein the context menu.
- Make your DB as target DB by following the screenshots.

- Click on Compare to compare source DB with target DB.

- Click on Update target to update the objects from source DB to your DB.

- Change connection string in
/BookMyTicketsBackend/BookMyTicket.API/appsettings.jsonfile with keyConnectionString
By now after running it you should be seeing the gorgeous Swagger UI 😍

http://localhost:44367/api/Search/GetAllCities
Returns all the cities in the database. Pick a City here and remember it's ID.
http://localhost:44367/api/Search/GetMoviesByCity/{CityID}
Returns all movies available in the city. Pick a Move here and remember it's ID.
http://localhost:44367/api/Search/GetAllShowsByMoviesAndCity/{CityID}/{MovieID}
Returns All the cinemas and shows in which the movie is being played in the city. Pick a Show here and remember it's ID.
http://localhost:44367/api/Search/GetSeatingLayoutByShow/{ShowID}
Returns all the seats for a show with booking status. Pick the required number of seats here and remember their IDs.
http://localhost:44367/api/User/Signup
Creates a user and returns true id user registration is successful. Find the request object example below.
{
"firstName": "First Name",
"lastName": "Last Name",
"email": "email@test.com",
"password": "passwor@123"
}http://localhost:44367/api/User/Signin
Generates user context with authentication token if credentials match with any of the registered users in the system and returns it. Find the request object example below.
{
"email": "email@test.com",
"password": "passwor@123"
}http://localhost:44367/api/Tickets/BookTicket
Books a ticket free of cost and returns the ticket. Find the request object example below.
{
"showID": 1,
"seatIDs": [
1,2
]
}Don't forget to include the bearer token in the headers for authentication while trying to book a ticket.