# nishchaygaur/sentinelx architecture

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

- Interactive diagram: https://gitdiagram.com/nishchaygaur/sentinelx
- Repository: https://github.com/nishchaygaur/sentinelx

## Overview

SentinelX is a SOC and threat-intelligence platform. Its main workflow accepts security telemetry, validates and normalizes it, detects threats, enriches alerts, and supports incident investigation and response through a React SOC interface. The README also describes dashboards, MITRE ATT&CK views, AI investigation, simulated response actions, and PDF reports. Edges below are limited to relationships visible in the excerpts, SOURCE INDEX references, or README; unsampled capability links are documented but not inferred.

Main entry points: [`backend/src/config/db.js`](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/config/db.js) (PostgreSQL), [`backend/src/detection/detectionRules.js`](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/detection/detectionRules.js) (Detection Rules), [`backend/src/controllers/ingestionController.js`](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/ingestionController.js) (Ingestion Controller), [`frontend/src/App.jsx`](https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/App.jsx) (SOC Web Application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Telemetry Ingestion"]
  node_ingest["Ingestion Controller"]
  node_validator["Log Validator<br/>[logValidator.js]"]
  node_normalizer["Log Normalizer<br/>[logNormalizer.js]"]
end

subgraph group_detection["Detection And Enrichment"]
  node_rules["Detection Rules<br/>[detectionRules.js]"]
  node_risk["Risk Scoring"]
  node_threatintel["Threat Intelligence"]
  node_mitre["MITRE ATT&amp;CK<br/>[mitreService.js]"]
end

subgraph group_operations["Incident Operations"]
  node_api["Express API<br/>[app.js]"]
  node_database[("PostgreSQL<br/>[db.js]")]
  node_incidents["Incident Lifecycle"]
  node_alerts["Alerts<br/>[alertController.js]"]
  node_response["Response Actions"]
  node_dashboard["SOC Dashboard Metrics"]
  node_random_incidents["Simulated Incidents"]
end

subgraph group_intelligence["Investigation And Reporting"]
  node_ai_controller["AI Investigation API<br/>[aiController.js]"]
  node_ai_service["AI Analysis<br/>[aiService.js]"]
  node_copilot_service["AI Copilot And Swarm"]
  node_reports["PDF Report API"]
  node_pdf["PDF Report Generation"]
end

subgraph group_experience["SOC Experience"]
  node_frontend["SOC Web Application<br/>[App.jsx]"]
  node_copilot_ui["Copilot Interface<br/>[AICopilot.jsx]"]
  node_mitre_ui["MITRE Heatmap<br/>[MitreHeatmap.jsx]"]
  node_docs_ui["Documentation Viewer<br/>[DocsViewer.jsx]"]
  node_docs_data["Documentation Content<br/>[docsData.js]"]
  node_select["Custom Select<br/>[Select.jsx]"]
end

node_shipper(("Log Shippers<br/>[linux_collector.py]"))
node_ai_provider{{"OpenRouter"}}

node_shipper -->|"sends logs"| node_ingest
node_frontend -->|"uses REST API"| node_api
node_api -->|"routes ingestion"| node_ingest
node_ingest -->|"validates logs"| node_validator
node_ingest -->|"normalizes logs"| node_normalizer
node_ingest -->|"writes raw and normalized logs"| node_database
node_ingest -->|"runs detection"| node_rules
node_rules -->|"reads and writes detections"| node_database
node_rules -->|"uses scoring"| node_risk
node_rules -->|"enriches alerts"| node_threatintel
node_rules -->|"maps techniques"| node_mitre
node_rules -.->|"creates incidents"| node_incidents
node_incidents -->|"stores lifecycle"| node_database
node_incidents -->|"requests simulation"| node_random_incidents
node_alerts -->|"queries alerts"| node_database
node_response -->|"records actions"| node_database
node_dashboard -.->|"queries metrics"| node_database
node_api -->|"routes AI requests"| node_ai_controller
node_ai_controller -->|"analyzes alerts"| node_ai_service
node_ai_controller -->|"delegates chat and swarm"| node_copilot_service
node_ai_controller -->|"loads and saves analysis"| node_database
node_ai_service -.->|"requests AI completion"| node_ai_provider
node_copilot_service -.->|"requests AI investigation"| node_ai_provider
node_api -->|"routes report requests"| node_reports
node_reports -->|"generates PDFs"| node_pdf
node_reports -->|"loads report data"| node_database
node_frontend -->|"renders copilot"| node_copilot_ui
node_frontend -->|"renders heatmap"| node_mitre_ui
node_frontend -->|"renders documentation"| node_docs_ui
node_docs_ui -->|"loads content"| node_docs_data
node_frontend -->|"uses control"| node_select
node_copilot_ui -->|"uses control"| node_select
node_mitre_ui -->|"uses control"| node_select

click node_shipper "https://github.com/nishchaygaur/sentinelx/blob/main/scripts/linux_collector.py"
click node_api "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/app.js"
click node_ingest "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/ingestionController.js"
click node_validator "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/ingestion/logValidator.js"
click node_normalizer "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/ingestion/logNormalizer.js"
click node_database "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/config/db.js"
click node_rules "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/detection/detectionRules.js"
click node_risk "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/riskScoringService.js"
click node_threatintel "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/threatIntelService.js"
click node_mitre "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/mitreService.js"
click node_incidents "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/incidentController.js"
click node_alerts "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/alertController.js"
click node_response "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/responseActionController.js"
click node_dashboard "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/dashboardController.js"
click node_ai_controller "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/aiController.js"
click node_ai_service "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/aiService.js"
click node_copilot_service "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/aiCopilotService.js"
click node_reports "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/reportController.js"
click node_pdf "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/pdfReportService.js"
click node_random_incidents "https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/randomIncidentService.js"
click node_frontend "https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/App.jsx"
click node_copilot_ui "https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/components/AICopilot.jsx"
click node_mitre_ui "https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/components/MitreHeatmap.jsx"
click node_docs_ui "https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/components/DocsViewer.jsx"
click node_docs_data "https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/docsData.js"
click node_select "https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/components/Select.jsx"

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_ingest,node_validator,node_normalizer toneBlue
class node_rules,node_risk,node_threatintel,node_mitre toneAmber
class node_api,node_database,node_incidents,node_alerts,node_response,node_dashboard,node_random_incidents,node_ai_provider toneMint
class node_ai_controller,node_ai_service,node_copilot_service,node_reports,node_pdf toneRose
class node_frontend,node_copilot_ui,node_mitre_ui,node_docs_ui,node_docs_data,node_select toneIndigo
class node_shipper toneTeal
```

## Components

### Telemetry Ingestion

- [Ingestion Controller](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/ingestionController.js): `backend/src/controllers/ingestionController.js`
- [Log Validator](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/ingestion/logValidator.js): `backend/src/ingestion/logValidator.js`
- [Log Normalizer](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/ingestion/logNormalizer.js): `backend/src/ingestion/logNormalizer.js`

### Detection And Enrichment

- [Detection Rules](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/detection/detectionRules.js): `backend/src/detection/detectionRules.js`
- [Risk Scoring](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/riskScoringService.js): `backend/src/services/riskScoringService.js`
- [Threat Intelligence](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/threatIntelService.js): `backend/src/services/threatIntelService.js`
- [MITRE ATT&CK](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/mitreService.js): `backend/src/services/mitreService.js`

### Incident Operations

- [Express API](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/app.js): `backend/src/app.js`
- [PostgreSQL](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- [Incident Lifecycle](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/incidentController.js): `backend/src/controllers/incidentController.js`
- [Alerts](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/alertController.js): `backend/src/controllers/alertController.js`
- [Response Actions](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/responseActionController.js): `backend/src/controllers/responseActionController.js`
- [SOC Dashboard Metrics](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/dashboardController.js): `backend/src/controllers/dashboardController.js`
- [Simulated Incidents](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/randomIncidentService.js): `backend/src/services/randomIncidentService.js`

### Investigation And Reporting

- [AI Investigation API](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/aiController.js): `backend/src/controllers/aiController.js`
- [AI Analysis](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/aiService.js): `backend/src/services/aiService.js`
- [AI Copilot And Swarm](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/aiCopilotService.js): `backend/src/services/aiCopilotService.js`
- [PDF Report API](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/controllers/reportController.js): `backend/src/controllers/reportController.js`
- [PDF Report Generation](https://github.com/nishchaygaur/sentinelx/blob/main/backend/src/services/pdfReportService.js): `backend/src/services/pdfReportService.js`

### SOC Experience

- [SOC Web Application](https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Copilot Interface](https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/components/AICopilot.jsx): `frontend/src/components/AICopilot.jsx`
- [MITRE Heatmap](https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/components/MitreHeatmap.jsx): `frontend/src/components/MitreHeatmap.jsx`
- [Documentation Viewer](https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/components/DocsViewer.jsx): `frontend/src/components/DocsViewer.jsx`
- [Documentation Content](https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/docsData.js): `frontend/src/docsData.js`
- [Custom Select](https://github.com/nishchaygaur/sentinelx/blob/main/frontend/src/components/Select.jsx): `frontend/src/components/Select.jsx`

### Other components

- [Log Shippers](https://github.com/nishchaygaur/sentinelx/blob/main/scripts/linux_collector.py): `scripts/linux_collector.py`
- **OpenRouter**

## Connections

- Log Shippers → Ingestion Controller: sends logs
- SOC Web Application → Express API: uses REST API
- Express API → Ingestion Controller: routes ingestion (evidence: `backend/src/app.js`)
- Ingestion Controller → Log Validator: validates logs (evidence: `backend/src/controllers/ingestionController.js`)
- Ingestion Controller → Log Normalizer: normalizes logs (evidence: `backend/src/controllers/ingestionController.js`)
- Ingestion Controller → PostgreSQL: writes raw and normalized logs (evidence: `backend/src/controllers/ingestionController.js`)
- Ingestion Controller → Detection Rules: runs detection (evidence: `backend/src/controllers/ingestionController.js`)
- Detection Rules → PostgreSQL: reads and writes detections (evidence: `backend/src/detection/detectionRules.js`)
- Detection Rules → Risk Scoring: uses scoring (evidence: `backend/src/detection/detectionRules.js`)
- Detection Rules → Threat Intelligence: enriches alerts (evidence: `backend/src/detection/detectionRules.js`)
- Detection Rules → MITRE ATT&CK: maps techniques (evidence: `backend/src/detection/detectionRules.js`)
- Detection Rules → Incident Lifecycle: creates incidents (evidence: `backend/src/detection/detectionRules.js`)
- Incident Lifecycle → PostgreSQL: stores lifecycle (evidence: `backend/src/controllers/incidentController.js`)
- Incident Lifecycle → Simulated Incidents: requests simulation (evidence: `backend/src/controllers/incidentController.js`)
- Alerts → PostgreSQL: queries alerts (evidence: `backend/src/controllers/alertController.js`)
- Response Actions → PostgreSQL: records actions (evidence: `backend/src/controllers/responseActionController.js`)
- SOC Dashboard Metrics → PostgreSQL: queries metrics
- Express API → AI Investigation API: routes AI requests (evidence: `backend/src/app.js`)
- AI Investigation API → AI Analysis: analyzes alerts (evidence: `backend/src/controllers/aiController.js`)
- AI Investigation API → AI Copilot And Swarm: delegates chat and swarm (evidence: `backend/src/controllers/aiController.js`)
- AI Investigation API → PostgreSQL: loads and saves analysis (evidence: `backend/src/controllers/aiController.js`)
- AI Analysis → OpenRouter: requests AI completion
- AI Copilot And Swarm → OpenRouter: requests AI investigation
- Express API → PDF Report API: routes report requests (evidence: `backend/src/app.js`)
- PDF Report API → PDF Report Generation: generates PDFs (evidence: `backend/src/controllers/reportController.js`)
- PDF Report API → PostgreSQL: loads report data (evidence: `backend/src/controllers/reportController.js`)
- SOC Web Application → Copilot Interface: renders copilot (evidence: `frontend/src/App.jsx`)
- SOC Web Application → MITRE Heatmap: renders heatmap (evidence: `frontend/src/App.jsx`)
- SOC Web Application → Documentation Viewer: renders documentation (evidence: `frontend/src/App.jsx`)
- Documentation Viewer → Documentation Content: loads content (evidence: `frontend/src/components/DocsViewer.jsx`)
- SOC Web Application → Custom Select: uses control (evidence: `frontend/src/App.jsx`)
- Copilot Interface → Custom Select: uses control (evidence: `frontend/src/components/AICopilot.jsx`)
- MITRE Heatmap → Custom Select: uses control (evidence: `frontend/src/components/MitreHeatmap.jsx`)
