# lcbkreem/-med-hackathon-multi-agent-patient-sim architecture

> Architecture diagram of the GitHub repository lcbkreem/-med-hackathon-multi-agent-patient-sim, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lcbkreem/-med-hackathon-multi-agent-patient-sim
- Repository: https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim

## Overview

This is a student learning platform with an administrative content and account-management area, alongside a voice-based clinical case simulator. The main student workflow spans study dashboards, quizzes, notes, playlists, notifications, and subscriptions; administrators manage learning content, students, reports, plans, and notifications. The simulator presents cases, creates consultation sessions, and returns evaluation feedback. The tree and excerpts establish these product areas, but do not show all query-to-API wiring, so those connections are omitted.

Main entry points: [`lib/db.ts`](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/lib/db.ts) (Application database), [`app/dashboard/page.tsx`](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/dashboard/page.tsx) (Study dashboard), [`app/api/admin/reports/route.ts`](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/api/admin/reports/route.ts) (Report management), [`app/api/admin/students/route.ts`](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/api/admin/students/route.ts) (Student management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_student["Student learning"]
  node_student_dashboard["Study dashboard<br/>[page.tsx]"]
  node_student_quizzes["Quiz practice<br/>[page.tsx]"]
  node_student_notes["Notes"]
  node_student_playlists["Playlists"]
  node_student_notifications["Notifications<br/>[page.tsx]"]
  node_subscriptions["Subscriptions<br/>[page.tsx]"]
end

subgraph group_admin["Administration"]
  node_admin_dashboard["Admin dashboard<br/>[page.tsx]"]
  node_content_management["Learning content"]
  node_admin_reports["Report management<br/>[route.ts]"]
  node_admin_students["Student management<br/>[route.ts]"]
  node_admin_notifications["Admin notifications<br/>[page.tsx]"]
end

subgraph group_simulation["Clinical simulation"]
  node_simulation_cases["Case catalogue<br/>[page.tsx]"]
  node_simulation_session["Consultation session<br/>[page.tsx]"]
  node_simulation_api["Simulation endpoints"]
  node_simulation_evaluation["Case evaluation<br/>[route.ts]"]
end

subgraph group_shared["Identity and data"]
  node_user_identity["User identity"]
  node_student_identity["Student identity"]
  node_database[("Application database<br/>[db.ts]")]
end

node_student_actor(("Student"))
node_admin_actor(("Administrator"))

node_student_actor -->|"views"| node_student_dashboard
node_student_dashboard -->|"opens quizzes"| node_student_quizzes
node_student_dashboard -->|"opens playlists"| node_student_playlists
node_student_actor -->|"views"| node_student_notifications
node_student_actor -->|"views"| node_subscriptions
node_student_actor -->|"opens quiz"| node_student_quizzes
node_student_notifications -->|"loads student"| node_student_identity
node_student_identity -->|"reads user"| node_database
node_admin_actor -->|"views"| node_admin_dashboard
node_admin_actor -->|"requests reports"| node_admin_reports
node_admin_reports -->|"checks access"| node_user_identity
node_admin_reports -->|"reads reports"| node_database
node_admin_actor -->|"requests students"| node_admin_students
node_admin_students -->|"checks access"| node_user_identity
node_admin_students -->|"reads students"| node_database
node_student_actor -->|"browses cases"| node_simulation_cases
node_simulation_cases -->|"starts case"| node_simulation_session
node_simulation_session -->|"creates session"| node_simulation_api
node_simulation_session -->|"ends consultation"| node_simulation_evaluation
node_simulation_evaluation -->|"loads student"| node_student_identity
node_simulation_evaluation -->|"reads session"| node_database
node_user_identity -->|"reads user"| node_database

click node_student_dashboard "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/dashboard/page.tsx"
click node_student_quizzes "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/myquize/%5BmyquizeId%5D/page.tsx"
click node_student_notes "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/tree/main/app/dashboard/notes"
click node_student_playlists "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/tree/main/app/dashboard/playlists"
click node_student_notifications "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/dashboard/notifications/page.tsx"
click node_subscriptions "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/dashboard/subscriptions/page.tsx"
click node_admin_dashboard "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/admindashboard/page.tsx"
click node_content_management "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/tree/main/actions/mutations/admin"
click node_admin_reports "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/api/admin/reports/route.ts"
click node_admin_students "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/api/admin/students/route.ts"
click node_admin_notifications "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/admindashboard/notifications/page.tsx"
click node_simulation_cases "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/simulation/page.tsx"
click node_simulation_session "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/simulation/%5BcaseId%5D/page.tsx"
click node_simulation_api "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/tree/main/app/api/simulation"
click node_simulation_evaluation "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/api/simulation/end/route.ts"
click node_user_identity "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/actions/queries/get-current-user.ts"
click node_student_identity "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/actions/queries/get-current-student.ts"
click node_database "https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/lib/db.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_student_dashboard,node_student_quizzes,node_student_notes,node_student_playlists,node_student_notifications,node_subscriptions toneBlue
class node_admin_dashboard,node_content_management,node_admin_reports,node_admin_students,node_admin_notifications toneAmber
class node_simulation_cases,node_simulation_session,node_simulation_api,node_simulation_evaluation toneMint
class node_user_identity,node_student_identity,node_database toneRose
class node_student_actor,node_admin_actor toneIndigo
```

## Components

### Student learning

- [Study dashboard](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Quiz practice](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/myquize/%5BmyquizeId%5D/page.tsx): `app/myquize/[myquizeId]/page.tsx`
- [Notes](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/tree/main/app/dashboard/notes): `app/dashboard/notes`
- [Playlists](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/tree/main/app/dashboard/playlists): `app/dashboard/playlists`
- [Notifications](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/dashboard/notifications/page.tsx): `app/dashboard/notifications/page.tsx`
- [Subscriptions](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/dashboard/subscriptions/page.tsx): `app/dashboard/subscriptions/page.tsx`

### Administration

- [Admin dashboard](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/admindashboard/page.tsx): `app/admindashboard/page.tsx`
- [Learning content](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/tree/main/actions/mutations/admin): `actions/mutations/admin`
- [Report management](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/api/admin/reports/route.ts): `app/api/admin/reports/route.ts`
- [Student management](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/api/admin/students/route.ts): `app/api/admin/students/route.ts`
- [Admin notifications](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/admindashboard/notifications/page.tsx): `app/admindashboard/notifications/page.tsx`

### Clinical simulation

- [Case catalogue](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/simulation/page.tsx): `app/simulation/page.tsx`
- [Consultation session](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/simulation/%5BcaseId%5D/page.tsx): `app/simulation/[caseId]/page.tsx`
- [Simulation endpoints](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/tree/main/app/api/simulation): `app/api/simulation`
- [Case evaluation](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/app/api/simulation/end/route.ts): `app/api/simulation/end/route.ts`

### Identity and data

- [User identity](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/actions/queries/get-current-user.ts): `actions/queries/get-current-user.ts`
- [Student identity](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/actions/queries/get-current-student.ts): `actions/queries/get-current-student.ts`
- [Application database](https://github.com/lcbkreem/-med-hackathon-multi-agent-patient-sim/blob/main/lib/db.ts): `lib/db.ts`

### Other components

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

## Connections

- Student → Study dashboard: views (evidence: `app/dashboard/page.tsx`)
- Study dashboard → Quiz practice: opens quizzes (evidence: `app/dashboard/page.tsx`)
- Study dashboard → Playlists: opens playlists (evidence: `app/dashboard/page.tsx`)
- Student → Notifications: views (evidence: `app/dashboard/notifications/page.tsx`)
- Student → Subscriptions: views (evidence: `app/dashboard/subscriptions/page.tsx`)
- Student → Quiz practice: opens quiz (evidence: `app/myquize/[myquizeId]/page.tsx`)
- Notifications → Student identity: loads student
- Student identity → Application database: reads user (evidence: `actions/queries/get-current-student.ts`)
- Administrator → Admin dashboard: views (evidence: `app/admindashboard/page.tsx`)
- Administrator → Report management: requests reports (evidence: `app/api/admin/reports/route.ts`)
- Report management → User identity: checks access (evidence: `app/api/admin/reports/route.ts`)
- Report management → Application database: reads reports (evidence: `app/api/admin/reports/route.ts`)
- Administrator → Student management: requests students (evidence: `app/api/admin/students/route.ts`)
- Student management → User identity: checks access (evidence: `app/api/admin/students/route.ts`)
- Student management → Application database: reads students (evidence: `app/api/admin/students/route.ts`)
- Student → Case catalogue: browses cases (evidence: `app/simulation/page.tsx`)
- Case catalogue → Consultation session: starts case (evidence: `app/simulation/[caseId]/page.tsx`)
- Consultation session → Simulation endpoints: creates session (evidence: `app/simulation/[caseId]/page.tsx`)
- Consultation session → Case evaluation: ends consultation (evidence: `app/simulation/[caseId]/page.tsx`)
- Case evaluation → Student identity: loads student (evidence: `app/api/simulation/end/route.ts`)
- Case evaluation → Application database: reads session (evidence: `app/api/simulation/end/route.ts`)
- User identity → Application database: reads user (evidence: `actions/queries/get-current-user.ts`)
