FixLink-V1

MIT-WPU Vyas Smart-Room Maintenance Tracker

A Flask-based web application for the Vyas Building at MIT-WPU featuring an interactive visual floor map for room selection and maintenance tracking.

Features

Tech Stack

MIT-WPU Brand Colors

Installation

1. Navigate to Project Directory

cd mitwpu_vyas_tracker

2. Create Virtual Environment (Optional)

python3 -m venv venv
source venv/bin/activate  # Linux/macOS
# or
venv\Scripts\activate  # Windows

3. Install Dependencies

pip install -r requirements.txt

4. Initialize Database with Vyas Building Data

python scripts/init_data.py

This creates:

5. Run the Application

python run.py

The server will start at http://localhost:5000

Application URLs

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

Admin Credentials

Using the Interactive Map

Student Portal

  1. Select Floor - Choose a floor from the dropdown
  2. Click Room - Tap on your room in the visual floor map
  3. Fill Form - Enter your details and issue description
  4. Submit - Click submit to create a ticket

Room Colors

Color Room Type
Dark Blue Classroom
Teal/Green Lab
Red Washroom
Yellow Border Selected Room
Pulsing Red Room with Issues

QR Code Generation

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.

Testing with curl

Submit a Ticket

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"

Get Rooms for Floor

curl http://localhost:5000/api/rooms/floor/5

Get Room by Number

curl http://localhost:5000/api/room/VY404

Get Assets for Room

curl http://localhost:5000/api/assets/5

Project Structure

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

Database Schema

Building

Floor

Room

Asset

Ticket

4th Floor Layout (Demo Floor)

        ┌─────────┐  ┌─────────┐
        │ VY424   │  │ VY422   │
        │Classroom│  │   Lab   │
        └─────────┘  └─────────┘
        ════════════════════════════  Main Corridor
┌────┐ ┌────┐ ┌────┐ ┌────┐  ┌────┐ ┌────┐ ┌────┐
│401 │ │402 │ │403 │ │404 │  │426 │ │427 │ │428 │  Center
│    │ │    │ │    │ │    │  │    │ │    │ │    │  Labs
└────┘ └────┘ └────┘ └────┘  └────┘ └────┘ └────┘
                              ┌────┐ ┌────┐ ┌────┐
                              │414 │ │413 │ │ WC │  Right Wing
                              └────┘ └────┘ └────┘

Validation Rules

Client-side

Server-side

Environment Variables

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

License

MIT-WPU Internal Project