# vishal343012/medicare-project architecture

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

- Interactive diagram: https://gitdiagram.com/vishal343012/medicare-project
- Repository: https://github.com/vishal343012/medicare-project

## Overview

Medical Portal POC is a synthetic-patient demo with an authenticated browser UI and a PostgreSQL-backed API. The documented request path runs through NGINX: OAuth2 Proxy delegates sign-in to Microsoft Entra ID, while the React UI calls Node.js endpoints for the user identity and patient records. The backend queries PostgreSQL for records. Edges reflect README-described routing or calls visible in the frontend/backend excerpts; NGINX and OAuth2 Proxy internals are represented from documentation/config paths, not inspected implementation.

Main entry points: [`nginx/medical-poc.conf`](https://github.com/vishal343012/medicare-project/blob/main/nginx/medical-poc.conf) (NGINX routing), [`backend/src/server.js`](https://github.com/vishal343012/medicare-project/blob/main/backend/src/server.js) (Node.js API), [`oauth2-proxy/oauth2-proxy.cfg.example`](https://github.com/vishal343012/medicare-project/blob/main/oauth2-proxy/oauth2-proxy.cfg.example) (OAuth2 Proxy), [`frontend/src/main.jsx`](https://github.com/vishal343012/medicare-project/blob/main/frontend/src/main.jsx) (React portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and authentication"]
  node_nginx["NGINX routing<br/>[medical-poc.conf]"]
  node_oauth["OAuth2 Proxy"]
end

subgraph group_application["Portal application"]
  node_react["React portal<br/>[main.jsx]"]
  node_api["Node.js API<br/>[server.js]"]
end

subgraph group_data["Patient data"]
  node_postgres[("PostgreSQL records<br/>[schema.sql]")]
end

node_browser(("Browser user"))
node_entra["Microsoft Entra ID"]

node_browser -->|"requests portal"| node_nginx
node_nginx -->|"routes auth"| node_oauth
node_oauth -->|"delegates sign-in"| node_entra
node_nginx -->|"serves UI"| node_react
node_browser -->|"requests API"| node_nginx
node_react -->|"fetches user and patients"| node_api
node_nginx -->|"routes API"| node_api
node_api -->|"queries patients"| node_postgres

click node_nginx "https://github.com/vishal343012/medicare-project/blob/main/nginx/medical-poc.conf"
click node_oauth "https://github.com/vishal343012/medicare-project/blob/main/oauth2-proxy/oauth2-proxy.cfg.example"
click node_react "https://github.com/vishal343012/medicare-project/blob/main/frontend/src/main.jsx"
click node_api "https://github.com/vishal343012/medicare-project/blob/main/backend/src/server.js"
click node_postgres "https://github.com/vishal343012/medicare-project/blob/main/database/schema.sql"

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_nginx,node_oauth,node_browser toneBlue
class node_react,node_api toneAmber
class node_postgres toneMint
class node_entra toneIndigo
```

## Components

### Access and authentication

- [NGINX routing](https://github.com/vishal343012/medicare-project/blob/main/nginx/medical-poc.conf): `nginx/medical-poc.conf`
- [OAuth2 Proxy](https://github.com/vishal343012/medicare-project/blob/main/oauth2-proxy/oauth2-proxy.cfg.example): `oauth2-proxy/oauth2-proxy.cfg.example`

### Portal application

- [React portal](https://github.com/vishal343012/medicare-project/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Node.js API](https://github.com/vishal343012/medicare-project/blob/main/backend/src/server.js): `backend/src/server.js`

### Patient data

- [PostgreSQL records](https://github.com/vishal343012/medicare-project/blob/main/database/schema.sql): `database/schema.sql`

### Other components

- **Browser user**
- **Microsoft Entra ID**

## Connections

- Browser user → NGINX routing: requests portal (evidence: `README.md`)
- NGINX routing → OAuth2 Proxy: routes auth (evidence: `README.md`)
- OAuth2 Proxy → Microsoft Entra ID: delegates sign-in (evidence: `README.md`)
- NGINX routing → React portal: serves UI (evidence: `README.md`)
- Browser user → NGINX routing: requests API (evidence: `README.md`)
- React portal → Node.js API: fetches user and patients (evidence: `frontend/src/main.jsx`)
- NGINX routing → Node.js API: routes API (evidence: `README.md`)
- Node.js API → PostgreSQL records: queries patients (evidence: `backend/src/server.js`)
