# kashyapharshit/cybersi architecture

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

- Interactive diagram: https://gitdiagram.com/kashyapharshit/cybersi
- Repository: https://github.com/kashyapharshit/cybersi

## Overview

CYBERSI is a security intelligence and risk-management platform. Security evidence is ingested and normalized by the Node backend, persisted in MongoDB, analyzed for asset and portfolio risk by the FastAPI intelligence service, and presented in role-based workspaces. The platform also supports analyst queries, control-investment optimization, regulatory coverage, and audit integrity. The graph follows documented system boundaries and sampled call paths; several domain subsystems are represented at their existing directories because their implementations were not sampled.

Main entry points: [`attack_on_point_backend_hardened/src/app.js`](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/app.js) (HTTP API), [`attack_on_point_ai_fastapi_hardened/app/main.py`](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_ai_fastapi_hardened/app/main.py) (FastAPI engine), [`attack_on_point_backend_hardened/src/services/ingestion.service.js`](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/services/ingestion.service.js) (Evidence ingestion), [`attack_on_point_backend_hardened/src/models`](https://github.com/kashyapharshit/cybersi/tree/main/attack_on_point_backend_hardened/src/models) (Evidence store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_frontend["Role workspaces<br/>[App.jsx]"]
  node_frontend_api["API client<br/>[api.js]"]
end

subgraph group_backend["Evidence backend"]
  node_backend_app["HTTP API<br/>[app.js]"]
  node_ingestion["Evidence ingestion"]
  node_parsers["Source adapters"]
  node_domain_services["Domain services"]
  node_ingestion_jobs[("Ingestion jobs<br/>[IngestionJob.js]")]
  node_evidence_store[("Evidence store")]
  node_coverage["Regulatory coverage"]
end

subgraph group_intelligence["Risk intelligence"]
  node_ai_routes["Analysis endpoints<br/>[ai.routes.js]"]
  node_ai_controller["AI result handling<br/>[ai.controller.js]"]
  node_ai_trigger["Analysis trigger"]
  node_ai_engine["FastAPI engine<br/>[main.py]"]
  node_backend_client["Backend connector<br/>[backend_client.py]"]
  node_math_engine["Risk calculations<br/>[math_engine.py]"]
  node_optimizer["Control optimizer<br/>[optimizer.py]"]
  node_llm["Analyst copilot<br/>[llm.py]"]
  node_analyst_service["Query forwarding"]
end

subgraph group_integrity["Audit integrity"]
  node_audit["Audit and anchoring"]
  node_audit_records[("Risk audit records<br/>[RiskAudit.js]")]
end

node_user(("Platform users"))
node_mongo[("MongoDB")]
node_security_sources(("Security sources"))
node_ollama["Ollama"]
node_chain["Blockchain network"]

node_user -->|"uses"| node_frontend
node_frontend -->|"requests data"| node_frontend_api
node_frontend_api -->|"calls API"| node_backend_app
node_security_sources -->|"supplies evidence"| node_ingestion
node_ingestion -->|"parses findings"| node_parsers
node_ingestion -->|"records job"| node_ingestion_jobs
node_ingestion -->|"stores evidence"| node_evidence_store
node_backend_app -->|"dispatches requests"| node_ai_routes
node_ai_routes -->|"triggers analysis"| node_ai_trigger
node_ai_routes -->|"handles results"| node_ai_controller
node_ai_trigger -->|"requests analysis"| node_ai_engine
node_ai_engine -->|"fetches and submits"| node_backend_client
node_backend_client -->|"exchanges payloads"| node_backend_app
node_ai_engine -->|"calculates risk"| node_math_engine
node_ai_engine -->|"optimizes controls"| node_optimizer
node_ai_engine -->|"generates summaries"| node_llm
node_llm -.->|"queries model"| node_ollama
node_backend_app -->|"dispatches query"| node_analyst_service
node_analyst_service -->|"forwards query"| node_ai_engine
node_backend_app -->|"dispatches domain work"| node_domain_services
node_domain_services -->|"reads and writes"| node_evidence_store
node_coverage -->|"reads evidence"| node_evidence_store
node_backend_app -->|"verifies reports"| node_audit
node_audit -->|"reads audit records"| node_audit_records
node_audit -->|"anchors hashes"| node_chain
node_audit_records -->|"persists records"| node_mongo
node_evidence_store -->|"persists evidence"| node_mongo
node_ingestion_jobs -->|"persists jobs"| node_mongo

click node_frontend "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_frontend_redesigned/src/App.jsx"
click node_frontend_api "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_frontend_redesigned/src/api.js"
click node_backend_app "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/app.js"
click node_ingestion "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/services/ingestion.service.js"
click node_parsers "https://github.com/kashyapharshit/cybersi/tree/main/attack_on_point_backend_hardened/src/parsers"
click node_domain_services "https://github.com/kashyapharshit/cybersi/tree/main/attack_on_point_backend_hardened/src/services"
click node_ingestion_jobs "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/models/IngestionJob.js"
click node_evidence_store "https://github.com/kashyapharshit/cybersi/tree/main/attack_on_point_backend_hardened/src/models"
click node_ai_routes "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/routes/ai.routes.js"
click node_ai_controller "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/controllers/ai.controller.js"
click node_ai_trigger "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/services/aiTrigger.service.js"
click node_ai_engine "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_ai_fastapi_hardened/app/main.py"
click node_backend_client "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_ai_fastapi_hardened/app/backend_client.py"
click node_math_engine "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_ai_fastapi_hardened/app/math_engine.py"
click node_optimizer "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_ai_fastapi_hardened/app/optimizer.py"
click node_llm "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_ai_fastapi_hardened/app/llm.py"
click node_analyst_service "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/services/analystQuery.service.js"
click node_coverage "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/services/regulatoryCoverage.service.js"
click node_audit "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/services/blockchain.service.js"
click node_audit_records "https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/models/RiskAudit.js"

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_frontend,node_frontend_api,node_user toneBlue
class node_backend_app,node_ingestion,node_parsers,node_domain_services,node_ingestion_jobs,node_evidence_store,node_coverage,node_mongo toneAmber
class node_ai_routes,node_ai_controller,node_ai_trigger,node_ai_engine,node_backend_client,node_math_engine,node_optimizer,node_llm,node_analyst_service toneMint
class node_audit,node_audit_records toneRose
class node_security_sources,node_ollama,node_chain toneIndigo
```

## Components

### User experience

- [Role workspaces](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_frontend_redesigned/src/App.jsx): `attack_on_point_frontend_redesigned/src/App.jsx`
- [API client](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_frontend_redesigned/src/api.js): `attack_on_point_frontend_redesigned/src/api.js`

### Evidence backend

- [HTTP API](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/app.js): `attack_on_point_backend_hardened/src/app.js`
- [Evidence ingestion](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/services/ingestion.service.js): `attack_on_point_backend_hardened/src/services/ingestion.service.js`
- [Source adapters](https://github.com/kashyapharshit/cybersi/tree/main/attack_on_point_backend_hardened/src/parsers): `attack_on_point_backend_hardened/src/parsers`
- [Domain services](https://github.com/kashyapharshit/cybersi/tree/main/attack_on_point_backend_hardened/src/services): `attack_on_point_backend_hardened/src/services`
- [Ingestion jobs](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/models/IngestionJob.js): `attack_on_point_backend_hardened/src/models/IngestionJob.js`
- [Evidence store](https://github.com/kashyapharshit/cybersi/tree/main/attack_on_point_backend_hardened/src/models): `attack_on_point_backend_hardened/src/models`
- [Regulatory coverage](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/services/regulatoryCoverage.service.js): `attack_on_point_backend_hardened/src/services/regulatoryCoverage.service.js`

### Risk intelligence

- [Analysis endpoints](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/routes/ai.routes.js): `attack_on_point_backend_hardened/src/routes/ai.routes.js`
- [AI result handling](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/controllers/ai.controller.js): `attack_on_point_backend_hardened/src/controllers/ai.controller.js`
- [Analysis trigger](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/services/aiTrigger.service.js): `attack_on_point_backend_hardened/src/services/aiTrigger.service.js`
- [FastAPI engine](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_ai_fastapi_hardened/app/main.py): `attack_on_point_ai_fastapi_hardened/app/main.py`
- [Backend connector](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_ai_fastapi_hardened/app/backend_client.py): `attack_on_point_ai_fastapi_hardened/app/backend_client.py`
- [Risk calculations](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_ai_fastapi_hardened/app/math_engine.py): `attack_on_point_ai_fastapi_hardened/app/math_engine.py`
- [Control optimizer](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_ai_fastapi_hardened/app/optimizer.py): `attack_on_point_ai_fastapi_hardened/app/optimizer.py`
- [Analyst copilot](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_ai_fastapi_hardened/app/llm.py): `attack_on_point_ai_fastapi_hardened/app/llm.py`
- [Query forwarding](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/services/analystQuery.service.js): `attack_on_point_backend_hardened/src/services/analystQuery.service.js`

### Audit integrity

- [Audit and anchoring](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/services/blockchain.service.js): `attack_on_point_backend_hardened/src/services/blockchain.service.js`
- [Risk audit records](https://github.com/kashyapharshit/cybersi/blob/main/attack_on_point_backend_hardened/src/models/RiskAudit.js): `attack_on_point_backend_hardened/src/models/RiskAudit.js`

### Other components

- **Platform users**
- **MongoDB**
- **Security sources**
- **Ollama**
- **Blockchain network**

## Connections

- Platform users → Role workspaces: uses
- Role workspaces → API client: requests data
- API client → HTTP API: calls API
- Security sources → Evidence ingestion: supplies evidence
- Evidence ingestion → Source adapters: parses findings
- Evidence ingestion → Ingestion jobs: records job
- Evidence ingestion → Evidence store: stores evidence
- HTTP API → Analysis endpoints: dispatches requests
- Analysis endpoints → Analysis trigger: triggers analysis
- Analysis endpoints → AI result handling: handles results
- Analysis trigger → FastAPI engine: requests analysis
- FastAPI engine → Backend connector: fetches and submits
- Backend connector → HTTP API: exchanges payloads
- FastAPI engine → Risk calculations: calculates risk
- FastAPI engine → Control optimizer: optimizes controls
- FastAPI engine → Analyst copilot: generates summaries
- Analyst copilot → Ollama: queries model
- HTTP API → Query forwarding: dispatches query
- Query forwarding → FastAPI engine: forwards query
- HTTP API → Domain services: dispatches domain work
- Domain services → Evidence store: reads and writes
- Regulatory coverage → Evidence store: reads evidence
- HTTP API → Audit and anchoring: verifies reports
- Audit and anchoring → Risk audit records: reads audit records
- Audit and anchoring → Blockchain network: anchors hashes
- Risk audit records → MongoDB: persists records
- Evidence store → MongoDB: persists evidence
- Ingestion jobs → MongoDB: persists jobs
