# techstack-ujjwal/synapse architecture

> Architecture diagram of the GitHub repository techstack-ujjwal/synapse, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/techstack-ujjwal/synapse
- Repository: https://github.com/techstack-ujjwal/synapse

## Overview

Synapse AI is a multilingual patient-intake and clinician-support application. Patients enter symptoms and conversation details, can submit prior reports, and receive a triage summary and patient token; clinicians use a dashboard and patient review screens to manage consultations and review reports. The frontend and FastAPI backend are distinct runtime layers, with SQLite and optional AI services in the backend. Source excerpts show the main page’s speech and report-display dependencies and backend schema imports; several API connections are inferred from the product structure and are marked unverified.

Main entry points: [`app/[locale]/page.tsx`](https://github.com/techstack-ujjwal/synapse/blob/main/app/%5Blocale%5D/page.tsx) (Intake Workflow), [`backend/main.py`](https://github.com/techstack-ujjwal/synapse/blob/main/backend/main.py) (API and Workflows), [`app/[locale]/doctor-dashboard/page.tsx`](https://github.com/techstack-ujjwal/synapse/blob/main/app/%5Blocale%5D/doctor-dashboard/page.tsx) (Clinician Dashboard), [`app/[locale]/doctor-dashboard/review/[patient_id]/page.tsx`](https://github.com/techstack-ujjwal/synapse/blob/main/app/%5Blocale%5D/doctor-dashboard/review/%5Bpatient_id%5D/page.tsx) (Patient Review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient Intake"]
  node_intake["Intake Workflow<br/>[page.tsx]"]
  node_speech["Browser Speech<br/>[speech.ts]"]
  node_parameter["Parameter Cards<br/>[parameter-card.tsx]"]
  node_comparison["Report Comparison"]
end

subgraph group_clinical["Clinical Review"]
  node_login["Clinician Login<br/>[page.tsx]"]
  node_dashboard["Clinician Dashboard<br/>[page.tsx]"]
  node_review["Patient Review<br/>[page.tsx]"]
end

subgraph group_backend["Backend Services"]
  node_api["API and Workflows<br/>[main.py]"]
  node_schemas["API Schemas"]
  node_database[("SQLite Database<br/>[main.py]")]
  node_ai{{"OpenAI Services"}}
end

subgraph group_localization["Language Support"]
  node_i18n["Locale Messages<br/>[request.ts]"]
end

node_patient(("Patient"))
node_doctor(("Clinician"))

node_patient -->|"enters details"| node_intake
node_intake -->|"uses recognition"| node_speech
node_intake -->|"renders"| node_parameter
node_intake -->|"renders"| node_comparison
node_intake -.->|"submits intake"| node_api
node_doctor -.->|"signs in"| node_login
node_doctor -.->|"manages queue"| node_dashboard
node_dashboard -.->|"opens patient"| node_review
node_dashboard -.->|"requests queue"| node_api
node_review -.->|"requests records"| node_api
node_api -->|"uses models"| node_schemas
node_api -->|"reads and writes"| node_database
node_api -.->|"requests analysis"| node_ai
node_intake -->|"loads translations"| node_i18n
node_dashboard -.->|"loads locale"| node_i18n

click node_intake "https://github.com/techstack-ujjwal/synapse/blob/main/app/%5Blocale%5D/page.tsx"
click node_speech "https://github.com/techstack-ujjwal/synapse/blob/main/lib/speech.ts"
click node_parameter "https://github.com/techstack-ujjwal/synapse/blob/main/components/ui/parameter-card.tsx"
click node_comparison "https://github.com/techstack-ujjwal/synapse/blob/main/components/ui/report-comparison.tsx"
click node_login "https://github.com/techstack-ujjwal/synapse/blob/main/app/%5Blocale%5D/doctor-login/page.tsx"
click node_dashboard "https://github.com/techstack-ujjwal/synapse/blob/main/app/%5Blocale%5D/doctor-dashboard/page.tsx"
click node_review "https://github.com/techstack-ujjwal/synapse/blob/main/app/%5Blocale%5D/doctor-dashboard/review/%5Bpatient_id%5D/page.tsx"
click node_api "https://github.com/techstack-ujjwal/synapse/blob/main/backend/main.py"
click node_schemas "https://github.com/techstack-ujjwal/synapse/tree/main/backend/app/schemas"
click node_database "https://github.com/techstack-ujjwal/synapse/blob/main/backend/main.py"
click node_i18n "https://github.com/techstack-ujjwal/synapse/blob/main/i18n/request.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_intake,node_speech,node_parameter,node_comparison toneBlue
class node_login,node_dashboard,node_review toneAmber
class node_api,node_schemas,node_database,node_ai toneMint
class node_i18n toneRose
class node_patient,node_doctor toneIndigo
```

## Components

### Patient Intake

- [Intake Workflow](https://github.com/techstack-ujjwal/synapse/blob/main/app/%5Blocale%5D/page.tsx): `app/[locale]/page.tsx`
- [Browser Speech](https://github.com/techstack-ujjwal/synapse/blob/main/lib/speech.ts): `lib/speech.ts`
- [Parameter Cards](https://github.com/techstack-ujjwal/synapse/blob/main/components/ui/parameter-card.tsx): `components/ui/parameter-card.tsx`
- [Report Comparison](https://github.com/techstack-ujjwal/synapse/blob/main/components/ui/report-comparison.tsx): `components/ui/report-comparison.tsx`

### Clinical Review

- [Clinician Login](https://github.com/techstack-ujjwal/synapse/blob/main/app/%5Blocale%5D/doctor-login/page.tsx): `app/[locale]/doctor-login/page.tsx`
- [Clinician Dashboard](https://github.com/techstack-ujjwal/synapse/blob/main/app/%5Blocale%5D/doctor-dashboard/page.tsx): `app/[locale]/doctor-dashboard/page.tsx`
- [Patient Review](https://github.com/techstack-ujjwal/synapse/blob/main/app/%5Blocale%5D/doctor-dashboard/review/%5Bpatient_id%5D/page.tsx): `app/[locale]/doctor-dashboard/review/[patient_id]/page.tsx`

### Backend Services

- [API and Workflows](https://github.com/techstack-ujjwal/synapse/blob/main/backend/main.py): `backend/main.py`
- [API Schemas](https://github.com/techstack-ujjwal/synapse/tree/main/backend/app/schemas): `backend/app/schemas`
- [SQLite Database](https://github.com/techstack-ujjwal/synapse/blob/main/backend/main.py): `backend/main.py`
- **OpenAI Services**

### Language Support

- [Locale Messages](https://github.com/techstack-ujjwal/synapse/blob/main/i18n/request.ts): `i18n/request.ts`

### Other components

- **Patient**
- **Clinician**

## Connections

- Patient → Intake Workflow: enters details (evidence: `app/[locale]/page.tsx`)
- Intake Workflow → Browser Speech: uses recognition (evidence: `app/[locale]/page.tsx`)
- Intake Workflow → Parameter Cards: renders (evidence: `app/[locale]/page.tsx`)
- Intake Workflow → Report Comparison: renders (evidence: `app/[locale]/page.tsx`)
- Intake Workflow → API and Workflows: submits intake
- Clinician → Clinician Login: signs in
- Clinician → Clinician Dashboard: manages queue
- Clinician Dashboard → Patient Review: opens patient
- Clinician Dashboard → API and Workflows: requests queue
- Patient Review → API and Workflows: requests records
- API and Workflows → API Schemas: uses models (evidence: `backend/main.py`)
- API and Workflows → SQLite Database: reads and writes (evidence: `backend/main.py`)
- API and Workflows → OpenAI Services: requests analysis
- Intake Workflow → Locale Messages: loads translations (evidence: `app/[locale]/page.tsx`)
- Clinician Dashboard → Locale Messages: loads locale
