How omniman2024/failsafe works
FAILSAFE is a faculty-facing early-warning system: faculty register and are approved by a department HOD, upload course-linked student CSVs, and review risk dashboards and student-level explanations. The backend owns authentication, approval, API workflows, persistence, and inference; the Next.js app provides the user-facing flows. README descriptions establish several product relationships where route-level source was not sampled, so those edges cite the README; unsampled features are represented at their exact enclosing paths.
Main entry points: main.py Application API · ml_inference.py Risk and SHAP inference · page.tsx At-risk directory · models.py Domain records
Components 18
Faculty web app
- Sign-in and registration
src/app/(auth)/register/page.tsx - Auth actions
src/actions/auth.ts - Faculty dashboard
src/app/(dashboard)/dashboard/page.tsx - CSV upload portal
src/app/(dashboard)/upload/page.tsx - Upload action
src/actions/upload.ts - At-risk directory
src/app/(dashboard)/students/page.tsx - Student explanation
src/app/(dashboard)/students/[id]/page.tsx - HOD approvals
src/app/admin/dashboard/page.tsx
Identity and approvals
- Application API
backend/main.py - Token and role checks
backend/auth.py
Student risk analytics
- Model training
backend/train_model.py - Risk and SHAP inference
backend/ml_inference.py
Data and persistence
- Domain records
backend/models.py - Database sessions
backend/database.py
Other components
- Faculty
- Institute admin
- Department HOD
- MySQL
Connections 21
- Faculty → Sign-in and registration: registers
- Institute admin → Domain records: prepopulates courses
- Sign-in and registration → Auth actions: submits registration
src/app/(auth)/register/page.tsx - Auth actions → Application API: calls auth API
src/actions/auth.ts - Department HOD → HOD approvals: reviews faculty
- HOD approvals → Application API: requests approvals
- Application API → Token and role checks: checks identity
backend/main.py - Application API → Domain records: queries records
backend/main.py - Faculty → Faculty dashboard: views summaries
- Faculty → CSV upload portal: uploads CSV
- CSV upload portal → Upload action: submits file
src/app/(dashboard)/upload/page.tsx - Upload action → Application API: forwards CSV
- Application API → Risk and SHAP inference: processes CSV
backend/main.py - Risk and SHAP inference → Domain records: writes predictions
backend/ml_inference.py - Risk and SHAP inference → Database sessions: commits records
backend/ml_inference.py - Model training → Risk and SHAP inference: supplies model artifacts
- Database sessions → MySQL: connects
backend/database.py - Faculty → At-risk directory: reviews risk levels
- At-risk directory → Student explanation: opens student
src/app/(dashboard)/students/page.tsx - Faculty → Student explanation: reviews explanations
- Application API → At-risk directory: serves student data