How sumitagg24/repoverix works
Purpose and entry points
RepoVeriX is a full-stack research prototype for evidence-grounded repository auditing, patch generation, and Docker-isolated repair verification. The backend FastAPI application starts at backend/app/main.py; the frontend is a Next.js App Router application rooted at frontend/src/app/layout.tsx and frontend/src/app/page.tsx. Deployment composes frontend, backend, PostgreSQL, and Nginx via docker-compose.yml, docker-compose.prod.yml, and nginx/nginx.conf.
API, identity, and tenant boundary
FastAPI route modules expose authenticated workflows for repositories, scans, findings, patches, intelligence, websites, reporting, and integrations. Route handlers should remain the HTTP boundary; authorization, organizations/RBAC, tokens, and account security are centralized through dependencies and services.
• backend/app/api/dependencies.py
• backend/app/api/routes/scans.py
• backend/app/api/routes/organizations.py
The browser client accesses this API through a typed service and feature hooks; application pages are organized around scan/repository/finding operations.
• frontend/src/services/api.ts
• frontend/src/hooks/useScans.ts
• frontend/src/app/(app)/repositories/[id]/page.tsx
Persistence and domain records
SQLAlchemy async models hold durable users, organizations, repositories, scans, findings, feedback/sharing, billing, and website-audit state. Alembic is the schema-evolution boundary; PostgreSQL is production storage while SQLite supports development/tests.
• backend/app/db/models.py
• backend/app/db/database.py
• backend/alembic/versions/003_orgs_rbac_tokens.py
Repository ingestion and knowledge construction
A scan begins with a GitHub-connected repository or guarded ZIP upload. Ingestion treats source as untrusted data, detects repository characteristics, and feeds parsing. Tree-sitter-derived symbols, imports, calls, and contextual knowledge create the cross-file model used by later analysis.
• backend/app/analysis/ingest.py
• backend/app/analysis/parsing.py
• backend/app/analysis/knowledge.py
GitHub/OAuth integration is isolated from analysis, while SSRF, security, and redaction facilities enforce trust boundaries around external/repository-originated content.
• backend/app/services/github.py
• backend/app/core/ssrf.py
• backend/app/analysis/redaction.py
Audit orchestration and evidence decisions
The orchestrator selects an experimental configuration (static_only, llm_only, combined, or RepoVeriX), coordinates deterministic detectors and contextual/LLM analysis, then validates claims into evidence-backed findings. Evidence status is the key reliability boundary: ungrounded LLM assertions are not trusted.
• backend/app/analysis/orchestrate.py
• backend/app/analysis/detectors.py
• backend/app/analysis/evidence.py
Analysis also includes risk/impact, dependency reachability, attack paths, architecture smells, regression, and repository query/intelligence outputs.
• backend/app/analysis/impact.py
• backend/app/analysis/attackpaths.py
• backend/app/analysis/intel.py
Repair and execution verification
For accepted findings, repair uses deterministic templates before LLM generation. Candidate diffs are evaluated by patch-quality logic and proof-of-fix, then executed only in a constrained Docker sandbox: apply patch, run tests/static checks, re-analyze the original finding, and persist a verified/failed verdict.
• backend/app/analysis/repair.py
• backend/app/analysis/verify.py
• backend/app/analysis/runtime.py
LLM access is provider-abstracted and prompt-driven; repository text is redacted before requests.
• backend/app/analysis/llm.py
• backend/prompts/repair_generation_v1.txt
User experience, reporting, and research evaluation
The Next.js UI presents scans, findings/evidence, patch verification, repository intelligence, and dashboards; TanStack-query-style hooks separate API state from views.
• frontend/src/app/(app)/scans/[id]/page.tsx
• frontend/src/components/audit/evidence-graph-diagram.tsx
• frontend/src/components/findings/proof-of-fix.tsx
Reports/SARIF exports form the external result boundary. A CLI benchmark runner evaluates actual outputs against seeded ground truth and configured experiment matrices.
• backend/app/services/reporting.py
• backend/app/services/sarif.py
• backend/app/benchmark/__main__.py
Components 21
Web client
- Next.js application · Presents repository, scan, finding, and verification workflows.
frontend/src/app/layout.tsx - Typed API client
frontend/src/services/api.ts - Scan state hooks
frontend/src/hooks/useScans.ts - Evidence and proof views
frontend/src/components/audit/evidence-graph-diagram.tsx
API and domain
- FastAPI application
backend/app/main.py - Workflow routes · HTTP boundary for scans, repositories, findings, patches, and organization workflows.
backend/app/api/routes/scans.py - Identity and tenant policy · Centralizes authentication, RBAC, organizations, tokens, and account security.
backend/app/api/dependencies.py - Domain records · Durable users, organizations, repositories, scans, findings, sharing, billing, and website audits.
backend/app/db/models.py - PostgreSQL / SQLite · PostgreSQL is production storage; SQLite supports development and tests.
backend/app/db/database.py - Schema migrations
backend/alembic/versions/003_orgs_rbac_tokens.py - Reports and SARIF · External boundary for audit results.
backend/app/services/reporting.py
Audit pipeline
- Repository ingestion · Accepts GitHub repositories or guarded ZIP uploads and detects repository characteristics.
backend/app/analysis/ingest.py - GitHub and OAuth
backend/app/services/github.py - Code knowledge model · Builds cross-file symbols, imports, calls, and contextual knowledge.
backend/app/analysis/knowledge.py - Audit orchestrator · Selects experimental mode and coordinates deterministic and contextual analysis.
backend/app/analysis/orchestrate.py - Evidence validation · Only evidence-backed claims become trusted findings.
backend/app/analysis/evidence.py - Benchmark runner · Compares actual outputs with seeded ground truth and experiment matrices.
backend/app/benchmark/__main__.py
Repair verification
- Patch generation · Uses deterministic templates before LLM candidate generation and patch-quality checks.
backend/app/analysis/repair.py - LLM provider layer · Prompt-driven access receives redacted repository text.
backend/app/analysis/llm.py - Docker verification sandbox · Applies patches, runs checks, re-analyzes findings, and records verdicts.
backend/app/analysis/runtime.py
Other components
- Deployment compose · Composes frontend, backend, database, and Nginx.
docker-compose.yml
Connections 25
- Next.js application → Scan state hooks: uses
- Scan state hooks → Typed API client: fetches through
- Typed API client → FastAPI application: API calls
- FastAPI application → Workflow routes: mounts
- Workflow routes → Identity and tenant policy: authorizes via
- Workflow routes → Audit orchestrator: starts scans
- Workflow routes → Patch generation: accepts repairs
- Workflow routes → Domain records: reads and writes
- Domain records → PostgreSQL / SQLite: persists to
- Schema migrations → PostgreSQL / SQLite: evolves schema
- GitHub and OAuth → Repository ingestion: supplies repositories
- Repository ingestion → Code knowledge model: parses source
- Code knowledge model → Audit orchestrator: context for analysis
- Audit orchestrator → Evidence validation: validates claims
- Evidence validation → Domain records: stores findings
- Evidence validation → Patch generation: accepted findings
- Patch generation → LLM provider layer: generates candidates
- Patch generation → Docker verification sandbox: submits candidate diff
- Docker verification sandbox → Domain records: persists verdict
- Domain records → Reports and SARIF: audit results
- Evidence and proof views → Typed API client: loads evidence
- Benchmark runner → Audit orchestrator: runs experiment matrix
- Deployment compose → Next.js application: deploys
- Deployment compose → FastAPI application: deploys
- Deployment compose → PostgreSQL / SQLite: deploys