Skip to content

ayushmodi12/transport-management-system

Repository files navigation

WRITEUP FOR ASSIGNMENT 4:--> https://drive.google.com/file/d/1lLgN7pTO_a6krywIUAJEYwMZZ766K1k0/view?usp=sharing (The file size of greater than 25mb could not be uploaded to github, so the drive link)

TRANSPORT MANAGEMENT SYSTEM

Tools and Skills Used

My Skills

Design

updated_flowchart

Running the project

Setting up the Server

First, change the working directory to transport-management-system after cloning this repository.
git clone https://github.com/ayushmodi12/transport-management-system.git

Installing all the dependencies

Please run the following command with the cloned repository as the current working directory to install all the required modules and packages.

pip install -r requirements.txt

Create Database & Launch Web Server

Please run the setup.py to instantiate the database and launch the web server.
Make sure that you don't have the database before running setup.py. Else directly launch the web server by executing tms.py.

Setting up the Client

Add DNS Entry

  1. Go to the hosts file. It can be typically found here C:\Windows\System32\drivers\etc\hosts.
  2. Add the following translation 127.0.0.1 tms.iitgn.ac.in if the client and server are hosted on the same machine. Else add the public of the server machine. After that, your hosts file should look like this.
    Hosts File

Now tms.iitgn.ac.in is mapped to 127.0.0.1, i.e. the local host and now we can access it like an actual website. So if we type http://tms.iitgn.ac.in:5000/ on our browser, we will be able to access the webpage!
We can also create our own personal local network, and set up the server in one computer, and access the webpage from another computer. This can be shown as a demo to the TA when requested.

Access the Webpage

Access the website by typing http://tms.iitgn.ac.in:5000/ on the browser.

For Non windows users

Access the website by typing http://127.0.0.1:5000/ on the browser.

Screenshots of successful execution of the dynamic operations

INSERT Operation:

Before inserting, viewing the table on workbench:

image

Now, inserting a new value in the table:

image

image

New value inserted can be seen on workbench:

image

Showing the Updated and before states of the table on the website:

After (in webApp) insert_after Before (in webApp): insert_before

Now in Admin Terminal for different query: Booking a seat
We insert entries into the booking table upon successful booking.

Custom Insert
We can also execute custom insert query in the admin terminal. Following is the result.
Custom Insert Out

DELETE Operation:

Before Deleting, viewing the table on workbench:

image

Now, deleting the row where capacity = 20:

image

image

We can see on workbench, that the row having capacity = 20 is deleted:

image

Showing the Updated and before states of the table on the website:

After (in webApp) image Before (in webApp): image

Now in Admin Terminal for different query: Custom Del
We can also execute custom delete query in the admin terminal. Following is the result.
Custom Del out

UPDATE Operation:

Before updating, viewing the table on workbench:

image

Now, updating the capacity to 60 in the row where location="Hostel Parking Area": NOTE: Only those input fields are to be filled for which we want to update the values, if the field is left empty, the value for that column will not be updated.

image

image

This updated row can be seen in the table on workbench:

image

Showing the Updated and before states of the table on the website:

After (in webApp) update_after Before (in webApp): update_before

Now in Admin Terminal for different query: Custom Update
We can also execute custom update query in the admin terminal. Following is the result.
Custom Update Out

RENAME Operation:

Before renaming, viewing the current table on workbench:

image

Now, updating the table name to parking_space_new: NOTE: Only those input fields are to be filled for which we want to rename, for rest others, leave the input field empty:

image

image

As we can see on workbench, the table name has been updated to parking_space_new:

image

image

Showing the Updated and before states of the table on website:

After (updating table name): rename_1_after Before (updating table name): rename_1_before

Now, renaming the column location to location_2: image

We can see in the workbench, the table name of location has been changed:

image

Showing the Updated and before states of the table on the website: After (updating column name): rename_2_after Before (updating column name): rename_2_before

Use of WHERE Clause:

Now, the WHERE clause has already been used in the above operations where we have performed UPDATE and DELETE. The input field “Condition” in UPDATE and DELETE Operations takes the WHERE Clause as input and accordingly performs the operations. The screenshots for the operations have thus already been shown in the above sections. Below is the snippet of the code for the /update-values api, that creates the sql query for UPDATE operation using WHERE Clause: whereclause_final As we have already added screenshots above in UPDATE and DELETE, which also contain the WHERE Clause, we are not adding screenshots here.

whereclause_before We can also execute custom where where clause in the admin terminal. Following are the results. whereclause_After

Contributors

  1. Mithil Pechimuthu
  2. Ayush Modi
  3. Shreesh Agarwal
  4. Anushk Bhana
  5. Vedant Kumbhar

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors