How beast2wd/bc-staffing-medina works
This is a multi-tenant fire-department staffing and operations platform, with a React client and FastAPI backend. Users sign in, manage staffing, leave, overtime, deployments and personnel, and receive operational updates; command staff also use an incident worksheet with specialized safety and incident tools. The backend combines route modules, shared authentication and tenant scoping, and MongoDB persistence. The README provides no product overview, so the product description follows the repository structure and source excerpts; links for unsampled features are omitted where their callers are not evidenced.
Main entry points: database.py MongoDB · fillin_routes.py Staffing and fill-ins · tactical_routes.py Tactical incidents · overtime_routes.py Overtime
Components 26
Web application
- Application shell
frontend/src/App.js - Client login
frontend/src/pages/ClientLoginPage.js - Auth context
frontend/src/context/AuthContext.js - Staffing dashboard
frontend/src/pages/DashboardPage.js - Command worksheet
frontend/src/pages/command/TacticalWorksheetPage.js - Deployment tracker
frontend/src/pages/deployment-tracker
Identity and tenancy
- Authentication routes
backend/routes/auth_routes.py - Auth and roles
backend/auth.py - Tenant scoping
backend/tenant_utils.py
Staffing operations
- Staffing and fill-ins
backend/routes/fillin_routes.py - Leave and requests
backend/routes/requests_routes.py - Overtime
backend/routes/overtime_routes.py - Deployments
backend/routes/deployments_routes.py - Operational reports
backend/routes/reports_routes.py - Minimum staffing
backend/services/min_staffing_service.py
Incident command
- Tactical incidents
backend/routes/tactical_routes.py - Incident safety tools
backend/services - Chief voice assistant
backend/routes/voice_command_routes.py - ICS forms
backend/routes/ics_forms_routes.py
Backend platform
- API application
backend/server.py - MongoDB
backend/database.py - Domain models
backend/models.py - User notifications
backend/routes/user_notifications_routes.py - Live updates
backend/websocket_manager.py - Tenant webhooks
backend/services/webhook_service.py
Other components
- Department users
Connections 47
- Department users → Application shell: uses
- Application shell → Auth context: provides context
frontend/src/App.js - Application shell → Staffing dashboard: routes to
frontend/src/App.js - Application shell → Command worksheet: routes to
frontend/src/App.js - Application shell → Deployment tracker: routes to
frontend/src/App.js - Client login → Auth context: uses
frontend/src/pages/ClientLoginPage.js - API application → Authentication routes: registers
backend/server.py - Authentication routes → Auth and roles: uses
- Auth and roles → MongoDB: reads users
backend/auth.py - Staffing and fill-ins → MongoDB: reads and writes
backend/routes/fillin_routes.py - Staffing and fill-ins → Domain models: uses
backend/routes/fillin_routes.py - Staffing and fill-ins → Auth and roles: authorizes
backend/routes/fillin_routes.py - Staffing and fill-ins → Tenant scoping: scopes queries
backend/routes/fillin_routes.py - Staffing and fill-ins → Minimum staffing: checks staffing
backend/routes/fillin_routes.py - Staffing and fill-ins → Live updates: broadcasts updates
backend/routes/fillin_routes.py - Staffing and fill-ins → Tenant webhooks: notifies
backend/routes/fillin_routes.py - Leave and requests → MongoDB: reads and writes
backend/routes/requests_routes.py - Leave and requests → Overtime: uses routes
backend/routes/requests_routes.py - Leave and requests → User notifications: creates notifications
backend/routes/requests_routes.py - Overtime → MongoDB: reads and writes
backend/routes/overtime_routes.py - Overtime → Minimum staffing: checks staffing
backend/routes/overtime_routes.py - Overtime → User notifications: creates notifications
backend/routes/overtime_routes.py - Overtime → Live updates: broadcasts updates
backend/routes/overtime_routes.py - Overtime → Tenant webhooks: notifies
backend/routes/overtime_routes.py - Deployments → MongoDB: reads and writes
backend/routes/deployments_routes.py - Deployments → Domain models: uses
backend/routes/deployments_routes.py - Deployments → Auth and roles: authorizes
backend/routes/deployments_routes.py - Deployments → Tenant scoping: scopes queries
backend/routes/deployments_routes.py - Deployments → Tenant webhooks: notifies
backend/routes/deployments_routes.py - Operational reports → MongoDB: reads data
backend/routes/reports_routes.py - Operational reports → Deployments: uses deployment data
backend/routes/reports_routes.py - Tactical incidents → MongoDB: reads and writes
backend/routes/tactical_routes.py - Tactical incidents → Auth and roles: authorizes
backend/routes/tactical_routes.py - Tactical incidents → Tenant scoping: scopes queries
backend/routes/tactical_routes.py - Tactical incidents → Live updates: broadcasts updates
backend/routes/tactical_routes.py - Tactical incidents → Incident safety tools: uses worksheets
backend/routes/tactical_routes.py - Tactical incidents → ICS forms: uses ICS forms
backend/routes/tactical_routes.py - Chief voice assistant → MongoDB: reads and writes
backend/routes/voice_command_routes.py - Chief voice assistant → Staffing and fill-ins: dispatches actions
backend/routes/voice_command_routes.py - Chief voice assistant → Tactical incidents: dispatches actions
backend/routes/voice_command_routes.py - Chief voice assistant → ICS forms: dispatches actions
backend/routes/voice_command_routes.py - User notifications → MongoDB: reads and writes
backend/routes/user_notifications_routes.py - User notifications → Live updates: broadcasts alerts
backend/routes/user_notifications_routes.py - Minimum staffing → MongoDB: reads and writes
backend/services/min_staffing_service.py - Minimum staffing → User notifications: creates alerts
backend/services/min_staffing_service.py - Minimum staffing → Live updates: broadcasts alerts
backend/services/min_staffing_service.py - API application → MongoDB: configures
backend/server.py