# yosrisecops/cyberscore-tn-platform architecture

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

- Interactive diagram: https://gitdiagram.com/yosrisecops/cyberscore-tn-platform
- Repository: https://github.com/yosrisecops/cyberscore-tn-platform

## Overview

CyberScore TN is a sovereign cybersecurity scoring and threat-monitoring platform for Tunisian public and strategic-sector websites. The principal workflow is to submit a target for a quick, standard, deep, or autonomous audit; scanners gather findings, scoring produces a grade, and results support history, dashboards, and reports. Separate product branches cover authentication and accreditation, threat intelligence and forecasts, and Amina’s local-LLM assistance. The graph reflects documented capabilities; some frontend-to-backend and autonomous-agent wiring is not established by the excerpts, so those links are marked unverified.

Main entry points: [`probe_agent/orchestrator.py`](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/orchestrator.py) (Agent orchestrator), [`frontend/components/scanner/ScannerClient.tsx`](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/scanner/ScannerClient.tsx) (Scan interface), [`backend/app/routes/scan_routes.py`](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/routes/scan_routes.py) (Scan API), [`backend/app/scanners/orchestrator.py`](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/scanners/orchestrator.py) (Scan orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_scan_ui["Scan interface<br/>[ScannerClient.tsx]"]
  node_auth["Authentication and RBAC<br/>[auth_routes.py]"]
  node_assistant["Amina assistant<br/>[ai_routes.py]"]
  node_frontend_workflow["Agent workflow graph"]
end

subgraph group_core["Audit and scoring"]
  node_scan_api["Scan API<br/>[scan_routes.py]"]
  node_scanner_orch["Scan orchestrator<br/>[orchestrator.py]"]
  node_scanner_modules["Security scanners"]
  node_score_engine["Score engine<br/>[score_engine.py]"]
  node_scan_crud["Scan persistence<br/>[crud.py]"]
  node_database[("PostgreSQL")]
end

subgraph group_insight["Monitoring and reporting"]
  node_dashboard["Dashboard and CTI"]
  node_data_routes["Data API<br/>[data_routes.py]"]
  node_forecast["Score predictions"]
  node_threat_view["Threat observatory<br/>[ThreatWorldMap.tsx]"]
  node_badge_view["Accreditation badges<br/>[BadgesClient.tsx]"]
  node_report["Official PDF reports"]
  node_report_modal["Report preview modal"]
end

subgraph group_autonomous["Autonomous audit"]
  node_probe_orch["Agent orchestrator<br/>[orchestrator.py]"]
  node_recon["Network reconnaissance<br/>[recon_agent.py]"]
  node_cve["Vulnerability analysis<br/>[cve_agent.py]"]
  node_poc["PoC verification<br/>[poc_agent.py]"]
  node_remediation["Remediation and sealing"]
  node_probe_ai["Probe AI client<br/>[ai_client.py]"]
end

node_official(("Auditor or official"))
node_ollama{{"Local Ollama LLM"}}

node_official -->|"submits target"| node_scan_ui
node_scan_ui -.->|"requests audit"| node_scan_api
node_scan_api -->|"runs scan"| node_scanner_orch
node_scanner_orch -->|"dispatches scanners"| node_scanner_modules
node_scanner_orch -->|"scores findings"| node_score_engine
node_scan_api -->|"persists results"| node_scan_crud
node_scan_crud -.->|"writes records"| node_database
node_official -->|"authenticates"| node_auth
node_official -->|"views posture"| node_dashboard
node_official -.->|"requests platform data"| node_data_routes
node_official -->|"views projections"| node_forecast
node_official -->|"views threats"| node_threat_view
node_official -->|"views badges"| node_badge_view
node_official -->|"generates report"| node_report
node_official -->|"asks for guidance"| node_assistant
node_assistant -->|"queries locally"| node_ollama
node_official -.->|"requests autonomous audit"| node_probe_orch
node_probe_orch -->|"runs reconnaissance"| node_recon
node_probe_orch -->|"runs analysis"| node_cve
node_probe_orch -->|"runs verification"| node_poc
node_probe_orch -->|"runs remediation"| node_remediation
node_cve -->|"requests analysis"| node_probe_ai
node_remediation -->|"requests roadmap"| node_probe_ai
node_probe_ai -->|"queries model"| node_ollama
node_scan_ui -->|"renders workflow"| node_frontend_workflow
node_report -.->|"previews report"| node_report_modal
node_frontend_workflow -.->|"supports audit view"| node_scan_ui
node_report_modal -->|"uses generator"| node_report

click node_scan_ui "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/scanner/ScannerClient.tsx"
click node_scan_api "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/routes/scan_routes.py"
click node_scanner_orch "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/scanners/orchestrator.py"
click node_scanner_modules "https://github.com/yosrisecops/cyberscore-tn-platform/tree/main/backend/app/scanners"
click node_score_engine "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/scanners/score_engine.py"
click node_scan_crud "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/crud.py"
click node_auth "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/routes/auth_routes.py"
click node_dashboard "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/routes/dashboard_routes.py"
click node_data_routes "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/routes/data_routes.py"
click node_forecast "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/predictions/PredictionsClient.tsx"
click node_threat_view "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/threats/ThreatWorldMap.tsx"
click node_badge_view "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/badges/BadgesClient.tsx"
click node_report "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/report/ReportGenerator.tsx"
click node_assistant "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/routes/ai_routes.py"
click node_probe_orch "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/orchestrator.py"
click node_recon "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/agents/recon_agent.py"
click node_cve "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/agents/cve_agent.py"
click node_poc "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/agents/poc_agent.py"
click node_remediation "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/agents/remediation_agent.py"
click node_probe_ai "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/ai_client.py"
click node_frontend_workflow "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/scanner/AgentWorkflowGraph.tsx"
click node_report_modal "https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/report/ReportPreviewModal.tsx"

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_scan_ui,node_auth,node_assistant,node_frontend_workflow toneBlue
class node_scan_api,node_scanner_orch,node_scanner_modules,node_score_engine,node_scan_crud,node_database toneAmber
class node_dashboard,node_data_routes,node_forecast,node_threat_view,node_badge_view,node_report,node_report_modal toneMint
class node_probe_orch,node_recon,node_cve,node_poc,node_remediation,node_probe_ai toneRose
class node_official,node_ollama toneIndigo
```

## Components

### User experience

- [Scan interface](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/scanner/ScannerClient.tsx): `frontend/components/scanner/ScannerClient.tsx`
- [Authentication and RBAC](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/routes/auth_routes.py): `backend/app/routes/auth_routes.py`
- [Amina assistant](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/routes/ai_routes.py): `backend/app/routes/ai_routes.py`
- [Agent workflow graph](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/scanner/AgentWorkflowGraph.tsx): `frontend/components/scanner/AgentWorkflowGraph.tsx`

### Audit and scoring

- [Scan API](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/routes/scan_routes.py): `backend/app/routes/scan_routes.py`
- [Scan orchestrator](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/scanners/orchestrator.py): `backend/app/scanners/orchestrator.py`
- [Security scanners](https://github.com/yosrisecops/cyberscore-tn-platform/tree/main/backend/app/scanners): `backend/app/scanners`
- [Score engine](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/scanners/score_engine.py): `backend/app/scanners/score_engine.py`
- [Scan persistence](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/crud.py): `backend/app/crud.py`
- **PostgreSQL**

### Monitoring and reporting

- [Dashboard and CTI](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/routes/dashboard_routes.py): `backend/app/routes/dashboard_routes.py`
- [Data API](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/backend/app/routes/data_routes.py): `backend/app/routes/data_routes.py`
- [Score predictions](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/predictions/PredictionsClient.tsx): `frontend/components/predictions/PredictionsClient.tsx`
- [Threat observatory](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/threats/ThreatWorldMap.tsx): `frontend/components/threats/ThreatWorldMap.tsx`
- [Accreditation badges](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/badges/BadgesClient.tsx): `frontend/components/badges/BadgesClient.tsx`
- [Official PDF reports](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/report/ReportGenerator.tsx): `frontend/components/report/ReportGenerator.tsx`
- [Report preview modal](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/frontend/components/report/ReportPreviewModal.tsx): `frontend/components/report/ReportPreviewModal.tsx`

### Autonomous audit

- [Agent orchestrator](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/orchestrator.py): `probe_agent/orchestrator.py`
- [Network reconnaissance](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/agents/recon_agent.py): `probe_agent/agents/recon_agent.py`
- [Vulnerability analysis](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/agents/cve_agent.py): `probe_agent/agents/cve_agent.py`
- [PoC verification](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/agents/poc_agent.py): `probe_agent/agents/poc_agent.py`
- [Remediation and sealing](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/agents/remediation_agent.py): `probe_agent/agents/remediation_agent.py`
- [Probe AI client](https://github.com/yosrisecops/cyberscore-tn-platform/blob/main/probe_agent/ai_client.py): `probe_agent/ai_client.py`

### Other components

- **Auditor or official**
- **Local Ollama LLM**

## Connections

- Auditor or official → Scan interface: submits target
- Scan interface → Scan API: requests audit
- Scan API → Scan orchestrator: runs scan (evidence: `backend/app/routes/scan_routes.py`)
- Scan orchestrator → Security scanners: dispatches scanners (evidence: `backend/app/scanners/orchestrator.py`)
- Scan orchestrator → Score engine: scores findings (evidence: `backend/app/scanners/orchestrator.py`)
- Scan API → Scan persistence: persists results (evidence: `backend/app/routes/scan_routes.py`)
- Scan persistence → PostgreSQL: writes records
- Auditor or official → Authentication and RBAC: authenticates (evidence: `backend/app/routes/auth_routes.py`)
- Auditor or official → Dashboard and CTI: views posture
- Auditor or official → Data API: requests platform data
- Auditor or official → Score predictions: views projections
- Auditor or official → Threat observatory: views threats
- Auditor or official → Accreditation badges: views badges
- Auditor or official → Official PDF reports: generates report
- Auditor or official → Amina assistant: asks for guidance
- Amina assistant → Local Ollama LLM: queries locally (evidence: `backend/app/routes/ai_routes.py`)
- Auditor or official → Agent orchestrator: requests autonomous audit
- Agent orchestrator → Network reconnaissance: runs reconnaissance (evidence: `probe_agent/orchestrator.py`)
- Agent orchestrator → Vulnerability analysis: runs analysis (evidence: `probe_agent/orchestrator.py`)
- Agent orchestrator → PoC verification: runs verification (evidence: `probe_agent/orchestrator.py`)
- Agent orchestrator → Remediation and sealing: runs remediation (evidence: `probe_agent/orchestrator.py`)
- Vulnerability analysis → Probe AI client: requests analysis (evidence: `probe_agent/agents/cve_agent.py`)
- Remediation and sealing → Probe AI client: requests roadmap (evidence: `probe_agent/agents/remediation_agent.py`)
- Probe AI client → Local Ollama LLM: queries model (evidence: `probe_agent/ai_client.py`)
- Scan interface → Agent workflow graph: renders workflow (evidence: `frontend/components/scanner/ScannerClient.tsx`)
- Official PDF reports → Report preview modal: previews report (evidence: `frontend/components/report/ReportPreviewModal.tsx`)
- Agent workflow graph → Scan interface: supports audit view (evidence: `frontend/components/scanner/ScannerClient.tsx`)
- Report preview modal → Official PDF reports: uses generator (evidence: `frontend/components/report/ReportPreviewModal.tsx`)
