A production-grade, full-stack Digital Bus Pass Management Web Application customized for Nagpur City Bus Transportation (Mahanagar Parivahan).
Built with React (Vite + React Router) on the frontend and Python Flask connected to MySQL / SQLite on the backend.


/my-pass, /apply, /renew, /history, and /profile are guarded and automatically redirect unauthenticated users to /login.rahul@nagpur.com / password123) $\rightarrow$ Active Pass (22 days left)priya@nagpur.com / password123) $\rightarrow$ Expiring Soon (3 days left)amit@nagpur.com / password123) $\rightarrow$ Expired Pass (expired 12 days ago)NavLink / Link elements across desktop and mobile bottom navigation.ACTIVE: > 7 days remaining.EXPIRING_SOON: 1 to 7 days remaining (with amber alert banner).EXPIRED: Validity period passed (with red alert banner).BUS PASS Management/
β
βββ frontend/
β βββ package.json
β βββ vite.config.js # Auto-opens browser on dev launch
β βββ index.html
β βββ src/
β βββ App.jsx # React Router & protected routes
β βββ main.jsx
β βββ context/
β β βββ AuthContext.jsx # Authentication & pass synchronization
β βββ components/
β β βββ Navbar.jsx # Responsive header & mobile bottom bar
β β βββ ProtectedRoute.jsx # Route guarding & redirect handling
β β βββ DigitalPassCard.jsx # Live QR, security ticker & transit card
β β βββ ToastContainer.jsx # Notification feedback
β βββ pages/
β β βββ HomePage.jsx # Landing page & demo overview
β β βββ LoginPage.jsx # Login & 1-click demo switcher
β β βββ SignupPage.jsx # Registration
β β βββ PlansPage.jsx # Nagpur fare tiers & selection
β β βββ ApplyPassPage.jsx # 4-step issuance wizard
β β βββ MyPassPage.jsx # Digital pass & expiry countdown
β β βββ RenewPassPage.jsx # Consecutive renewal
β β βββ PassHistoryPage.jsx # Audit log & timeline
β β βββ ProfilePage.jsx # Commuter profile
β βββ styles/
β βββ index.css # Master transit design system
β
βββ backend/
β βββ app.py # Flask REST API & auth engine
β βββ bus_pass_management.sql # MySQL schema & seed data
β βββ database.db # Local auto-fallback database
β βββ requirements.txt
β
βββ database/
β βββ bus_pass_management.sql # Direct MySQL Workbench import
β
βββ README.md
database/bus_pass_management.sql (or backend/bus_pass_management.sql).bus_pass_management database with tables (users, pass_plans, bus_passes, pass_history) and seed data will be created.Zero-Friction Fallback: If MySQL is not running on your machine,
app.pyautomatically initializes and operates seamlessly using local SQLite (database.db), ensuring immediate plug-and-play execution without crashing.
cd backend
pip install -r requirements.txt
python app.py
Backend runs at http://127.0.0.1:5001
cd frontend
npm install
npm run dev
Vite will automatically launch your default browser at http://localhost:5173.
This fixed account is stored in the MySQL users table and is created automatically if it does not exist:
demo@cityride.localCityRide@123| Commuter | Password | Pass State | Route | |
|---|---|---|---|---|
| Rahul Sharma | rahul@nagpur.com |
password123 |
ACTIVE (22 days left) | Dharampeth β Sitabuldi β Hingna Naka |
| Priya Patel | priya@nagpur.com |
password123 |
EXPIRING SOON (3 days left) | Manish Nagar β Wardha Road β Medical Sq |
| Amit Verma | amit@nagpur.com |
password123 |
EXPIRED (0 days left) | Sadar β Railway Station β Kamptee |