A Flask-based web application for the Vyas Building at MIT-WPU featuring an interactive visual floor map for room selection and maintenance tracking.
#0b4d8c#c8102e#20c997cd mitwpu_vyas_tracker
python3 -m venv venv
source venv/bin/activate # Linux/macOS
# or
venv\Scripts\activate # Windows
pip install -r requirements.txt
python scripts/init_data.py
This creates:
python run.py
The server will start at http://localhost:5000
| Endpoint | Description |
|---|---|
/ |
Landing page with floor guide |
/report |
Student portal with interactive floor map |
/report?room=VY404 |
Auto-select room VY404 via QR code |
/admin/login |
Admin login page |
/admin/ |
Admin dashboard with tickets and statistics |
/admin/map |
Live status map of all floors |
adminmitwpu123| Color | Room Type |
|---|---|
| Dark Blue | Classroom |
| Teal/Green | Lab |
| Red | Washroom |
| Yellow Border | Selected Room |
| Pulsing Red | Room with Issues |
Generate QR codes that link directly to the report page for each room:
# Generate QR codes for all rooms
python scripts/generate_qr.py --all
# Generate for 4th floor only
python scripts/generate_qr.py --floor 4
# Generate for a specific room
python scripts/generate_qr.py --room VY404
# Custom host/port
python scripts/generate_qr.py --all --host 192.168.1.100 --port 8080
QR codes are saved to the qr_codes/ directory.
curl -X POST http://localhost:5000/report \
-F "reporter_name=John Doe" \
-F "prn=12345678" \
-F "reporter_email=john.doe@mitwpu.edu.in" \
-F "room_id=5" \
-F "issue_type=electrical" \
-F "description=Light not working in VY404"
curl http://localhost:5000/api/rooms/floor/5
curl http://localhost:5000/api/room/VY404
curl http://localhost:5000/api/assets/5
mitwpu_vyas_tracker/
├── app/
│ ├── __init__.py # Flask app factory
│ ├── models.py # SQLAlchemy models
│ ├── routes.py # Main routes (student portal, API)
│ ├── admin_routes.py # Admin routes
│ ├── templates/
│ │ ├── base.html
│ │ ├── index.html # Landing page
│ │ ├── report.html # Student portal with map
│ │ ├── login.html # Admin login
│ │ ├── admin.html # Dashboard
│ │ └── status_map.html # Live status map
│ └── static/
│ ├── css/style.css # MIT colors + Map styles
│ ├── js/map.js # Map interaction logic
│ └── uploads/ # Ticket images
├── scripts/
│ ├── init_data.py # Vyas building data
│ └── generate_qr.py # QR code generator
├── qr_codes/ # Generated QR codes
├── run.py # Entry point
├── requirements.txt
└── README.md
id (PK)name - ‘Vyas’descriptionid (PK)building_id (FK)level - 0-7name - e.g., ‘4th Floor’id (PK)floor_id (FK)number - e.g., ‘VY404’name - e.g., ‘Classroom 404’room_type - class/lab/washroom/storage/othermap_coords - Optional positioning dataid (PK)room_id (FK)name - e.g., ‘Projector’asset_type - projector/ac/light/etc.status - working/broken/maintenanceid (PK)room_id (FK)asset_id (FK, nullable)issue_typedescriptionimage_filenamereporter_name, prn, reporter_emailstatus - open/in-progress/fixed ┌─────────┐ ┌─────────┐
│ VY424 │ │ VY422 │
│Classroom│ │ Lab │
└─────────┘ └─────────┘
════════════════════════════ Main Corridor
┌────┐ ┌────┐ ┌────┐ ┌────┐ ┌────┐ ┌────┐ ┌────┐
│401 │ │402 │ │403 │ │404 │ │426 │ │427 │ │428 │ Center
│ │ │ │ │ │ │ │ │ │ │ │ │ │ Labs
└────┘ └────┘ └────┘ └────┘ └────┘ └────┘ └────┘
┌────┐ ┌────┐ ┌────┐
│414 │ │413 │ │ WC │ Right Wing
└────┘ └────┘ └────┘
@mitwpu.edu.in| Variable | Default | Description |
|---|---|---|
SECRET_KEY |
vyas-secret-key-mitwpu-2024 |
Flask secret key |
DATABASE_URL |
postgresql://...supabase.co:5432/postgres |
Database URL |
PORT |
5000 |
Server port |
FLASK_DEBUG |
True |
Debug mode |
MIT-WPU Internal Project