Skip to content

Aariv/TrainTicketBookingSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Train Ticket Booking System

App to be coded

I want to board a train from London to France. The train ticket will cost $5.

Create an API where you can submit a purchase for a ticket. Details included in the receipt are:
a) From, To, User , price paid.
(i) User should include first and last name, email address
The user is allocated a seat in the train. Assume the train has only 2 sections, section A and section B.
An API that shows the details of the receipt for the user
An API that lets you view the users and seat they are allocated by the requested section
An API to remove a user from the train
An API to modify a user's seat

Stack

Java Spring Swagger

How to use this code?

  1. Make sure you have Java 17 and above and Maven installed

  2. Fork this repository and clone it

$ git clone https://github.com/Aariv/TrainTicketBookingSystem
  1. Navigate into the folder
$ cd TrainTicketBookingSystem
  1. Install dependencies
$ mvn clean install
  1. Run the project
$ mvn spring-boot:run
  1. Navigate to http://localhost:8080/swagger-ui.html in your browser to check everything is working correctly. You can change the default port in the application.properties file
server:
  port: 8080

Swagger UI

Screenshot 2024-05-15 at 3 51 23 PM

API where you can submit a purchase for a ticket

Screenshot 2024-05-15 at 3 53 34 PM

API that shows the details of the receipt for the user

Screenshot 2024-05-15 at 4 01 30 PM

API that lets you view the users and seat they are allocated by the requested section

Screenshot 2024-05-15 at 4 03 29 PM

API to remove a user from the train

Screenshot 2024-05-15 at 4 03 58 PM

API to modify a user's seat

Screenshot 2024-05-15 at 4 04 29 PM