How mark-costin/thesis-draft-1 works
This is a clinical platform with a Streamlit interface and Flask API. Its main user journey is role-based login, then patient intake and risk assessment or clinician review and consultation; administrators manage accounts. The API gateway mounts authentication, doctor, admin, prediction, and health endpoints, with ORM-backed persistence and shared security controls. The README describes longitudinal CDSS and clinical reporting, but the sampled excerpts do not establish their full runtime wiring; those capabilities are represented without asserting unsupported calls. The graph focuses on product runtime, not sample or test files.
Main entry points: rest.py REST gateway · auth0.py Authentication · docpage.py Clinician workspace · admin.py Admin endpoints
Components 27
Clinical workspaces
- Workspace router
frontend/main.py - Login and signup
frontend/views/login.py - Patient portal
frontend/views/patientpage.py - Clinician workspace
frontend/views/docpage.py - Admin portal
frontend/views/adminpage.py - Workspace styling
frontend/views/styles.py - API client
frontend/api_client.py
API gateway
- REST gateway
backend/rest.py - Authentication
backend/routes/auth0.py - Doctor endpoints
backend/routes/doctor.py - Admin endpoints
backend/routes/admin.py - Risk inference endpoints
backend/routes/predictions.py - Health diagnostics
backend/routes/health.py
Identity and safeguards
- Role authorization
backend/middleware/rbac.py - Replay protection
backend/middleware/idempotency.py - Response sanitization
backend/middleware/sanitizer.py - Security headers
backend/middleware/security.py
Clinical services
- CDSS engine
backend/model_orm/cdss_engine.py - Clinical records
backend/model_orm/clinic_orm.py - Baseline records
backend/model_orm/baseline_orm.py - Clinical vectors
backend/model_orm/clinical_vector.py
Data layer
- SQLAlchemy connection
backend/dbconnect.py - User accounts
backend/model_orm/usr_orm.py - Patient profiles
backend/model_orm/pat_orm.py - Doctor profiles
backend/model_orm/doc_orm.py - Admin profiles
backend/model_orm/adm_orm.py
Other components
- Platform user
Connections 47
- Platform user → Workspace router: uses
README.md - Workspace router → Login and signup: routes to
README.md - Workspace router → Patient portal: routes to
README.md - Workspace router → Clinician workspace: routes to
README.md - Workspace router → Admin portal: routes to
README.md - Patient portal → Workspace styling: uses
README.md - Clinician workspace → Workspace styling: uses
frontend/views/docpage.py - Platform user → Login and signup: submits credentials
README.md - Login and signup → API client: requests authentication
- Patient portal → API client: requests assessment
- Clinician workspace → API client: requests clinical data
- Admin portal → API client: requests administration
- API client → REST gateway: calls API
- REST gateway → Authentication: registers
backend/rest.py - REST gateway → Doctor endpoints: registers
backend/rest.py - REST gateway → Admin endpoints: registers
backend/rest.py - REST gateway → Risk inference endpoints: registers
backend/rest.py - REST gateway → Health diagnostics: registers
backend/rest.py - REST gateway → Security headers: initializes
backend/rest.py - Authentication → User accounts: queries and updates
backend/routes/auth0.py - Authentication → Patient profiles: creates and reads
backend/routes/auth0.py - Authentication → Doctor profiles: reads profiles
backend/routes/auth0.py - Authentication → Admin profiles: reads profiles
backend/routes/auth0.py - Authentication → Role authorization: protects logout
backend/routes/auth0.py - Authentication → Response sanitization: sanitizes output
backend/routes/auth0.py - Doctor endpoints → Role authorization: protects routes
backend/routes/doctor.py - Doctor endpoints → Replay protection: guards consultation
backend/routes/doctor.py - Doctor endpoints → Patient profiles: reads records
backend/routes/doctor.py - Doctor endpoints → Response sanitization: sanitizes output
backend/routes/doctor.py - Admin endpoints → Role authorization: protects routes
backend/routes/admin.py - Admin endpoints → Replay protection: guards provisioning
backend/routes/admin.py - Admin endpoints → User accounts: queries accounts
backend/routes/admin.py - Admin endpoints → Doctor profiles: provisions clinicians
backend/routes/admin.py - Admin endpoints → Response sanitization: sanitizes output
backend/routes/admin.py - Risk inference endpoints → Role authorization: protects inference
backend/routes/predictions.py - Risk inference endpoints → Response sanitization: sanitizes output
backend/routes/predictions.py - Health diagnostics → SQLAlchemy connection: checks connectivity
backend/routes/health.py - Health diagnostics → Replay protection: tests replay guard
backend/routes/health.py - SQLAlchemy connection → User accounts: backs ORM models
backend/model_orm/usr_orm.py - SQLAlchemy connection → Patient profiles: backs ORM models
backend/model_orm/pat_orm.py - SQLAlchemy connection → Doctor profiles: backs ORM models
backend/model_orm/doc_orm.py - SQLAlchemy connection → Admin profiles: backs ORM models
backend/model_orm/adm_orm.py - SQLAlchemy connection → Replay protection: provides raw connection
backend/middleware/idempotency.py - Clinician workspace → CDSS engine: supports CDSS workflow
README.md - Clinician workspace → Clinical records: supports clinical records
README.md - Clinician workspace → Baseline records: supports longitudinal baseline
README.md - CDSS engine → Clinical vectors: uses vectors