# abhaykumar99/riskscope architecture

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

- Interactive diagram: https://gitdiagram.com/abhaykumar99/riskscope
- Repository: https://github.com/abhaykumar99/riskscope

## Overview

RiskScope lets developers authenticate, submit a GitHub repository or ZIP, run an asynchronous security scan, and review prioritized findings and reports. The backend intake and scan pipeline feed static, secret, dependency, and configuration analysis; results are correlated, checked for reachability, scored, and persisted for dashboard and report access. The README documents these capabilities, while the excerpts and source index support only selected implementation links; unverified subsystem connections are omitted.

Main entry points: [`backend/app/services/pipeline.py`](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/pipeline.py) (Scan orchestration), [`backend/app/routers`](https://github.com/abhaykumar99/riskscope/tree/main/backend/app/routers) (REST API routes), [`frontend/src/App.tsx`](https://github.com/abhaykumar99/riskscope/blob/main/frontend/src/App.tsx) (Web application), [`frontend/src/api/client.ts`](https://github.com/abhaykumar99/riskscope/blob/main/frontend/src/api/client.ts) (Typed API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_web_app["Web application<br/>[App.tsx]"]
  node_auth_ui["Authentication UI<br/>[auth.tsx]"]
  node_repo_ui["Repository and scan UI<br/>[SubmitRepo.tsx]"]
  node_scan_detail["Finding explorer<br/>[ScanDetail.tsx]"]
  node_api_client["Typed API client<br/>[client.ts]"]
end

subgraph group_api["API and access"]
  node_api_routes["REST API routes"]
  node_auth_service["Authentication<br/>[auth.py]"]
  node_repo_intake["Repository intake<br/>[ingest.py]"]
  node_task_queue["Async scan tasks<br/>[tasks.py]"]
  node_reporting["Reports<br/>[reports.py]"]
end

subgraph group_analysis["Scan and prioritization"]
  node_pipeline["Scan orchestration<br/>[pipeline.py]"]
  node_code_scanner["Static analysis<br/>[semgrep_scanner.py]"]
  node_secret_scanner["Secret detection"]
  node_dependency_scanner["Dependency analysis<br/>[osv_scanner.py]"]
  node_config_scanner["Configuration checks<br/>[config_scanner.py]"]
  node_correlation["Finding correlation<br/>[correlation.py]"]
  node_reachability["Reachability analysis<br/>[reachability.py]"]
  node_scoring["Risk prioritization<br/>[scoring.py]"]
end

subgraph group_persistence["Findings and state"]
  node_finding_store["Finding persistence<br/>[scanners.py]"]
  node_database[("PostgreSQL state<br/>[db.py]")]
end

node_developer(("Developer"))
node_github["GitHub"]
node_osv["OSV API"]

node_developer -->|"uses"| node_web_app
node_web_app -->|"provides auth"| node_auth_ui
node_web_app -->|"routes to"| node_repo_ui
node_web_app -->|"routes to"| node_scan_detail
node_auth_ui -->|"requests API"| node_api_client
node_repo_ui -.->|"submits scans"| node_api_client
node_scan_detail -->|"loads findings"| node_api_client
node_api_client -->|"calls API"| node_api_routes
node_api_routes -->|"routes auth"| node_auth_service
node_api_routes -.->|"handles intake"| node_repo_intake
node_repo_intake -->|"clones repository"| node_github
node_api_routes -.->|"queues scans"| node_task_queue
node_task_queue -->|"runs pipeline"| node_pipeline
node_pipeline -->|"prepares source"| node_repo_intake
node_pipeline -->|"runs analysis"| node_code_scanner
node_pipeline -->|"runs detection"| node_secret_scanner
node_pipeline -->|"checks dependencies"| node_dependency_scanner
node_pipeline -->|"checks configuration"| node_config_scanner
node_dependency_scanner -.->|"queries vulnerabilities"| node_osv
node_pipeline -->|"correlates results"| node_correlation
node_correlation -.->|"checks reachability"| node_reachability
node_pipeline -->|"scores findings"| node_scoring
node_pipeline -->|"persists results"| node_finding_store
node_finding_store -.->|"writes findings"| node_database
node_api_routes -.->|"serves reports"| node_reporting
node_reporting -.->|"reads results"| node_database

click node_web_app "https://github.com/abhaykumar99/riskscope/blob/main/frontend/src/App.tsx"
click node_auth_ui "https://github.com/abhaykumar99/riskscope/blob/main/frontend/src/store/auth.tsx"
click node_repo_ui "https://github.com/abhaykumar99/riskscope/blob/main/frontend/src/pages/SubmitRepo.tsx"
click node_scan_detail "https://github.com/abhaykumar99/riskscope/blob/main/frontend/src/pages/ScanDetail.tsx"
click node_api_client "https://github.com/abhaykumar99/riskscope/blob/main/frontend/src/api/client.ts"
click node_api_routes "https://github.com/abhaykumar99/riskscope/tree/main/backend/app/routers"
click node_auth_service "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/routers/auth.py"
click node_repo_intake "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/ingest.py"
click node_task_queue "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/tasks.py"
click node_pipeline "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/pipeline.py"
click node_code_scanner "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/semgrep_scanner.py"
click node_secret_scanner "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/gitleaks_scanner.py"
click node_dependency_scanner "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/osv_scanner.py"
click node_config_scanner "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/config_scanner.py"
click node_correlation "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/correlation.py"
click node_reachability "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/reachability.py"
click node_scoring "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/scoring.py"
click node_reporting "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/reports.py"
click node_finding_store "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/scanners.py"
click node_database "https://github.com/abhaykumar99/riskscope/blob/main/backend/app/db.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_app,node_auth_ui,node_repo_ui,node_scan_detail,node_api_client toneBlue
class node_api_routes,node_auth_service,node_repo_intake,node_task_queue,node_reporting toneAmber
class node_pipeline,node_code_scanner,node_secret_scanner,node_dependency_scanner,node_config_scanner,node_correlation,node_reachability,node_scoring,node_osv toneMint
class node_finding_store,node_database toneRose
class node_developer,node_github toneIndigo
```

## Components

### Web experience

- [Web application](https://github.com/abhaykumar99/riskscope/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Authentication UI](https://github.com/abhaykumar99/riskscope/blob/main/frontend/src/store/auth.tsx): `frontend/src/store/auth.tsx`
- [Repository and scan UI](https://github.com/abhaykumar99/riskscope/blob/main/frontend/src/pages/SubmitRepo.tsx): `frontend/src/pages/SubmitRepo.tsx`
- [Finding explorer](https://github.com/abhaykumar99/riskscope/blob/main/frontend/src/pages/ScanDetail.tsx): `frontend/src/pages/ScanDetail.tsx`
- [Typed API client](https://github.com/abhaykumar99/riskscope/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### API and access

- [REST API routes](https://github.com/abhaykumar99/riskscope/tree/main/backend/app/routers): `backend/app/routers`
- [Authentication](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Repository intake](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/ingest.py): `backend/app/services/ingest.py`
- [Async scan tasks](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/tasks.py): `backend/app/tasks.py`
- [Reports](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/reports.py): `backend/app/services/reports.py`

### Scan and prioritization

- [Scan orchestration](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/pipeline.py): `backend/app/services/pipeline.py`
- [Static analysis](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/semgrep_scanner.py): `backend/app/services/semgrep_scanner.py`
- [Secret detection](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/gitleaks_scanner.py): `backend/app/services/gitleaks_scanner.py`
- [Dependency analysis](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/osv_scanner.py): `backend/app/services/osv_scanner.py`
- [Configuration checks](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/config_scanner.py): `backend/app/services/config_scanner.py`
- [Finding correlation](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/correlation.py): `backend/app/services/correlation.py`
- [Reachability analysis](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/reachability.py): `backend/app/services/reachability.py`
- [Risk prioritization](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/scoring.py): `backend/app/services/scoring.py`

### Findings and state

- [Finding persistence](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/services/scanners.py): `backend/app/services/scanners.py`
- [PostgreSQL state](https://github.com/abhaykumar99/riskscope/blob/main/backend/app/db.py): `backend/app/db.py`

### Other components

- **Developer**
- **GitHub**
- **OSV API**

## Connections

- Developer → Web application: uses (evidence: `frontend/src/App.tsx`)
- Web application → Authentication UI: provides auth (evidence: `frontend/src/App.tsx`)
- Web application → Repository and scan UI: routes to (evidence: `frontend/src/App.tsx`)
- Web application → Finding explorer: routes to (evidence: `frontend/src/App.tsx`)
- Authentication UI → Typed API client: requests API (evidence: `frontend/src/store/auth.tsx`)
- Repository and scan UI → Typed API client: submits scans
- Finding explorer → Typed API client: loads findings (evidence: `frontend/src/pages/ScanDetail.tsx`)
- Typed API client → REST API routes: calls API (evidence: `frontend/src/api/client.ts`)
- REST API routes → Authentication: routes auth (evidence: `backend/app/main.py`)
- REST API routes → Repository intake: handles intake
- Repository intake → GitHub: clones repository (evidence: `backend/app/services/ingest.py`)
- REST API routes → Async scan tasks: queues scans
- Async scan tasks → Scan orchestration: runs pipeline (evidence: `backend/app/tasks.py`)
- Scan orchestration → Repository intake: prepares source (evidence: `backend/app/services/pipeline.py`)
- Scan orchestration → Static analysis: runs analysis (evidence: `backend/app/services/pipeline.py`)
- Scan orchestration → Secret detection: runs detection (evidence: `backend/app/services/pipeline.py`)
- Scan orchestration → Dependency analysis: checks dependencies (evidence: `backend/app/services/pipeline.py`)
- Scan orchestration → Configuration checks: checks configuration (evidence: `backend/app/services/pipeline.py`)
- Dependency analysis → OSV API: queries vulnerabilities
- Scan orchestration → Finding correlation: correlates results (evidence: `backend/app/services/pipeline.py`)
- Finding correlation → Reachability analysis: checks reachability (evidence: `backend/app/services/correlation.py`)
- Scan orchestration → Risk prioritization: scores findings (evidence: `backend/app/services/pipeline.py`)
- Scan orchestration → Finding persistence: persists results (evidence: `backend/app/services/pipeline.py`)
- Finding persistence → PostgreSQL state: writes findings
- REST API routes → Reports: serves reports
- Reports → PostgreSQL state: reads results
