How marvin101/id_card_backend works
CampusID is a FastAPI backend that powers school-scoped identity-card workflows for a Flutter client. The main path is authenticated school access, school and academic setup, student or Teacher/Staff record management, then card-template and print workflows; verification and Public Forms provide public-facing paths. Imports, grids, custom fields, audit history, and managed photos support those stages. The README documents broad capabilities, but only selected source was sampled, so links for unsampled endpoint internals are limited to documented boundaries.
Main entry points: main.py FastAPI service · database.py PostgreSQL · file_storage.py Media handling · auth.py Authentication
Components 21
API entry
- FastAPI service
app/main.py
Identity and access
- Authentication
app/api/auth.py - Session management
app/core/auth_sessions.py - Users and access
app/api/users.py
School records
- Schools
app/api/schools.py - Academic structure
app/api/academic_sessions.py - Student records
app/api/students.py - Personnel records
app/api/personnel.py - Custom fields
app/api/student_fields.py - Personnel fields
app/api/personnel_fields.py
Card workflows
- Student imports
app/api/student_imports.py - Personnel imports
app/api/personnel_imports.py - Spreadsheet grids
app/api/student_grid.py - Personnel grid
app/api/personnel_grid.py - Card templates
app/api/card_templates.py - Public Forms
app/api/public_forms.py - Public verification
app/api/public_verification.py
Persistence and media
- PostgreSQL
app/core/database.py - Supabase Storage
- Media handling
app/core/file_storage.py
Other components
- Flutter client
Connections 33
- Flutter client → FastAPI service: sends requests
- FastAPI service → Authentication: dispatches auth
- FastAPI service → Users and access: dispatches user routes
- FastAPI service → Schools: dispatches school routes
- FastAPI service → Academic structure: dispatches academic routes
- FastAPI service → Student records: dispatches student routes
- FastAPI service → Personnel records: dispatches personnel routes
- FastAPI service → Student imports: dispatches imports
- FastAPI service → Personnel imports: dispatches imports
- FastAPI service → Spreadsheet grids: dispatches grid routes
- FastAPI service → Personnel grid: dispatches grid routes
- FastAPI service → Card templates: dispatches templates
- FastAPI service → Public Forms: dispatches form routes
- FastAPI service → Public verification: dispatches verification
- Authentication → Session management: starts sessions
- Authentication → PostgreSQL: reads users
- Session management → PostgreSQL: stores sessions
- Academic structure → PostgreSQL: reads and writes
- Student records → PostgreSQL: reads and writes
- Personnel records → PostgreSQL: reads and writes
- Schools → PostgreSQL: reads and writes
- Users and access → PostgreSQL: reads and writes
- Student imports → PostgreSQL: commits records
- Personnel imports → PostgreSQL: commits records
- Spreadsheet grids → PostgreSQL: reads and patches
- Personnel grid → PostgreSQL: reads and patches
- Card templates → PostgreSQL: stores templates
- Public Forms → PostgreSQL: stores submissions
- Public verification → PostgreSQL: reads disclosures
- Student records → Media handling: manages photos
- Personnel records → Media handling: manages photos
- Media handling → Supabase Storage: uploads media
- Schools → Media handling: manages logos