# arjun-thekkethil11/syncsentry architecture

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

- Interactive diagram: https://gitdiagram.com/arjun-thekkethil11/syncsentry
- Repository: https://github.com/arjun-thekkethil11/syncsentry

## Overview

SyncSentry analyzes uploaded video for audio/video drift, applies corrections where confidence permits, independently verifies the result, and optionally corrects captions. The web app submits files and presents previews, status, and downloads; the analyzer also exposes API and CLI entry points. The README documents piecewise and wide-range detection capabilities, though their internal wiring is only partly visible in the sampled source, so the graph shows only supported relationships. Some frontend and API implementation details were not sampled.

Main entry points: [`analyzer/syncsentry/pipeline.py`](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/pipeline.py) (Fix pipeline), [`analyzer/syncsentry/api.py`](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/api.py) (HTTP API), [`webapp/src/api/client.ts`](https://github.com/arjun-thekkethil11/syncsentry/blob/main/webapp/src/api/client.ts) (API client), [`webapp/src/components/UploadForm.tsx`](https://github.com/arjun-thekkethil11/syncsentry/blob/main/webapp/src/components/UploadForm.tsx) (Upload form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_web["Web app<br/>[App.tsx]"]
  node_analyze["Analyze page<br/>[Analyze.tsx]"]
  node_upload["Upload form<br/>[UploadForm.tsx]"]
  node_client["API client<br/>[client.ts]"]
  node_results["Results panel<br/>[ResultsPanel.tsx]"]
end

subgraph group_entry["Analyzer entry points"]
  node_api["HTTP API<br/>[api.py]"]
  node_cli["CLI<br/>[cli.py]"]
  node_pipeline["Fix pipeline<br/>[pipeline.py]"]
end

subgraph group_detection["Sync detection"]
  node_coarse["Coarse correlation<br/>[coarse_xcorr.py]"]
  node_syncnet["SyncNet offset<br/>[syncnet_offset.py]"]
  node_speaker["Speaker and face analysis"]
  node_piecewise["Piecewise offsets"]
  node_wide["Wide-range offsets"]
  node_caption["Caption drift<br/>[drift_check.py]"]
end

subgraph group_correction["Correction and output"]
  node_avfix["A/V correction<br/>[av_fix.py]"]
  node_piecefix["Piecewise correction<br/>[piecewise_fix.py]"]
  node_captionfix["Caption correction<br/>[caption_fix.py]"]
  node_report["Summary report<br/>[summary.py]"]
end

node_user(("User"))
node_video["Video and optional captions"]
node_browser(("Browser"))

node_user -->|"opens"| node_web
node_web -->|"routes to"| node_analyze
node_user -->|"selects files"| node_upload
node_analyze -->|"presents"| node_upload
node_upload -->|"submits"| node_client
node_client -->|"POST /v1/fix"| node_api
node_video -->|"uploads"| node_api
node_api -->|"runs"| node_pipeline
node_cli -->|"runs"| node_pipeline
node_pipeline -->|"estimates offset"| node_coarse
node_pipeline -->|"optionally estimates"| node_syncnet
node_syncnet -->|"uses face and speech analysis"| node_speaker
node_pipeline -->|"checks segment offsets"| node_piecewise
node_pipeline -->|"extends offset search"| node_wide
node_pipeline -->|"applies A/V correction"| node_avfix
node_pipeline -->|"remeasures correction"| node_coarse
node_pipeline -->|"checks caption drift"| node_caption
node_pipeline -->|"corrects captions"| node_captionfix
node_pipeline -->|"corrects segments"| node_piecefix
node_pipeline -->|"builds summary"| node_report
node_api -->|"returns result"| node_client
node_client -->|"provides result"| node_results
node_results -->|"previews and downloads"| node_browser
node_browser -->|"fetches output"| node_api

click node_web "https://github.com/arjun-thekkethil11/syncsentry/blob/main/webapp/src/App.tsx"
click node_analyze "https://github.com/arjun-thekkethil11/syncsentry/blob/main/webapp/src/pages/Analyze.tsx"
click node_upload "https://github.com/arjun-thekkethil11/syncsentry/blob/main/webapp/src/components/UploadForm.tsx"
click node_client "https://github.com/arjun-thekkethil11/syncsentry/blob/main/webapp/src/api/client.ts"
click node_results "https://github.com/arjun-thekkethil11/syncsentry/blob/main/webapp/src/components/ResultsPanel.tsx"
click node_api "https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/api.py"
click node_cli "https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/cli.py"
click node_pipeline "https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/pipeline.py"
click node_coarse "https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/detectors/coarse_xcorr.py"
click node_syncnet "https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/lipsync/syncnet_offset.py"
click node_speaker "https://github.com/arjun-thekkethil11/syncsentry/tree/main/analyzer/syncsentry/lipsync"
click node_piecewise "https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/lipsync/piecewise_offset.py"
click node_wide "https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/lipsync/wide_range_offset.py"
click node_caption "https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/captions/drift_check.py"
click node_avfix "https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/fixer/av_fix.py"
click node_piecefix "https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/fixer/piecewise_fix.py"
click node_captionfix "https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/fixer/caption_fix.py"
click node_report "https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/report/summary.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_web,node_analyze,node_upload,node_client,node_results,node_user,node_browser toneBlue
class node_api,node_cli,node_pipeline toneAmber
class node_coarse,node_syncnet,node_speaker,node_piecewise,node_wide,node_caption toneMint
class node_avfix,node_piecefix,node_captionfix,node_report toneRose
class node_video toneIndigo
```

## Components

### Web interface

- [Web app](https://github.com/arjun-thekkethil11/syncsentry/blob/main/webapp/src/App.tsx): `webapp/src/App.tsx`
- [Analyze page](https://github.com/arjun-thekkethil11/syncsentry/blob/main/webapp/src/pages/Analyze.tsx): `webapp/src/pages/Analyze.tsx`
- [Upload form](https://github.com/arjun-thekkethil11/syncsentry/blob/main/webapp/src/components/UploadForm.tsx): `webapp/src/components/UploadForm.tsx`
- [API client](https://github.com/arjun-thekkethil11/syncsentry/blob/main/webapp/src/api/client.ts): `webapp/src/api/client.ts`
- [Results panel](https://github.com/arjun-thekkethil11/syncsentry/blob/main/webapp/src/components/ResultsPanel.tsx): `webapp/src/components/ResultsPanel.tsx`

### Analyzer entry points

- [HTTP API](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/api.py): `analyzer/syncsentry/api.py`
- [CLI](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/cli.py): `analyzer/syncsentry/cli.py`
- [Fix pipeline](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/pipeline.py): `analyzer/syncsentry/pipeline.py`

### Sync detection

- [Coarse correlation](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/detectors/coarse_xcorr.py): `analyzer/syncsentry/detectors/coarse_xcorr.py`
- [SyncNet offset](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/lipsync/syncnet_offset.py): `analyzer/syncsentry/lipsync/syncnet_offset.py`
- [Speaker and face analysis](https://github.com/arjun-thekkethil11/syncsentry/tree/main/analyzer/syncsentry/lipsync): `analyzer/syncsentry/lipsync`
- [Piecewise offsets](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/lipsync/piecewise_offset.py): `analyzer/syncsentry/lipsync/piecewise_offset.py`
- [Wide-range offsets](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/lipsync/wide_range_offset.py): `analyzer/syncsentry/lipsync/wide_range_offset.py`
- [Caption drift](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/captions/drift_check.py): `analyzer/syncsentry/captions/drift_check.py`

### Correction and output

- [A/V correction](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/fixer/av_fix.py): `analyzer/syncsentry/fixer/av_fix.py`
- [Piecewise correction](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/fixer/piecewise_fix.py): `analyzer/syncsentry/fixer/piecewise_fix.py`
- [Caption correction](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/fixer/caption_fix.py): `analyzer/syncsentry/fixer/caption_fix.py`
- [Summary report](https://github.com/arjun-thekkethil11/syncsentry/blob/main/analyzer/syncsentry/report/summary.py): `analyzer/syncsentry/report/summary.py`

### Other components

- **User**
- **Video and optional captions**
- **Browser**

## Connections

- User → Web app: opens
- Web app → Analyze page: routes to
- User → Upload form: selects files
- Analyze page → Upload form: presents
- Upload form → API client: submits
- API client → HTTP API: POST /v1/fix
- Video and optional captions → HTTP API: uploads
- HTTP API → Fix pipeline: runs
- CLI → Fix pipeline: runs
- Fix pipeline → Coarse correlation: estimates offset
- Fix pipeline → SyncNet offset: optionally estimates
- SyncNet offset → Speaker and face analysis: uses face and speech analysis
- Fix pipeline → Piecewise offsets: checks segment offsets
- Fix pipeline → Wide-range offsets: extends offset search
- Fix pipeline → A/V correction: applies A/V correction
- Fix pipeline → Coarse correlation: remeasures correction
- Fix pipeline → Caption drift: checks caption drift
- Fix pipeline → Caption correction: corrects captions
- Fix pipeline → Piecewise correction: corrects segments
- Fix pipeline → Summary report: builds summary
- HTTP API → API client: returns result
- API client → Results panel: provides result
- Results panel → Browser: previews and downloads
- Browser → HTTP API: fetches output
