How shubhammehra4/smart-metro works
SMART METRO is a web application for finding Delhi Metro routes and estimating station crowd levels. A user selects stations in the route form; the browser requests a route, the Express server delegates to a Python process, and the browser formats returned routes with station metadata. A separate development form submits time, day, and weather for a crowd estimate. The excerpts establish these request paths and Python model use; they do not establish how the displayed map is populated or validate the route’s “safest” characterization.
Main entry points: ml.js Python process adapter · index.js Express routes · submit.js Route display · findPath.py Route engine
Components 13
Web experience
- Route form
views/home.ejs - Route display
public/scripts/submit.js - Display station data
public/scripts/stationDetails.js - Crowd form
views/homeDev.ejs - Crowd display
public/scripts/submitDev.js
HTTP server
- Express routes
index.js - Python process adapter
ml.js
Routing and stations
- Station names
stationNames.js - Metro network data
pathFinder/stationJS.json - Route engine
pathFinder/findPath.py
Crowd prediction
- Crowd estimator
pathFinder/getCrowd.py - Random forest model
pathFinder/RFR_Model.pkl
Other components
- Metro rider
Connections 15
- Metro rider → Route form: chooses stations
- Route form → Station names: offers stations
- Route display → Express routes: requests route
public/scripts/submit.js - Express routes → Python process adapter: calls findPath
index.js - Python process adapter → Route engine: spawns Python
ml.js - Route engine → Metro network data: loads network
pathFinder/findPath.py - Route engine → Random forest model: predicts crowd
pathFinder/findPath.py - Python process adapter → Route display: returns routes
ml.js - Route display → Display station data: formats stations
public/scripts/submit.js - Metro rider → Crowd form: enters conditions
- Crowd display → Express routes: requests estimate
public/scripts/submitDev.js - Express routes → Python process adapter: calls getCrowd
index.js - Python process adapter → Crowd estimator: spawns Python
ml.js - Crowd estimator → Random forest model: predicts crowd
pathFinder/getCrowd.py - Python process adapter → Crowd display: returns estimate
ml.js