# shushi0209/video-kyc architecture

> Architecture diagram of the GitHub repository shushi0209/video-kyc, 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/shushi0209/video-kyc
- Repository: https://github.com/shushi0209/video-kyc

## Overview

Video KYC is a browser-assisted identity-verification product: an applicant enters a case ID, completes a recorded session with face/liveness checks, questions, and document capture, then evidence can be reviewed and approved or retried. The frontend API client and backend routers connect these stages to persistent workflow state and media storage. Several routes and frontend details are documented by module names and contracts rather than sampled call sites, so those links are omitted where ownership cannot be established.

Main entry points: [`backend/api.py`](https://github.com/shushi0209/video-kyc/blob/main/backend/api.py) (Session API), [`backend/main.py`](https://github.com/shushi0209/video-kyc/blob/main/backend/main.py) (Application server), [`backend/core/database.py`](https://github.com/shushi0209/video-kyc/blob/main/backend/core/database.py) (Relational database), [`backend/api_evidence.py`](https://github.com/shushi0209/video-kyc/blob/main/backend/api_evidence.py) (Evidence and review API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Applicant experience"]
  node_landing["Case entry<br/>[App.tsx]"]
  node_session_ui["Session experience<br/>[VideoKyc.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_liveness_contract["Liveness interface"]
  node_browser_liveness["Browser liveness"]
end

subgraph group_workflow["Verification workflow"]
  node_api_entry["Session API<br/>[api.py]"]
  node_question_api["Question API<br/>[api_questions.py]"]
  node_document_api["Document API<br/>[api_documents.py]"]
end

subgraph group_review["Evidence and review"]
  node_evidence_api["Evidence and review API<br/>[api_evidence.py]"]
end

subgraph group_platform["Runtime platform"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_domain_models["Workflow records<br/>[models.py]"]
  node_database[("Relational database<br/>[database.py]")]
  node_media_storage[("Media storage<br/>[storage.py]")]
  node_settings["Configuration<br/>[config.py]"]
  node_server["Application server<br/>[main.py]"]
end

node_applicant(("Applicant"))

node_applicant -->|"enters case"| node_landing
node_landing -->|"opens session"| node_session_ui
node_session_ui -->|"requests workflow"| node_api_client
node_session_ui -->|"uses provider"| node_liveness_contract
node_browser_liveness -->|"implements"| node_liveness_contract
node_server -->|"mounts routes"| node_api_entry
node_server -->|"mounts routes"| node_question_api
node_server -->|"mounts routes"| node_document_api
node_server -->|"mounts routes"| node_evidence_api
node_api_entry -->|"reads and writes"| node_domain_models
node_api_entry -->|"queries state"| node_database
node_api_entry -->|"stores recording"| node_media_storage
node_question_api -->|"reads and writes"| node_domain_models
node_question_api -->|"queries state"| node_database
node_document_api -->|"reads and writes"| node_domain_models
node_document_api -->|"queries state"| node_database
node_evidence_api -->|"uses workflow helpers"| node_api_entry
node_evidence_api -->|"reads and updates"| node_domain_models
node_evidence_api -->|"queries state"| node_database
node_api_client -.->|"calls HTTP API"| node_server
node_api_entry -->|"validates responses"| node_schemas
node_settings -->|"configures connection"| node_database
node_media_storage -->|"reads storage root"| node_settings

click node_landing "https://github.com/shushi0209/video-kyc/blob/main/frontend/src/App.tsx"
click node_session_ui "https://github.com/shushi0209/video-kyc/blob/main/frontend/src/VideoKyc.tsx"
click node_api_client "https://github.com/shushi0209/video-kyc/blob/main/frontend/src/api.ts"
click node_liveness_contract "https://github.com/shushi0209/video-kyc/blob/main/frontend/src/providers/LivenessProvider.ts"
click node_browser_liveness "https://github.com/shushi0209/video-kyc/blob/main/frontend/src/providers/BrowserLivenessProvider.ts"
click node_api_entry "https://github.com/shushi0209/video-kyc/blob/main/backend/api.py"
click node_question_api "https://github.com/shushi0209/video-kyc/blob/main/backend/api_questions.py"
click node_document_api "https://github.com/shushi0209/video-kyc/blob/main/backend/api_documents.py"
click node_evidence_api "https://github.com/shushi0209/video-kyc/blob/main/backend/api_evidence.py"
click node_schemas "https://github.com/shushi0209/video-kyc/blob/main/backend/schemas.py"
click node_domain_models "https://github.com/shushi0209/video-kyc/blob/main/backend/models.py"
click node_database "https://github.com/shushi0209/video-kyc/blob/main/backend/core/database.py"
click node_media_storage "https://github.com/shushi0209/video-kyc/blob/main/backend/core/storage.py"
click node_settings "https://github.com/shushi0209/video-kyc/blob/main/backend/core/config.py"
click node_server "https://github.com/shushi0209/video-kyc/blob/main/backend/main.py"

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_landing,node_session_ui,node_api_client,node_liveness_contract,node_browser_liveness toneBlue
class node_api_entry,node_question_api,node_document_api toneAmber
class node_evidence_api toneMint
class node_schemas,node_domain_models,node_database,node_media_storage,node_settings,node_server toneRose
class node_applicant toneIndigo
```

## Components

### Applicant experience

- [Case entry](https://github.com/shushi0209/video-kyc/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Session experience](https://github.com/shushi0209/video-kyc/blob/main/frontend/src/VideoKyc.tsx): `frontend/src/VideoKyc.tsx`
- [API client](https://github.com/shushi0209/video-kyc/blob/main/frontend/src/api.ts): `frontend/src/api.ts`
- [Liveness interface](https://github.com/shushi0209/video-kyc/blob/main/frontend/src/providers/LivenessProvider.ts): `frontend/src/providers/LivenessProvider.ts`
- [Browser liveness](https://github.com/shushi0209/video-kyc/blob/main/frontend/src/providers/BrowserLivenessProvider.ts): `frontend/src/providers/BrowserLivenessProvider.ts`

### Verification workflow

- [Session API](https://github.com/shushi0209/video-kyc/blob/main/backend/api.py): `backend/api.py`
- [Question API](https://github.com/shushi0209/video-kyc/blob/main/backend/api_questions.py): `backend/api_questions.py`
- [Document API](https://github.com/shushi0209/video-kyc/blob/main/backend/api_documents.py): `backend/api_documents.py`

### Evidence and review

- [Evidence and review API](https://github.com/shushi0209/video-kyc/blob/main/backend/api_evidence.py): `backend/api_evidence.py`

### Runtime platform

- [API schemas](https://github.com/shushi0209/video-kyc/blob/main/backend/schemas.py): `backend/schemas.py`
- [Workflow records](https://github.com/shushi0209/video-kyc/blob/main/backend/models.py): `backend/models.py`
- [Relational database](https://github.com/shushi0209/video-kyc/blob/main/backend/core/database.py): `backend/core/database.py`
- [Media storage](https://github.com/shushi0209/video-kyc/blob/main/backend/core/storage.py): `backend/core/storage.py`
- [Configuration](https://github.com/shushi0209/video-kyc/blob/main/backend/core/config.py): `backend/core/config.py`
- [Application server](https://github.com/shushi0209/video-kyc/blob/main/backend/main.py): `backend/main.py`

### Other components

- **Applicant**

## Connections

- Applicant → Case entry: enters case (evidence: `frontend/src/App.tsx`)
- Case entry → Session experience: opens session (evidence: `frontend/src/App.tsx`)
- Session experience → API client: requests workflow (evidence: `frontend/src/VideoKyc.tsx`)
- Session experience → Liveness interface: uses provider (evidence: `frontend/src/VideoKyc.tsx`)
- Browser liveness → Liveness interface: implements (evidence: `frontend/src/providers/BrowserLivenessProvider.ts`)
- Application server → Session API: mounts routes (evidence: `backend/main.py`)
- Application server → Question API: mounts routes (evidence: `backend/main.py`)
- Application server → Document API: mounts routes (evidence: `backend/main.py`)
- Application server → Evidence and review API: mounts routes (evidence: `backend/main.py`)
- Session API → Workflow records: reads and writes (evidence: `backend/api.py`)
- Session API → Relational database: queries state (evidence: `backend/api.py`)
- Session API → Media storage: stores recording (evidence: `backend/api.py`)
- Question API → Workflow records: reads and writes (evidence: `backend/api_questions.py`)
- Question API → Relational database: queries state (evidence: `backend/api_questions.py`)
- Document API → Workflow records: reads and writes (evidence: `backend/api_documents.py`)
- Document API → Relational database: queries state (evidence: `backend/api_documents.py`)
- Evidence and review API → Session API: uses workflow helpers (evidence: `backend/api_evidence.py`)
- Evidence and review API → Workflow records: reads and updates (evidence: `backend/api_evidence.py`)
- Evidence and review API → Relational database: queries state (evidence: `backend/api_evidence.py`)
- API client → Application server: calls HTTP API
- Session API → API schemas: validates responses (evidence: `backend/api.py`)
- Configuration → Relational database: configures connection (evidence: `backend/core/database.py`)
- Media storage → Configuration: reads storage root (evidence: `backend/core/storage.py`)
