# jit-1836/medical-report-ai architecture

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

- Interactive diagram: https://gitdiagram.com/jit-1836/medical-report-ai
- Repository: https://github.com/jit-1836/medical-report-ai

## Overview

This is a small Express/EJS medical-report UI prototype. A user opens the report-upload page, loads or enters report text, and submits it; the browser checks for a minimum length, stores the text in localStorage, then attempts to navigate to patient context, where chips can be toggled. The server also renders a home page and serves frontend assets. The README is empty, and template contents were not sampled; the context navigation target in the client does not match the server’s registered route, so that transition is shown as attempted rather than verified.

Main entry points: [`app.js`](https://github.com/jit-1836/medical-report-ai/blob/main/app.js) (Express routes), [`public/upload.js`](https://github.com/jit-1836/medical-report-ai/blob/main/public/upload.js) (Report entry), [`frontend/patient-context.ejs`](https://github.com/jit-1836/medical-report-ai/blob/main/frontend/patient-context.ejs) (Context page), [`public/patient-context.js`](https://github.com/jit-1836/medical-report-ai/blob/main/public/patient-context.js) (Context chips)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Web server"]
  node_express["Express routes<br/>[app.js]"]
  node_home["Home page<br/>[main.ejs]"]
end

subgraph group_intake["Report intake"]
  node_upload["Upload page<br/>[upload.ejs]"]
  node_intake_ui["Report entry<br/>[upload.js]"]
  node_browser_store[("Browser storage")]
end

subgraph group_context["Patient context"]
  node_patient_page["Context page"]
  node_context_ui["Context chips<br/>[patient-context.js]"]
end

node_user(("User"))

node_user -->|"requests pages"| node_express
node_express -->|"renders /home"| node_home
node_express -->|"renders /upload"| node_upload
node_express -->|"renders /patient-context"| node_patient_page
node_express -->|"serves static files"| node_intake_ui
node_express -->|"serves static files"| node_context_ui
node_user -->|"enters report"| node_intake_ui
node_intake_ui -->|"stores report text"| node_browser_store
node_intake_ui -->|"attempts redirect"| node_patient_page
node_user -->|"clicks chips"| node_context_ui

click node_express "https://github.com/jit-1836/medical-report-ai/blob/main/app.js"
click node_home "https://github.com/jit-1836/medical-report-ai/blob/main/frontend/main.ejs"
click node_upload "https://github.com/jit-1836/medical-report-ai/blob/main/frontend/upload.ejs"
click node_intake_ui "https://github.com/jit-1836/medical-report-ai/blob/main/public/upload.js"
click node_patient_page "https://github.com/jit-1836/medical-report-ai/blob/main/frontend/patient-context.ejs"
click node_context_ui "https://github.com/jit-1836/medical-report-ai/blob/main/public/patient-context.js"

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_express,node_home,node_user toneBlue
class node_upload,node_intake_ui,node_browser_store toneAmber
class node_patient_page,node_context_ui toneMint
```

## Components

### Web server

- [Express routes](https://github.com/jit-1836/medical-report-ai/blob/main/app.js): `app.js`
- [Home page](https://github.com/jit-1836/medical-report-ai/blob/main/frontend/main.ejs): `frontend/main.ejs`

### Report intake

- [Upload page](https://github.com/jit-1836/medical-report-ai/blob/main/frontend/upload.ejs): `frontend/upload.ejs`
- [Report entry](https://github.com/jit-1836/medical-report-ai/blob/main/public/upload.js): `public/upload.js`
- **Browser storage**

### Patient context

- [Context page](https://github.com/jit-1836/medical-report-ai/blob/main/frontend/patient-context.ejs): `frontend/patient-context.ejs`
- [Context chips](https://github.com/jit-1836/medical-report-ai/blob/main/public/patient-context.js): `public/patient-context.js`

### Other components

- **User**

## Connections

- User → Express routes: requests pages
- Express routes → Home page: renders /home (evidence: `app.js`)
- Express routes → Upload page: renders /upload (evidence: `app.js`)
- Express routes → Context page: renders /patient-context (evidence: `app.js`)
- Express routes → Report entry: serves static files (evidence: `app.js`)
- Express routes → Context chips: serves static files (evidence: `app.js`)
- User → Report entry: enters report (evidence: `public/upload.js`)
- Report entry → Browser storage: stores report text (evidence: `public/upload.js`)
- Report entry → Context page: attempts redirect (evidence: `public/upload.js`)
- User → Context chips: clicks chips (evidence: `public/patient-context.js`)
