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
-
Make sure you have Java 17 and above and Maven installed
-
Fork this repository and clone it
$ git clone https://github.com/Aariv/TrainTicketBookingSystem
- Navigate into the folder
$ cd TrainTicketBookingSystem
- Install dependencies
$ mvn clean install
- Run the project
$ mvn spring-boot:run
- Navigate to
http://localhost:8080/swagger-ui.html
in your browser to check everything is working correctly. You can change the default port in theapplication.properties
file
server:
port: 8080
![Screenshot 2024-05-15 at 3 51 23 PM](https://private-user-images.githubusercontent.com/11393142/330764528-81ce01b1-8996-4d80-bd4c-aff77893194a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxMDQ5NzQsIm5iZiI6MTcyNTEwNDY3NCwicGF0aCI6Ii8xMTM5MzE0Mi8zMzA3NjQ1MjgtODFjZTAxYjEtODk5Ni00ZDgwLWJkNGMtYWZmNzc4OTMxOTRhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMxVDExNDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ1OGM1ZmE1NzYxODNhNjZlZWM3NmU5MzJjMmExY2QwNzQ5MDIwNmE2OWE5YjAxYjQ3NGRmZjJjODFjZDc3M2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.lEw-RRKIuOLvqnV52Vtq0ywX1REjI18S1wmmtfGShbc)
![Screenshot 2024-05-15 at 3 53 34 PM](https://private-user-images.githubusercontent.com/11393142/330764988-f1b8594e-21d5-4503-8611-242e34338747.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxMDQ5NzQsIm5iZiI6MTcyNTEwNDY3NCwicGF0aCI6Ii8xMTM5MzE0Mi8zMzA3NjQ5ODgtZjFiODU5NGUtMjFkNS00NTAzLTg2MTEtMjQyZTM0MzM4NzQ3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMxVDExNDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRiNWEzZmM3NTBkNzJiNWY3ZWQ4NTM3NjQ3NzJiMWVjNGFhZmVjYjNkM2I2NTY3YTAzZTVlNGM5OTg4MDdhZDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0._WTqxnzeHEy9eXYaTLAjGUeEvwOnzroGnQBy78kb1cU)
![Screenshot 2024-05-15 at 4 01 30 PM](https://private-user-images.githubusercontent.com/11393142/330766518-98fa65c2-51b3-4f66-8877-485b95c1f3f5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxMDQ5NzQsIm5iZiI6MTcyNTEwNDY3NCwicGF0aCI6Ii8xMTM5MzE0Mi8zMzA3NjY1MTgtOThmYTY1YzItNTFiMy00ZjY2LTg4NzctNDg1Yjk1YzFmM2Y1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMxVDExNDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI4NjZlMjRlMGYwZmUwYTI4MzBhNWE4MjZmOGE3YTI1ZWY0MDdjYTYyNzgxYWZlYzY1NjY2MmIzMDFiN2Y5Y2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.TDwqEOaV6q4bcbnQ3a3765wyIZXf3mCaaM68fOSXVqo)
![Screenshot 2024-05-15 at 4 03 29 PM](https://private-user-images.githubusercontent.com/11393142/330767534-5c090af5-accc-4169-90e9-9327e583c56b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxMDQ5NzQsIm5iZiI6MTcyNTEwNDY3NCwicGF0aCI6Ii8xMTM5MzE0Mi8zMzA3Njc1MzQtNWMwOTBhZjUtYWNjYy00MTY5LTkwZTktOTMyN2U1ODNjNTZiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMxVDExNDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFmOGEyZGNmMmE4MzQxNTI4YTgxNTQwMWQyNjM1NzY1MzhiY2M4MTQ0MWQ4MzhmNmVlMWViMTUwMDVjMzcxZjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.g2_S6pi9BOWR8z1buP3E3oq5_hnuYJ_uNIiDcP1A3GI)
![Screenshot 2024-05-15 at 4 03 58 PM](https://private-user-images.githubusercontent.com/11393142/330767437-7f9f8310-170f-4074-bfa1-8f715bf4dd8c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxMDQ5NzQsIm5iZiI6MTcyNTEwNDY3NCwicGF0aCI6Ii8xMTM5MzE0Mi8zMzA3Njc0MzctN2Y5ZjgzMTAtMTcwZi00MDc0LWJmYTEtOGY3MTViZjRkZDhjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMxVDExNDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFmNjA5YWZlMDkzZDUwYWZlODYzNzM3MzU1MzU4MTRiNzMxZmY5NWJkY2M0ZTk5YTBhNWQyNjgxNDI1NDFmNjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.2cx6qjQb3mon6xlyAW_kFu_DKdantfnFC1zC6PGRc0s)
![Screenshot 2024-05-15 at 4 04 29 PM](https://private-user-images.githubusercontent.com/11393142/330767479-b9af60e9-72a0-4b80-ad92-2bc5a8602a14.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxMDQ5NzQsIm5iZiI6MTcyNTEwNDY3NCwicGF0aCI6Ii8xMTM5MzE0Mi8zMzA3Njc0NzktYjlhZjYwZTktNzJhMC00YjgwLWFkOTItMmJjNWE4NjAyYTE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMxVDExNDQzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM4MDllMzhmOWUwMDY4YTE0MmVkNTNkMDc1ODRiNGZjNzMxMzEwYzYzYjcyMmZlY2VjMzc1ZjA3ZGFmMTAyYmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.bIFJGNHNagVIeGIBPNnOh9VBHocVsao2UfZS4Zz96Fw)