A web application allowing students to submit work orders for any matters requiring attention on campus. Students may submit requests, and faculty and admins may modify and manage requests.
- Python 3 + Flask for web framework
- Plain HTML templates with Jinja2
- Custom CSS for styling
- Run 'bootstrap.cmd' script in root directory of project.
- It is an automated script that sets up virtual environment, installs dependencies, runs migrations, and starts the app.
- Below is a non-automated commands to run for both Windows and MacOS users.
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
mkdir instance
set FLASK_APP=app.py
flask db upgrade
python app.pypython3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
mkdir -p instance
export FLASK_APP=app.py
flask db upgrade
python3 app.pyThe app will run on http://localhost:5001
- Authentication and registration (requester by default)
- Role-based dashboards: requester, technician, manager
- Ticket submission (requester), technician status updates, manager assignment
- Search & filtering: keyword, category, status, date range, sort (requester & manager)
- CSV export of tickets (manager), with report logging
- Comments on tickets (requester/technician), requester rating after resolution
- Managed with Flask-Migrate from SQLAlchemy models
- Default database: SQLite file
instance/ticket_system.db - Optional: MySQL via
DATABASE_URL(see.env.example) - See
database_docs/schema.sqlfor raw SQL structure
users— Accounts, password hash, role (requester/technician/manager)categories— Ticket categories (IT Support, Facilities, etc.)ticket_status— Workflow states (Pending, In Progress, Resolved, Closed)tickets— Title, description, location, category/status, requester/technician, timestampscomments— Per-ticket comments linked to usersratings— Requester rating and feedback (one per ticket)report_logs— Manager report generation audit entries
Default: SQLite (sqlite:///instance/ticket_system.db) if DATABASE_URL not set.
MySQL: set DATABASE_URL=mysql+pymysql://user:pass@localhost:3306/dbname in .env.
Do NOT mix running raw schema.sql and migrations on the same fresh DB. Choose one initialization path.
set FLASK_APP=app.py
flask db migrate -m "describe change"
flask db upgradeIf you imported an existing schema manually, align with: flask db stamp head before first migrate.
If you want to ensure default statuses/categories outside migrations:
set FLASK_APP=app.py
python database\init_db.py- Env: copy
.env.example→.envand set your MySQL creds (DATABASE_URL=mysql+pymysql://user:pass@localhost:3306/dbname). - Driver: install MySQL driver
pymysqlif missing. - DB init: run either
database/schema.sql(creates + seeds) ORflask db upgrade(migrations). Do not run both. - Seed: ensure statuses/categories exist (from schema.sql or a seed step) to avoid empty dropdowns.
app/ core application
dashboard/ role-based dashboards & routes
tickets/ ticket creation & detail
comments/ commenting features
ratings/ requester ratings on resolved tickets
reports/ (future/placeholder reporting)
templates/ Jinja2 HTML templates
static/ CSS assets
database/ schema.sql and optional seed script
migrations/ Alembic migration versions
Manager dashboard button triggers /dashboard/manager/export.csv applying current filters and logging a report_logs row.
SECRET_KEY (session security) , DATABASE_URL (override default DB).
- Missing table error: run
flask db upgrade. - Stuck on SQLite: set
DATABASE_URLthen re-run migrate/upgrade on new DB. - Status change blocked: technicians cannot skip or go backward.