Phase 1 of FixFlow has been built and verified against a live local MySQL database. The application boots cleanly, connects to MySQL, and serves both interactive Swagger documentation (/docs) and the initial frontend UI.
-
Virtual Environment & Dependencies:
- Initialized Python 3.12 virtual environment (
venv/). - Installed FastAPI, Uvicorn, SQLAlchemy 2.x, PyMySQL, Cryptography, Pydantic-Settings, Passlib with Bcrypt, Boto3, and Pytest.
- Resolved Passlib 1.7.4 compatibility with Bcrypt 4.1+ cleanly.
- Initialized Python 3.12 virtual environment (
-
Configuration & Security Layer:
backend/app/config.py: Environment settings viapydantic-settingssupporting switchable local and AWS modes. Credentials with special characters like@are automatically URL-encoded for PyMySQL.backend/app/security.py: Bcrypt password hashing context and JWT access token creation/decoding functions with configurable expiry..env.exampleand.env: Clean configuration with no hardcoded production secrets.
-
Relational Database Design (MySQL 8):
database/schema.sql: Complete DDL for all 6 core tables:users(students, admin, staff)issues(location, category, priority, status, AI fields, support count)assignments(staff allocations by admin)comments(timeline comments)issue_supporters(duplicate upvoting)status_history(audit trail of state transitions)
- Created MySQL database
fixflowand dedicated userfixflow_userwith full privileges.
-
Seeding & Realistic Data:
backend/seed.py: Python seed script populating 1 Admin, 3 Staff members (Electrical, IT, Plumbing), 5 Students, and 25 realistic issues spread across 4 campus blocks over the past 30 days.- Included a verified near-duplicate pair in Room 204 ("Projector not working in Room 204" and "Broken projector / display not turning on") ready for Phase 6 duplicate detection.
database/seed.sql: Generated pure SQL seed dump for direct CLI imports.
-
ORM Models & Session Management:
backend/app/database.py: SQLAlchemy engine withpool_pre_ping=True, session lifecycle dependency (get_db), and connection ping.backend/app/models.py: Declarative ORM models with enum bindings and foreign key relationships.
-
FastAPI Application & Frontend Static Serving:
backend/app/main.py: FastAPI app with CORS middleware, lifespan database health validation,/api/healthendpoint,/uploadsphoto directory mount, and static frontend mount at root/.frontend/index.html: Landing and login interface with one-click demo credentials for quick evaluation.frontend/css/styles.css: Design system with CSS tokens, status/priority color badges, card layouts, and responsive utilities.frontend/js/api.js&frontend/js/auth.js: Fetch client and role-based redirect guards.
| Check | Target | Expected | Result |
|---|---|---|---|
| App Startup | uvicorn backend.app.main:app |
Process boots without errors | PASS |
| Database Connection | /api/health |
{"database": "connected"} |
PASS |
| API Docs | http://127.0.0.1:8000/docs |
HTTP 200 (Swagger UI) | PASS |
| Frontend Serving | http://127.0.0.1:8000/ |
HTTP 200 (index.html) |
PASS |
| Database Seeding | MySQL fixflow tables |
9 users, 25 issues, 16 assignments, 9 comments | PASS |
Live /api/health response:
{
"status": "ok",
"app_env": "development",
"database": "connected",
"storage_backend": "local",
"ai_enabled": true
}-
Verify Backend & Health Check: Open your browser or run:
curl http://127.0.0.1:8000/api/health
You will receive
{"status":"ok","database":"connected",...}. -
Explore API Documentation: Navigate to: http://127.0.0.1:8000/docs You will see the interactive Swagger UI.
-
View Landing Page: Navigate to: http://127.0.0.1:8000/ You will see the FixFlow landing page with one-click demo logins.
Phase 4 of FixFlow has been built and verified. Administrators now have a real-time operations dashboard with live metric cards, multi-filter and searchable ticket listings, incident triage (priority and category editing), and smart technician dispatch. Assigned staff members have an interactive task queue with quick status progression buttons. The strict issue lifecycle (Open → Assigned → In Progress → Resolved) is enforced on the backend with audit history tracking.
-
Backend Endpoints & Business Logic:
- Mounted
admin.router,staff.router, andanalytics.routerinbackend/app/main.py. GET /api/admin/issues: Admin-only ticket listing with filters (status,category,block,priority, search queryq), sorting (newest,priorityCritical-first,support_count), and pagination (page,page_size).PATCH /api/admin/issues/{id}: Admin-only triage endpoint to edit priority and category.POST /api/admin/issues/{id}/assign: Admin-only assignment endpoint that creates anassignmentsrow, advances status toAssigned, writesstatus_history, supports reassignment, and triggersnotify_assignment.PATCH /api/issues/{id}/status: Lifecycle transition endpoint enforcing Section 5 strict forward rules (Open → Assigned → In Progress → Resolved). Admin may jump directly toResolved, and only Admin may reopenResolved → Open. Sets/clearsresolved_atand logsstatus_history.GET /api/meta/staff: Admin-only listing of staff members with department (team).GET /api/staff/tasks: Staff-only queue of issues currently assigned to the logged-in staff member.GET /api/analytics/summary: High-level metric counts for dashboard metric cards.
- Mounted
-
Frontend Operations UI:
frontend/admin/dashboard.html: 5 live stat cards, filter bar, search box, sort selector, and table with row click to issue details.frontend/admin/issue.html: Full incident details, evidence photo preview, inline triage controls, smart technician assignment with recommended team highlighting, status progression buttons, 4-step stepper, audit log, and comments section.frontend/staff/tasks.html: Assigned maintenance task queue with quick status progression buttons.frontend/js/admin.js: Modular vanilla JS controller.frontend/student/issue.html&frontend/student/my-reports.html: Updated with assigned technician details and live status updates.
-
Automated Verification:
tests/test_phase4.py: 8 automated pytest tests covering authorization guards, assignment records, status transition rules, and task queues. All 14 tests across the project pass.