# lokeshlella/sentinelchain architecture

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

- Interactive diagram: https://gitdiagram.com/lokeshlella/sentinelchain
- Repository: https://github.com/lokeshlella/sentinelchain

## Overview

Sentinel Chain is a web application for analyzing software dependencies, identifying vulnerabilities, and guiding developers through evidence-backed remediation. Its main workflow ingests a local or GitHub repository, extracts dependencies, checks them against OSV, enriches findings with usage evidence and local-LLM analysis, proposes an upgrade, validates it in Docker, and can create a draft GitHub pull request. The frontend exposes these stages and their results. Several backend relationships are documented in the README; where detailed route or service-call source was not shown, the graph relies on that documentation rather than inferring calls from names.

Main entry points: [`backend/app/services/analysis/pipeline.py`](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/analysis/pipeline.py) (Analysis pipeline), [`backend/app/api/routes`](https://github.com/lokeshlella/sentinelchain/tree/main/backend/app/api/routes) (REST API routes), [`frontend/src/App.jsx`](https://github.com/lokeshlella/sentinelchain/blob/main/frontend/src/App.jsx) (React application), [`frontend/src/api/client.js`](https://github.com/lokeshlella/sentinelchain/blob/main/frontend/src/api/client.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Developer interface"]
  node_webapp["React application<br/>[App.jsx]"]
  node_repository_page["Repository view<br/>[Repository.jsx]"]
  node_finding_page["Finding view<br/>[Finding.jsx]"]
  node_api_client["API client<br/>[client.js]"]
end

subgraph group_api["API and workflow"]
  node_api_routes["REST API routes"]
  node_analysis_pipeline["Analysis pipeline<br/>[pipeline.py]"]
end

subgraph group_analysis["Analysis stages"]
  node_repository_ingest["Repository ingestion<br/>[service.py]"]
  node_repository_profile["Repository profiling<br/>[analyzer.py]"]
  node_dependency_extract["Dependency extraction<br/>[service.py]"]
  node_usage_evidence["Usage evidence scan<br/>[usage.py]"]
  node_vulnerability_check["Vulnerability detection<br/>[service.py]"]
  node_knowledge_graph["Software knowledge graph<br/>[service.py]"]
  node_agent_analysis["Impact and risk agents<br/>[orchestrator.py]"]
end

subgraph group_remediation["Remediation stages"]
  node_remediation_service["Remediation proposal<br/>[service.py]"]
  node_sandbox_validation["Sandbox validation<br/>[service.py]"]
  node_evidence_report["Evidence report<br/>[service.py]"]
  node_github_pr["Draft pull request<br/>[service.py]"]
end

subgraph group_infra["Persistence and integrations"]
  node_llm_provider["Local LLM provider<br/>[ollama_provider.py]"]
  node_postgres[("PostgreSQL")]
  node_neo4j[("Neo4j")]
  node_osv["OSV.dev"]
  node_docker["Docker sandbox"]
  node_github["GitHub"]
end

node_developer(("Developer"))

node_developer -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_repository_page
node_webapp -->|"routes to"| node_finding_page
node_repository_page -->|"requests data"| node_api_client
node_finding_page -->|"requests data"| node_api_client
node_api_client -.->|"sends requests"| node_api_routes
node_api_routes -.->|"starts analysis"| node_analysis_pipeline
node_analysis_pipeline -->|"ingests repository"| node_repository_ingest
node_repository_ingest -->|"profiles structure"| node_repository_profile
node_analysis_pipeline -->|"extracts dependencies"| node_dependency_extract
node_analysis_pipeline -->|"scans usage"| node_usage_evidence
node_analysis_pipeline -->|"checks vulnerabilities"| node_vulnerability_check
node_vulnerability_check -->|"queries"| node_osv
node_analysis_pipeline -->|"populates graph"| node_knowledge_graph
node_knowledge_graph -->|"reads and writes"| node_neo4j
node_analysis_pipeline -->|"analyzes findings"| node_agent_analysis
node_agent_analysis -->|"requests reasoning"| node_llm_provider
node_llm_provider -.->|"queries"| node_osv
node_api_routes -.->|"requests remediation"| node_remediation_service
node_remediation_service -->|"validates change"| node_sandbox_validation
node_sandbox_validation -->|"runs checks"| node_docker
node_api_routes -.->|"requests report"| node_evidence_report
node_evidence_report -->|"reads records"| node_postgres
node_api_routes -.->|"requests draft PR"| node_github_pr
node_github_pr -->|"creates draft PR"| node_github

click node_webapp "https://github.com/lokeshlella/sentinelchain/blob/main/frontend/src/App.jsx"
click node_repository_page "https://github.com/lokeshlella/sentinelchain/blob/main/frontend/src/pages/Repository.jsx"
click node_finding_page "https://github.com/lokeshlella/sentinelchain/blob/main/frontend/src/pages/Finding.jsx"
click node_api_client "https://github.com/lokeshlella/sentinelchain/blob/main/frontend/src/api/client.js"
click node_api_routes "https://github.com/lokeshlella/sentinelchain/tree/main/backend/app/api/routes"
click node_analysis_pipeline "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/analysis/pipeline.py"
click node_repository_ingest "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/repository/service.py"
click node_repository_profile "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/repository/analyzer.py"
click node_dependency_extract "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/dependencies/service.py"
click node_usage_evidence "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/analysis/usage.py"
click node_vulnerability_check "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/vulnerabilities/service.py"
click node_knowledge_graph "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/knowledge_graph/service.py"
click node_agent_analysis "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/agents/orchestrator.py"
click node_llm_provider "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/llm/ollama_provider.py"
click node_remediation_service "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/remediation/service.py"
click node_sandbox_validation "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/sandbox/service.py"
click node_evidence_report "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/reports/service.py"
click node_github_pr "https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/github/service.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_webapp,node_repository_page,node_finding_page,node_api_client toneBlue
class node_api_routes,node_analysis_pipeline toneAmber
class node_repository_ingest,node_repository_profile,node_dependency_extract,node_usage_evidence,node_vulnerability_check,node_knowledge_graph,node_agent_analysis toneMint
class node_remediation_service,node_sandbox_validation,node_evidence_report,node_github_pr toneRose
class node_llm_provider,node_postgres,node_neo4j,node_osv,node_docker,node_github,node_developer toneIndigo
```

## Components

### Developer interface

- [React application](https://github.com/lokeshlella/sentinelchain/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Repository view](https://github.com/lokeshlella/sentinelchain/blob/main/frontend/src/pages/Repository.jsx): `frontend/src/pages/Repository.jsx`
- [Finding view](https://github.com/lokeshlella/sentinelchain/blob/main/frontend/src/pages/Finding.jsx): `frontend/src/pages/Finding.jsx`
- [API client](https://github.com/lokeshlella/sentinelchain/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### API and workflow

- [REST API routes](https://github.com/lokeshlella/sentinelchain/tree/main/backend/app/api/routes): `backend/app/api/routes`
- [Analysis pipeline](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/analysis/pipeline.py): `backend/app/services/analysis/pipeline.py`

### Analysis stages

- [Repository ingestion](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/repository/service.py): `backend/app/services/repository/service.py`
- [Repository profiling](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/repository/analyzer.py): `backend/app/services/repository/analyzer.py`
- [Dependency extraction](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/dependencies/service.py): `backend/app/services/dependencies/service.py`
- [Usage evidence scan](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/analysis/usage.py): `backend/app/services/analysis/usage.py`
- [Vulnerability detection](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/vulnerabilities/service.py): `backend/app/services/vulnerabilities/service.py`
- [Software knowledge graph](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/knowledge_graph/service.py): `backend/app/services/knowledge_graph/service.py`
- [Impact and risk agents](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/agents/orchestrator.py): `backend/app/services/agents/orchestrator.py`

### Remediation stages

- [Remediation proposal](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/remediation/service.py): `backend/app/services/remediation/service.py`
- [Sandbox validation](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/sandbox/service.py): `backend/app/services/sandbox/service.py`
- [Evidence report](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/reports/service.py): `backend/app/services/reports/service.py`
- [Draft pull request](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/github/service.py): `backend/app/services/github/service.py`

### Persistence and integrations

- [Local LLM provider](https://github.com/lokeshlella/sentinelchain/blob/main/backend/app/services/llm/ollama_provider.py): `backend/app/services/llm/ollama_provider.py`
- **PostgreSQL**
- **Neo4j**
- **OSV.dev**
- **Docker sandbox**
- **GitHub**

### Other components

- **Developer**

## Connections

- Developer → React application: uses (evidence: `frontend/src/App.jsx`)
- React application → Repository view: routes to (evidence: `frontend/src/App.jsx`)
- React application → Finding view: routes to (evidence: `frontend/src/App.jsx`)
- Repository view → API client: requests data (evidence: `frontend/src/pages/Repository.jsx`)
- Finding view → API client: requests data (evidence: `frontend/src/pages/Finding.jsx`)
- API client → REST API routes: sends requests
- REST API routes → Analysis pipeline: starts analysis
- Analysis pipeline → Repository ingestion: ingests repository (evidence: `backend/app/services/analysis/pipeline.py`)
- Repository ingestion → Repository profiling: profiles structure (evidence: `backend/app/services/repository/service.py`)
- Analysis pipeline → Dependency extraction: extracts dependencies (evidence: `backend/app/services/analysis/pipeline.py`)
- Analysis pipeline → Usage evidence scan: scans usage (evidence: `backend/app/services/analysis/pipeline.py`)
- Analysis pipeline → Vulnerability detection: checks vulnerabilities (evidence: `README.md`)
- Vulnerability detection → OSV.dev: queries (evidence: `backend/app/services/vulnerabilities/service.py`)
- Analysis pipeline → Software knowledge graph: populates graph (evidence: `backend/app/services/analysis/pipeline.py`)
- Software knowledge graph → Neo4j: reads and writes (evidence: `backend/app/services/knowledge_graph/service.py`)
- Analysis pipeline → Impact and risk agents: analyzes findings (evidence: `backend/app/services/analysis/pipeline.py`)
- Impact and risk agents → Local LLM provider: requests reasoning (evidence: `backend/app/services/agents/orchestrator.py`)
- Local LLM provider → OSV.dev: queries
- REST API routes → Remediation proposal: requests remediation
- Remediation proposal → Sandbox validation: validates change (evidence: `README.md`)
- Sandbox validation → Docker sandbox: runs checks (evidence: `backend/app/services/sandbox/service.py`)
- REST API routes → Evidence report: requests report
- Evidence report → PostgreSQL: reads records (evidence: `backend/app/services/reports/service.py`)
- REST API routes → Draft pull request: requests draft PR
- Draft pull request → GitHub: creates draft PR (evidence: `README.md`)
