A Flask-based web application for the Vyas Building at MIT-WPU featuring an interactive visual floor map for room selection and maintenance tracking.
- Interactive Visual Floor Map - Click rooms on a visual map instead of dropdowns
- Vyas Building Specific - 8 floors (Ground to 7th) with accurate room layouts
- 4th Floor Demo - Detailed floor plan matching the actual building layout
- QR Code Support - Generate QR codes for quick room access
- Real-time Status Map - Admin view showing rooms with issues highlighted in red
- Backend: Flask 3.0+, Flask-SQLAlchemy, Werkzeug
- Database: Supabase (PostgreSQL)
- Frontend: Bootstrap 5, Interactive CSS Grid Map, Custom CSS
- Tools: Pillow, qrcode
- Primary Blue:
#0b4d8c - Accent Red:
#c8102e - Lab Teal:
#20c997
cd mitwpu_vyas_trackerpython3 -m venv venv
source venv/bin/activate # Linux/macOS
# or
venv\Scripts\activate # Windowspip install -r requirements.txtpython scripts/init_data.pyThis creates:
- Vyas Building with 8 floors (Ground to 7th)
- 4th Floor with detailed layout (VY401-VY429) matching the floor plan
- Other Floors with generic rooms
- Assets for each room (projectors, ACs, lights, etc.)
python run.pyThe 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 |
- Username:
admin - Password:
mitwpu123
- Select Floor - Choose a floor from the dropdown
- Click Room - Tap on your room in the visual floor map
- Fill Form - Enter your details and issue description
- Submit - Click submit to create a ticket
| 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 8080QR codes are saved to the qr_codes/ directory.
curl -X POST http://localhost:5000/report \
-F "reporter_name=John Doe" \
-F "prn=12345678" \
-F "[email protected]" \
-F "room_id=5" \
-F "issue_type=electrical" \
-F "description=Light not working in VY404"curl http://localhost:5000/api/rooms/floor/5curl http://localhost:5000/api/room/VY404curl http://localhost:5000/api/assets/5mitwpu_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'description
id(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 data
id(PK)room_id(FK)name- e.g., 'Projector'asset_type- projector/ac/light/etc.status- working/broken/maintenance
id(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
└────┘ └────┘ └────┘
- PRN must be numeric
- Email must end with
@mitwpu.edu.in - Room must be selected from the map
- Same validations as client-side
- Image uploads limited to 16MB
- Allowed image types: PNG, JPG, JPEG, GIF, WEBP
| 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