# mdk-zero/icare architecture

> Architecture diagram of the GitHub repository mdk-zero/icare, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mdk-zero/icare
- Repository: https://github.com/mdk-zero/icare

## Overview

This is a nursing education and clinical-training platform with web and mobile experiences for students, faculty, and administrators. Its documented workflow spans coursework and assessments, simulated patient/scenario practice, competency and attendance tracking, and performance analytics with ML forecasting and recommendations; patient/room management is another major branch. The tree exposes corresponding route and service areas, while sampled source confirms selected web-to-API calls and the ML service’s internal modules. Many domain links are not evidenced by the excerpts, so the graph leaves them unasserted.

Main entry points: [`ml/app/main.py`](https://github.com/mdk-zero/icare/blob/main/ml/app/main.py) (ML service), [`web/app/page.tsx`](https://github.com/mdk-zero/icare/blob/main/web/app/page.tsx) (Web portal), [`web/app/lib/api.ts`](https://github.com/mdk-zero/icare/blob/main/web/app/lib/api.ts) (Web API client), [`web/app/lib/ml.ts`](https://github.com/mdk-zero/icare/blob/main/web/app/lib/ml.ts) (Student forecasts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experiences"]
  node_web["Web portal<br/>[page.tsx]"]
  node_mobile["Mobile app<br/>[index.tsx]"]
end

subgraph group_learning["Learning workflows"]
  node_courses["Courses and progress<br/>[course-progress.ts]"]
  node_assessments["Assessments and quizzes<br/>[page-client.tsx]"]
  node_scenarios["Simulation scenarios<br/>[page-client.tsx]"]
  node_library["Learning library<br/>[page-client.tsx]"]
  node_attendance["Attendance tracking<br/>[attendance.ts]"]
end

subgraph group_clinical["Clinical operations"]
  node_patients["Patient records and care<br/>[page.tsx]"]
  node_rooms["Room management<br/>[FloorPlan.tsx]"]
  node_clinical_monitor["Vitals and monitoring<br/>[page.tsx]"]
end

subgraph group_insight["Analytics and ML"]
  node_analytics["Performance analytics<br/>[page-client.tsx]"]
  node_student_insight["Student forecasts<br/>[ml.ts]"]
end

subgraph group_runtime["Service runtime"]
  node_ml_service["ML service<br/>[main.py]"]
  node_predictor["Prediction logic<br/>[predictor.py]"]
  node_progress_model["Progress analysis<br/>[progress.py]"]
  node_recommendations["Recommendations<br/>[recommender.py]"]
  node_model_registry["Model registry<br/>[registry.py]"]
  node_ml_database[("ML data access<br/>[db.py]")]
  node_api["Web API client<br/>[api.ts]"]
end

node_student(("Student"))
node_faculty(("Faculty"))
node_admin(("Administrator"))

node_web -->|"requests data"| node_api
node_web -->|"loads library"| node_api
node_web -->|"generates scenarios"| node_api
node_web -->|"manages students"| node_api
node_ml_service -->|"uses"| node_predictor
node_ml_service -->|"uses"| node_progress_model
node_ml_service -->|"uses"| node_recommendations
node_ml_service -->|"uses"| node_model_registry
node_ml_service -->|"uses"| node_ml_database
node_faculty -->|"reviews performance"| node_analytics
node_student -->|"receives forecasts"| node_student_insight
node_student -->|"records attendance"| node_attendance
node_faculty -->|"manages patient records"| node_patients
node_faculty -->|"manages rooms"| node_rooms
node_faculty -->|"monitors vitals"| node_clinical_monitor
node_student -->|"tracks progress"| node_courses
node_faculty -.->|"manages assessments"| node_assessments
node_student -.->|"practices scenarios"| node_scenarios
node_faculty -.->|"curates materials"| node_library
node_ml_service -.->|"serves predictions"| node_student_insight

click node_web "https://github.com/mdk-zero/icare/blob/main/web/app/page.tsx"
click node_mobile "https://github.com/mdk-zero/icare/blob/main/mobile/app/(tabs)/index.tsx"
click node_courses "https://github.com/mdk-zero/icare/blob/main/web/app/lib/course-progress.ts"
click node_assessments "https://github.com/mdk-zero/icare/blob/main/web/app/faculty/assessments/%5Bid%5D/page-client.tsx"
click node_scenarios "https://github.com/mdk-zero/icare/blob/main/web/app/faculty/scenarios/page-client.tsx"
click node_library "https://github.com/mdk-zero/icare/blob/main/web/app/faculty/library/page-client.tsx"
click node_attendance "https://github.com/mdk-zero/icare/blob/main/web/app/lib/attendance.ts"
click node_patients "https://github.com/mdk-zero/icare/blob/main/web/app/faculty/patients/page.tsx"
click node_rooms "https://github.com/mdk-zero/icare/blob/main/web/app/components/FloorPlan.tsx"
click node_clinical_monitor "https://github.com/mdk-zero/icare/blob/main/web/app/faculty/vitals/page.tsx"
click node_analytics "https://github.com/mdk-zero/icare/blob/main/web/app/faculty/analytics/page-client.tsx"
click node_student_insight "https://github.com/mdk-zero/icare/blob/main/web/app/lib/ml.ts"
click node_ml_service "https://github.com/mdk-zero/icare/blob/main/ml/app/main.py"
click node_predictor "https://github.com/mdk-zero/icare/blob/main/ml/app/predictor.py"
click node_progress_model "https://github.com/mdk-zero/icare/blob/main/ml/app/progress.py"
click node_recommendations "https://github.com/mdk-zero/icare/blob/main/ml/app/recommender.py"
click node_model_registry "https://github.com/mdk-zero/icare/blob/main/ml/app/registry.py"
click node_ml_database "https://github.com/mdk-zero/icare/blob/main/ml/app/db.py"
click node_api "https://github.com/mdk-zero/icare/blob/main/web/app/lib/api.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_mobile toneBlue
class node_courses,node_assessments,node_scenarios,node_library,node_attendance toneAmber
class node_patients,node_rooms,node_clinical_monitor toneMint
class node_analytics,node_student_insight toneRose
class node_ml_service,node_predictor,node_progress_model,node_recommendations,node_model_registry,node_ml_database,node_api,node_student,node_faculty,node_admin toneIndigo
```

## Components

### User experiences

- [Web portal](https://github.com/mdk-zero/icare/blob/main/web/app/page.tsx): `web/app/page.tsx`
- [Mobile app](https://github.com/mdk-zero/icare/blob/main/mobile/app/(tabs)/index.tsx): `mobile/app/(tabs)/index.tsx`

### Learning workflows

- [Courses and progress](https://github.com/mdk-zero/icare/blob/main/web/app/lib/course-progress.ts): `web/app/lib/course-progress.ts`
- [Assessments and quizzes](https://github.com/mdk-zero/icare/blob/main/web/app/faculty/assessments/%5Bid%5D/page-client.tsx): `web/app/faculty/assessments/[id]/page-client.tsx`
- [Simulation scenarios](https://github.com/mdk-zero/icare/blob/main/web/app/faculty/scenarios/page-client.tsx): `web/app/faculty/scenarios/page-client.tsx`
- [Learning library](https://github.com/mdk-zero/icare/blob/main/web/app/faculty/library/page-client.tsx): `web/app/faculty/library/page-client.tsx`
- [Attendance tracking](https://github.com/mdk-zero/icare/blob/main/web/app/lib/attendance.ts): `web/app/lib/attendance.ts`

### Clinical operations

- [Patient records and care](https://github.com/mdk-zero/icare/blob/main/web/app/faculty/patients/page.tsx): `web/app/faculty/patients/page.tsx`
- [Room management](https://github.com/mdk-zero/icare/blob/main/web/app/components/FloorPlan.tsx): `web/app/components/FloorPlan.tsx`
- [Vitals and monitoring](https://github.com/mdk-zero/icare/blob/main/web/app/faculty/vitals/page.tsx): `web/app/faculty/vitals/page.tsx`

### Analytics and ML

- [Performance analytics](https://github.com/mdk-zero/icare/blob/main/web/app/faculty/analytics/page-client.tsx): `web/app/faculty/analytics/page-client.tsx`
- [Student forecasts](https://github.com/mdk-zero/icare/blob/main/web/app/lib/ml.ts): `web/app/lib/ml.ts`

### Service runtime

- [ML service](https://github.com/mdk-zero/icare/blob/main/ml/app/main.py): `ml/app/main.py`
- [Prediction logic](https://github.com/mdk-zero/icare/blob/main/ml/app/predictor.py): `ml/app/predictor.py`
- [Progress analysis](https://github.com/mdk-zero/icare/blob/main/ml/app/progress.py): `ml/app/progress.py`
- [Recommendations](https://github.com/mdk-zero/icare/blob/main/ml/app/recommender.py): `ml/app/recommender.py`
- [Model registry](https://github.com/mdk-zero/icare/blob/main/ml/app/registry.py): `ml/app/registry.py`
- [ML data access](https://github.com/mdk-zero/icare/blob/main/ml/app/db.py): `ml/app/db.py`
- [Web API client](https://github.com/mdk-zero/icare/blob/main/web/app/lib/api.ts): `web/app/lib/api.ts`

### Other components

- **Student**
- **Faculty**
- **Administrator**

## Connections

- Web portal → Web API client: requests data
- Web portal → Web API client: loads library
- Web portal → Web API client: generates scenarios
- Web portal → Web API client: manages students
- ML service → Prediction logic: uses (evidence: `ml/app/main.py`)
- ML service → Progress analysis: uses (evidence: `ml/app/main.py`)
- ML service → Recommendations: uses (evidence: `ml/app/main.py`)
- ML service → Model registry: uses (evidence: `ml/app/main.py`)
- ML service → ML data access: uses (evidence: `ml/app/main.py`)
- Faculty → Performance analytics: reviews performance
- Student → Student forecasts: receives forecasts
- Student → Attendance tracking: records attendance
- Faculty → Patient records and care: manages patient records
- Faculty → Room management: manages rooms
- Faculty → Vitals and monitoring: monitors vitals
- Student → Courses and progress: tracks progress
- Faculty → Assessments and quizzes: manages assessments
- Student → Simulation scenarios: practices scenarios
- Faculty → Learning library: curates materials
- ML service → Student forecasts: serves predictions
