Skip to content

solo-leveler/Train_MGMT

Repository files navigation

Train_MGMT

About the Project


Train Booking Web App using MEAN Stack.

A simple user input system to book tickets accordingly. Tickets will be booked by the system with user having control over how many tickets to be booked only. If user has previously booked with the same name, those tickets will also be shown accordingly.

Overview


In this project , the user will be provided numeric and stirng-based inputs for no of seats and username respectively. I've implemented general priority alogirthm for the tickets to be booked in row-based priority and in a cluster.

Project File Description


node.js

  • index.js : initalization file for node+mongodb cluster
  • routes/routs.js : routes + functionality for the api used
  • .env : path file for mongodb cluster
  • models/ticketModel.js : model for mongodb

Angular

All the angular files are in the client/angular-frontend folder

  • src/app : root file of the angular
  • src/ticket_booking/book_ticket : The main files that runs in UI. These files also include the main logic written for the web-app.
  • src/custom-snackbar : A custom snackbar created by me to enhance UI. (Still need a bit tweaking.)
  • models/book-ticket-model.ts : A mode file created to maintain the scope of the project.

Local Installation & Setup Instructions :


This is file structure of my project:

├──/client/angular-frontend
|   ├── ...
|   └── package.json
└──package.json

npm i on the root directory and client/angular-frontend directory. The project will start at port:8080.

Database Strucutre


Angular

I have used MongoDb Atlas(free version) for this project.

├──PerosnalCluster
   ├── TRAIN_MGMT
        └── tickets

seatNo status category bookedBy row updatedBy
Int32 String Int32 String Int32 Date

Assumptions


  1. There are already few seats booked in the train.
  2. Mock Json provided to fiddle with.
    • booking-system-response.ts file containcs the mock data.
    • Refer to the first commented line : 83 in book-component.ts file.
    • Comment the next line simultaneously to stop the api call and work on mock data.
  3. After all tickets are booked a Clear All Booking button is provided to reset all booking in the database.