This project is a Cinema Room Management System developed using Maven and Java Spring Boot. The system allows users to manage cinema rooms, book seats, and perform various operations related to cinema management.
- Cinema Room Management: The system provides functionality to manage the cinema room.
- Ticket Management: The system enables users to purchase seats with a Tickets system which use a token as identifier. Users can return their tickets if it is necesary.
- Stats managment: The system enables users with password to get the stats for the cinema room.
- Clone the repository:
git clone https://github.com/VhugoJc/cinemaRoom.git- Navigate to the project directory:
cd cinemaRoom- Run the application:
mvn spring-boot:runThe application will start running on http://localhost:8080.
Once the application is running, you can access the Cinema Room Management System through a web browser or API testing tools like Postman.
The following endpoints are available:
- Endpoint:
GET /seats - Description: Retreives the total of rows, the total of columns and a list of available seats.
- Example request:
/api/todos - Example response:
{
"total_rows": 9,
"total_columns": 9,
"available_seats": [
{
"row": 1,
"column": 1,
"price": 10
},
{
"row": 1,
"column": 2,
"price": 10
},
...
{
"row": 9,
"column": 9,
"price":8
}
]
}- Endpount:
POST /purchase - Description: purchases a seat and remove it from the available seats list.
- Example request:
/purchase
{
"column":1,
"row":1
}- Example response:
{
"token": "755dce08-8750-4d0c-beb3-ef43d7a7c613",
"ticket": {
"row": 1,
"column": 1,
"price": 10
}
}- Endpoint:
POST /return - Description: returns the seat using the given token.
- Example request:
/return
{
"token":"755dce08-8750-4d0c-beb3-ef43d7a7c613"
}- Example response:
{
"returned_ticket": {
"row": 1,
"column": 1,
"price": 10
}
}- Endpoint:
GET /stats - Description: Retreives current income, number of available seats and number of purchased seats.
- Params:
-
password(required): Password to get the stats. - Example request:
/stats?password=super_secret - Example response:
{
"current_income": 40,
"number_of_available_seats": 77,
"number_of_purchased_tickets": 4
}The application uses the default configuration provided by Spring Boot. However, you can modify the configuration by editing the application.properties file located in the src/main/resources directory.
The project utilizes the following dependencies:
- Spring Boot
- Maven
Please refer to the pom.xml file for a complete list of dependencies and their versions.
If you wish to contribute to this project, you can follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Implement your changes.
- Test your changes thoroughly.
- Commit and push your changes to your forked repository.
- Create a pull request, describing your changes in detail.
This project is licensed under the MIT License.