# fl4k1/nextwin architecture

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

- Interactive diagram: https://gitdiagram.com/fl4k1/nextwin
- Repository: https://github.com/fl4k1/nextwin

## Overview

NexTwin is documented as a healthcare platform for patient/doctor consultations and digital-twin health analysis. The documented consultation flow starts at the PWA, reaches the Django API for JWT-based access and consultation authorization, then uses the signaling gateway; the AI branch supports predictive modeling, anomaly detection, and transcription. The README also describes blockchain records and offline sync. No source files or implementation directories appear in the supplied tree, so paths are null and relationships rely on README statements only.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_pwa["MediBook PWA"]
end

subgraph group_backend["Backend and Consultation"]
  node_django["Django API"]
  node_consult_access["Consultation Access"]
  node_signaling["Signaling Gateway"]
  node_postgres[("PostgreSQL / Supabase")]
end

subgraph group_ai["AI and Analytics"]
  node_ai_engine["FastAPI AI Engine"]
  node_digital_twin["Digital Twin Models"]
  node_vector_db[("Pinecone Vector DB")]
  node_ai_scribe["AI Scribe"]
end

subgraph group_distributed["Distributed Data"]
  node_polygon[("Polygon Records")]
  node_offline_sync[("Offline Sync Buffer")]
end

node_patient_doctor(("Patient / Doctor"))

node_patient_doctor -->|"uses"| node_pwa
node_pwa -->|"exchanges JWT / WebSockets"| node_django
node_django -->|"reads / writes via ORM"| node_postgres
node_django -->|"dispatches via Redis"| node_signaling
node_django -->|"verifies assigned participants"| node_consult_access
node_django -->|"calls via REST"| node_ai_engine
node_ai_engine -->|"uses embeddings"| node_vector_db
node_ai_engine -->|"runs inference"| node_digital_twin
node_ai_engine -.->|"provides transcription"| node_ai_scribe
node_pwa -->|"exchanges records via Web3.js"| node_polygon
node_pwa -->|"syncs through IndexedDB"| node_offline_sync

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_pwa toneBlue
class node_django,node_consult_access,node_signaling,node_postgres toneAmber
class node_ai_engine,node_digital_twin,node_vector_db,node_ai_scribe toneMint
class node_polygon,node_offline_sync toneRose
class node_patient_doctor toneIndigo
```

## Components

### User Experience

- **MediBook PWA**

### Backend and Consultation

- **Django API**
- **Consultation Access**
- **Signaling Gateway**
- **PostgreSQL / Supabase**

### AI and Analytics

- **FastAPI AI Engine**
- **Digital Twin Models**
- **Pinecone Vector DB**
- **AI Scribe**

### Distributed Data

- **Polygon Records**
- **Offline Sync Buffer**

### Other components

- **Patient / Doctor**

## Connections

- Patient / Doctor → MediBook PWA: uses (evidence: `README.md`)
- MediBook PWA → Django API: exchanges JWT / WebSockets (evidence: `README.md`)
- Django API → PostgreSQL / Supabase: reads / writes via ORM (evidence: `README.md`)
- Django API → Signaling Gateway: dispatches via Redis (evidence: `README.md`)
- Django API → Consultation Access: verifies assigned participants (evidence: `README.md`)
- Django API → FastAPI AI Engine: calls via REST (evidence: `README.md`)
- FastAPI AI Engine → Pinecone Vector DB: uses embeddings (evidence: `README.md`)
- FastAPI AI Engine → Digital Twin Models: runs inference (evidence: `README.md`)
- FastAPI AI Engine → AI Scribe: provides transcription (evidence: `README.md`)
- MediBook PWA → Polygon Records: exchanges records via Web3.js (evidence: `README.md`)
- MediBook PWA → Offline Sync Buffer: syncs through IndexedDB (evidence: `README.md`)
