# suvanshsehgal/sceptic architecture

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

- Interactive diagram: https://gitdiagram.com/suvanshsehgal/sceptic
- Repository: https://github.com/suvanshsehgal/sceptic

## Overview

Sceptic verifies submitted code through a web dashboard or CLI: projects and audit requests enter the backend, asynchronous audits fan out to independent verification agents, and synthesized findings and trust scores are stored and presented. The README also documents feature analysis and webhook-triggered PR audits. The graph reflects those documented capabilities, but some links for unsampled modules are omitted or shown as unverified rather than inferred.

Main entry points: [`backend/main.py`](https://github.com/suvanshsehgal/sceptic/blob/main/backend/main.py) (FastAPI Backend), [`worker/orchestrator.py`](https://github.com/suvanshsehgal/sceptic/blob/main/worker/orchestrator.py) (Audit Orchestrator), [`worker/celery_app.py`](https://github.com/suvanshsehgal/sceptic/blob/main/worker/celery_app.py) (Celery Worker), [`frontend/src/App.tsx`](https://github.com/suvanshsehgal/sceptic/blob/main/frontend/src/App.tsx) (Web Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User Interfaces"]
  node_dashboard["Web Dashboard<br/>[App.tsx]"]
  node_web_views["Audit and Project Views"]
  node_auth_ui["Web Authentication<br/>[AuthContext.tsx]"]
  node_cli["CLI<br/>[main.py]"]
  node_api_client["Frontend API Client<br/>[api.ts]"]
end

subgraph group_api["Backend and Data"]
  node_backend["FastAPI Backend<br/>[main.py]"]
  node_auth["Backend Authentication<br/>[auth.py]"]
  node_feature_analysis["Feature Analysis<br/>[feature_scoper.py]"]
  node_models["Audit and Project Models<br/>[models.py]"]
  node_database[("PostgreSQL<br/>[database.py]")]
end

subgraph group_audit["Audit Pipeline"]
  node_queue["Redis Task Queue"]
  node_celery["Celery Worker<br/>[celery_app.py]"]
  node_audit_service["Audit Service<br/>[audit_service.py]"]
  node_orchestrator["Audit Orchestrator<br/>[orchestrator.py]"]
end

subgraph group_analysis["Code Analysis"]
  node_language_support["Language Adapters"]
  node_parser["Universal Parser"]
  node_analysis_models["Analysis Models<br/>[models.py]"]
  node_fact_checker["Fact Checker<br/>[fact_checker.py]"]
  node_blind_tester["Blind Tester<br/>[blind_tester.py]"]
  node_security_guard["Security Guard<br/>[security_guard.py]"]
end

subgraph group_results["Findings and Reports"]
  node_synthesizer["Report Synthesizer<br/>[synthesizer.py]"]
  node_findings["Audit Findings<br/>[models.py]"]
end

node_engineer(("Engineer"))
node_github(("GitHub PR Event"))

node_engineer -->|"uses"| node_dashboard
node_engineer -->|"runs audits"| node_cli
node_github -->|"submits PR event"| node_backend
node_dashboard -->|"renders"| node_web_views
node_dashboard -->|"provides auth"| node_auth_ui
node_web_views -->|"requests data"| node_api_client
node_auth_ui -->|"authenticates"| node_backend
node_api_client -.->|"calls API"| node_backend
node_cli -->|"runs audits"| node_audit_service
node_cli -.->|"submits results"| node_backend
node_backend -->|"uses"| node_auth
node_backend -->|"scopes features"| node_feature_analysis
node_backend -->|"queries and saves"| node_models
node_backend -->|"opens sessions"| node_database
node_backend -->|"queues audit"| node_celery
node_celery -->|"dispatches tasks"| node_queue
node_celery -->|"runs pipeline"| node_orchestrator
node_celery -->|"persists audit"| node_database
node_audit_service -->|"runs pipeline"| node_orchestrator
node_audit_service -->|"discovers languages"| node_language_support
node_orchestrator -->|"verifies APIs"| node_fact_checker
node_orchestrator -->|"tests specifications"| node_blind_tester
node_orchestrator -->|"scans security"| node_security_guard
node_orchestrator -->|"synthesizes findings"| node_synthesizer
node_language_support -.->|"parses code"| node_parser
node_parser -->|"builds models"| node_analysis_models
node_synthesizer -.->|"produces findings"| node_findings
node_backend -->|"stores results"| node_findings
node_web_views -.->|"displays results"| node_findings

click node_dashboard "https://github.com/suvanshsehgal/sceptic/blob/main/frontend/src/App.tsx"
click node_web_views "https://github.com/suvanshsehgal/sceptic/tree/main/frontend/src/components"
click node_auth_ui "https://github.com/suvanshsehgal/sceptic/blob/main/frontend/src/context/AuthContext.tsx"
click node_cli "https://github.com/suvanshsehgal/sceptic/blob/main/cli/main.py"
click node_api_client "https://github.com/suvanshsehgal/sceptic/blob/main/frontend/src/api.ts"
click node_backend "https://github.com/suvanshsehgal/sceptic/blob/main/backend/main.py"
click node_auth "https://github.com/suvanshsehgal/sceptic/blob/main/backend/auth.py"
click node_feature_analysis "https://github.com/suvanshsehgal/sceptic/blob/main/backend/feature_scoper.py"
click node_models "https://github.com/suvanshsehgal/sceptic/blob/main/backend/models.py"
click node_database "https://github.com/suvanshsehgal/sceptic/blob/main/backend/database.py"
click node_celery "https://github.com/suvanshsehgal/sceptic/blob/main/worker/celery_app.py"
click node_audit_service "https://github.com/suvanshsehgal/sceptic/blob/main/worker/audit_service.py"
click node_orchestrator "https://github.com/suvanshsehgal/sceptic/blob/main/worker/orchestrator.py"
click node_language_support "https://github.com/suvanshsehgal/sceptic/tree/main/worker/languages"
click node_parser "https://github.com/suvanshsehgal/sceptic/blob/main/worker/languages/universal_parser.py"
click node_analysis_models "https://github.com/suvanshsehgal/sceptic/blob/main/worker/languages/models.py"
click node_fact_checker "https://github.com/suvanshsehgal/sceptic/blob/main/worker/fact_checker.py"
click node_blind_tester "https://github.com/suvanshsehgal/sceptic/blob/main/worker/blind_tester.py"
click node_security_guard "https://github.com/suvanshsehgal/sceptic/blob/main/worker/security_guard.py"
click node_synthesizer "https://github.com/suvanshsehgal/sceptic/blob/main/worker/synthesizer.py"
click node_findings "https://github.com/suvanshsehgal/sceptic/blob/main/backend/models.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_dashboard,node_web_views,node_auth_ui,node_cli,node_api_client toneBlue
class node_backend,node_auth,node_feature_analysis,node_models,node_database toneAmber
class node_queue,node_celery,node_audit_service,node_orchestrator toneMint
class node_language_support,node_parser,node_analysis_models,node_fact_checker,node_blind_tester,node_security_guard toneRose
class node_synthesizer,node_findings,node_engineer,node_github toneIndigo
```

## Components

### User Interfaces

- [Web Dashboard](https://github.com/suvanshsehgal/sceptic/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Audit and Project Views](https://github.com/suvanshsehgal/sceptic/tree/main/frontend/src/components): `frontend/src/components`
- [Web Authentication](https://github.com/suvanshsehgal/sceptic/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [CLI](https://github.com/suvanshsehgal/sceptic/blob/main/cli/main.py): `cli/main.py`
- [Frontend API Client](https://github.com/suvanshsehgal/sceptic/blob/main/frontend/src/api.ts): `frontend/src/api.ts`

### Backend and Data

- [FastAPI Backend](https://github.com/suvanshsehgal/sceptic/blob/main/backend/main.py): `backend/main.py`
- [Backend Authentication](https://github.com/suvanshsehgal/sceptic/blob/main/backend/auth.py): `backend/auth.py`
- [Feature Analysis](https://github.com/suvanshsehgal/sceptic/blob/main/backend/feature_scoper.py): `backend/feature_scoper.py`
- [Audit and Project Models](https://github.com/suvanshsehgal/sceptic/blob/main/backend/models.py): `backend/models.py`
- [PostgreSQL](https://github.com/suvanshsehgal/sceptic/blob/main/backend/database.py): `backend/database.py`

### Audit Pipeline

- **Redis Task Queue**
- [Celery Worker](https://github.com/suvanshsehgal/sceptic/blob/main/worker/celery_app.py): `worker/celery_app.py`
- [Audit Service](https://github.com/suvanshsehgal/sceptic/blob/main/worker/audit_service.py): `worker/audit_service.py`
- [Audit Orchestrator](https://github.com/suvanshsehgal/sceptic/blob/main/worker/orchestrator.py): `worker/orchestrator.py`

### Code Analysis

- [Language Adapters](https://github.com/suvanshsehgal/sceptic/tree/main/worker/languages): `worker/languages`
- [Universal Parser](https://github.com/suvanshsehgal/sceptic/blob/main/worker/languages/universal_parser.py): `worker/languages/universal_parser.py`
- [Analysis Models](https://github.com/suvanshsehgal/sceptic/blob/main/worker/languages/models.py): `worker/languages/models.py`
- [Fact Checker](https://github.com/suvanshsehgal/sceptic/blob/main/worker/fact_checker.py): `worker/fact_checker.py`
- [Blind Tester](https://github.com/suvanshsehgal/sceptic/blob/main/worker/blind_tester.py): `worker/blind_tester.py`
- [Security Guard](https://github.com/suvanshsehgal/sceptic/blob/main/worker/security_guard.py): `worker/security_guard.py`

### Findings and Reports

- [Report Synthesizer](https://github.com/suvanshsehgal/sceptic/blob/main/worker/synthesizer.py): `worker/synthesizer.py`
- [Audit Findings](https://github.com/suvanshsehgal/sceptic/blob/main/backend/models.py): `backend/models.py`

### Other components

- **Engineer**
- **GitHub PR Event**

## Connections

- Engineer → Web Dashboard: uses
- Engineer → CLI: runs audits
- GitHub PR Event → FastAPI Backend: submits PR event
- Web Dashboard → Audit and Project Views: renders (evidence: `frontend/src/App.tsx`)
- Web Dashboard → Web Authentication: provides auth (evidence: `frontend/src/App.tsx`)
- Audit and Project Views → Frontend API Client: requests data (evidence: `frontend/src/components/AuditDetailView.tsx`)
- Web Authentication → FastAPI Backend: authenticates (evidence: `frontend/src/context/AuthContext.tsx`)
- Frontend API Client → FastAPI Backend: calls API
- CLI → Audit Service: runs audits (evidence: `cli/main.py`)
- CLI → FastAPI Backend: submits results (evidence: `backend/main.py`)
- FastAPI Backend → Backend Authentication: uses (evidence: `backend/main.py`)
- FastAPI Backend → Feature Analysis: scopes features (evidence: `backend/main.py`)
- FastAPI Backend → Audit and Project Models: queries and saves (evidence: `backend/main.py`)
- FastAPI Backend → PostgreSQL: opens sessions (evidence: `backend/main.py`)
- FastAPI Backend → Celery Worker: queues audit (evidence: `backend/main.py`)
- Celery Worker → Redis Task Queue: dispatches tasks
- Celery Worker → Audit Orchestrator: runs pipeline (evidence: `worker/celery_app.py`)
- Celery Worker → PostgreSQL: persists audit (evidence: `worker/celery_app.py`)
- Audit Service → Audit Orchestrator: runs pipeline (evidence: `worker/audit_service.py`)
- Audit Service → Language Adapters: discovers languages (evidence: `worker/audit_service.py`)
- Audit Orchestrator → Fact Checker: verifies APIs (evidence: `worker/orchestrator.py`)
- Audit Orchestrator → Blind Tester: tests specifications (evidence: `worker/orchestrator.py`)
- Audit Orchestrator → Security Guard: scans security (evidence: `worker/orchestrator.py`)
- Audit Orchestrator → Report Synthesizer: synthesizes findings (evidence: `worker/orchestrator.py`)
- Language Adapters → Universal Parser: parses code (evidence: `worker/languages/python_adapter.py`)
- Universal Parser → Analysis Models: builds models (evidence: `worker/languages/universal_parser.py`)
- Report Synthesizer → Audit Findings: produces findings
- FastAPI Backend → Audit Findings: stores results (evidence: `backend/main.py`)
- Audit and Project Views → Audit Findings: displays results
