# asiedudevelopmenthub/sentracore architecture

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

- Interactive diagram: https://gitdiagram.com/asiedudevelopmenthub/sentracore
- Repository: https://github.com/asiedudevelopmenthub/sentracore

## Overview

SentraCore is a local system-behavior monitoring and intelligence platform. Its main workflow is continuous telemetry collection, normalization and behavioral analysis, with results exposed to a desktop dashboard through REST and WebSockets. The engine also provides historical monitoring, alerts and a read-only-preview-then-cleanup storage workflow. The README documents dashboard/API interaction and major intelligence capabilities; sampled source clarifies several engine and cleanup calls, but the Flutter application source and some runtime wiring are not present in the supplied tree or excerpts.

Main entry points: [`engine/main.py`](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/main.py) (Engine orchestrator), [`engine/api/server.py`](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/api/server.py) (REST and WebSocket API), [`dashboard/windows/runner/flutter_window.cpp`](https://github.com/asiedudevelopmenthub/sentracore/blob/main/dashboard/windows/runner/flutter_window.cpp) (Flutter dashboard), [`engine/collector/system_collector.py`](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/collector/system_collector.py) (Telemetry collector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_dashboard["Flutter dashboard<br/>[flutter_window.cpp]"]
end

subgraph group_runtime["Monitoring runtime"]
  node_engine["Engine orchestrator<br/>[main.py]"]
  node_collector["Telemetry collector"]
  node_normalizer["Signal normalizer<br/>[normalizer.py]"]
  node_buffer["Time-series buffer"]
  node_processes["Process tracker<br/>[process_tracker.py]"]
end

subgraph group_intelligence["Behavioral intelligence"]
  node_baseline["Adaptive baseline<br/>[baseline_model.py]"]
  node_anomaly["Anomaly detection"]
  node_stress["Stress scoring<br/>[stress_engine.py]"]
  node_trends["Trend analysis<br/>[trend_analyzer.py]"]
  node_prediction["Pressure forecasting"]
  node_correlation["Root cause analysis"]
  node_stability["Stability index<br/>[stability_index.py]"]
end

subgraph group_services["API and services"]
  node_events["Event logbook<br/>[event_logger.py]"]
  node_history[("History archive<br/>[history_store.py]")]
  node_alerts["Alert manager<br/>[alert_manager.py]"]
  node_api["REST and WebSocket API<br/>[server.py]"]
  node_hardware["Hardware diagnostics<br/>[__init__.py]"]
  node_cleanup_api["Cleanup endpoints<br/>[server.py]"]
  node_scanner["Storage scanner<br/>[scanner.py]"]
  node_cleaner["Storage cleanup<br/>[cleaner.py]"]
  node_storage[("Local datastore<br/>[paths.py]")]
end

node_user(("Desktop user"))
node_system{{"Host system"}}

node_user -->|"uses"| node_dashboard
node_dashboard -->|"requests state"| node_api
node_api -->|"streams updates"| node_dashboard
node_engine -->|"collects telemetry"| node_collector
node_collector -->|"reads metrics"| node_system
node_engine -->|"normalizes snapshots"| node_normalizer
node_engine -->|"buffers samples"| node_buffer
node_engine -->|"learns behavior"| node_baseline
node_engine -->|"detects deviations"| node_anomaly
node_engine -->|"scores pressure"| node_stress
node_engine -->|"tracks processes"| node_processes
node_engine -->|"analyzes trends"| node_trends
node_engine -->|"estimates risk"| node_prediction
node_engine -->|"explains causes"| node_correlation
node_engine -->|"computes stability"| node_stability
node_engine -->|"records events"| node_events
node_engine -->|"archives samples"| node_history
node_engine -->|"generates alerts"| node_alerts
node_engine -->|"starts API"| node_api
node_api -->|"queries diagnostics"| node_hardware
node_api -->|"serves cleanup"| node_cleanup_api
node_cleanup_api -->|"runs preview scan"| node_scanner
node_cleanup_api -->|"applies cleanup"| node_cleaner
node_engine -->|"initializes layout"| node_storage
node_history -.->|"persists history"| node_storage

click node_dashboard "https://github.com/asiedudevelopmenthub/sentracore/blob/main/dashboard/windows/runner/flutter_window.cpp"
click node_engine "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/main.py"
click node_collector "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/collector/system_collector.py"
click node_normalizer "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/normalization/normalizer.py"
click node_buffer "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/buffer/time_series_buffer.py"
click node_processes "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/process/process_tracker.py"
click node_baseline "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/baseline/baseline_model.py"
click node_anomaly "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/intelligence/anomaly_detector.py"
click node_stress "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/stress/stress_engine.py"
click node_trends "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/intelligence/trend_analyzer.py"
click node_prediction "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/intelligence/prediction_engine.py"
click node_correlation "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/intelligence/correlation_engine.py"
click node_stability "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/intelligence/stability_index.py"
click node_events "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/events/event_logger.py"
click node_history "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/history/history_store.py"
click node_alerts "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/alerts/alert_manager.py"
click node_api "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/api/server.py"
click node_hardware "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/hardware/__init__.py"
click node_cleanup_api "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/api/server.py"
click node_scanner "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/storage_scan/scanner.py"
click node_cleaner "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/storage_scan/cleaner.py"
click node_storage "https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/storage/paths.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_dashboard,node_user toneBlue
class node_engine,node_collector,node_normalizer,node_buffer,node_processes toneAmber
class node_baseline,node_anomaly,node_stress,node_trends,node_prediction,node_correlation,node_stability toneMint
class node_events,node_history,node_alerts,node_api,node_hardware,node_cleanup_api,node_scanner,node_cleaner,node_storage toneRose
class node_system toneIndigo
```

## Components

### Desktop interface

- [Flutter dashboard](https://github.com/asiedudevelopmenthub/sentracore/blob/main/dashboard/windows/runner/flutter_window.cpp): `dashboard/windows/runner/flutter_window.cpp`

### Monitoring runtime

- [Engine orchestrator](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/main.py): `engine/main.py`
- [Telemetry collector](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/collector/system_collector.py): `engine/collector/system_collector.py`
- [Signal normalizer](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/normalization/normalizer.py): `engine/normalization/normalizer.py`
- [Time-series buffer](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/buffer/time_series_buffer.py): `engine/buffer/time_series_buffer.py`
- [Process tracker](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/process/process_tracker.py): `engine/process/process_tracker.py`

### Behavioral intelligence

- [Adaptive baseline](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/baseline/baseline_model.py): `engine/baseline/baseline_model.py`
- [Anomaly detection](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/intelligence/anomaly_detector.py): `engine/intelligence/anomaly_detector.py`
- [Stress scoring](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/stress/stress_engine.py): `engine/stress/stress_engine.py`
- [Trend analysis](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/intelligence/trend_analyzer.py): `engine/intelligence/trend_analyzer.py`
- [Pressure forecasting](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/intelligence/prediction_engine.py): `engine/intelligence/prediction_engine.py`
- [Root cause analysis](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/intelligence/correlation_engine.py): `engine/intelligence/correlation_engine.py`
- [Stability index](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/intelligence/stability_index.py): `engine/intelligence/stability_index.py`

### API and services

- [Event logbook](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/events/event_logger.py): `engine/events/event_logger.py`
- [History archive](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/history/history_store.py): `engine/history/history_store.py`
- [Alert manager](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/alerts/alert_manager.py): `engine/alerts/alert_manager.py`
- [REST and WebSocket API](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/api/server.py): `engine/api/server.py`
- [Hardware diagnostics](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/hardware/__init__.py): `engine/hardware/__init__.py`
- [Cleanup endpoints](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/api/server.py): `engine/api/server.py`
- [Storage scanner](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/storage_scan/scanner.py): `engine/storage_scan/scanner.py`
- [Storage cleanup](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/storage_scan/cleaner.py): `engine/storage_scan/cleaner.py`
- [Local datastore](https://github.com/asiedudevelopmenthub/sentracore/blob/main/engine/storage/paths.py): `engine/storage/paths.py`

### Other components

- **Desktop user**
- **Host system**

## Connections

- Desktop user → Flutter dashboard: uses (evidence: `README.md`)
- Flutter dashboard → REST and WebSocket API: requests state (evidence: `README.md`)
- REST and WebSocket API → Flutter dashboard: streams updates (evidence: `README.md`)
- Engine orchestrator → Telemetry collector: collects telemetry (evidence: `engine/main.py`)
- Telemetry collector → Host system: reads metrics (evidence: `engine/collector/system_collector.py`)
- Engine orchestrator → Signal normalizer: normalizes snapshots (evidence: `README.md`)
- Engine orchestrator → Time-series buffer: buffers samples (evidence: `README.md`)
- Engine orchestrator → Adaptive baseline: learns behavior (evidence: `README.md`)
- Engine orchestrator → Anomaly detection: detects deviations (evidence: `README.md`)
- Engine orchestrator → Stress scoring: scores pressure (evidence: `README.md`)
- Engine orchestrator → Process tracker: tracks processes (evidence: `engine/main.py`)
- Engine orchestrator → Trend analysis: analyzes trends (evidence: `README.md`)
- Engine orchestrator → Pressure forecasting: estimates risk (evidence: `README.md`)
- Engine orchestrator → Root cause analysis: explains causes (evidence: `README.md`)
- Engine orchestrator → Stability index: computes stability (evidence: `README.md`)
- Engine orchestrator → Event logbook: records events (evidence: `engine/main.py`)
- Engine orchestrator → History archive: archives samples (evidence: `engine/main.py`)
- Engine orchestrator → Alert manager: generates alerts (evidence: `engine/main.py`)
- Engine orchestrator → REST and WebSocket API: starts API (evidence: `engine/main.py`)
- REST and WebSocket API → Hardware diagnostics: queries diagnostics (evidence: `engine/api/server.py`)
- REST and WebSocket API → Cleanup endpoints: serves cleanup (evidence: `engine/api/server.py`)
- Cleanup endpoints → Storage scanner: runs preview scan (evidence: `engine/api/server.py`)
- Cleanup endpoints → Storage cleanup: applies cleanup (evidence: `engine/api/server.py`)
- Engine orchestrator → Local datastore: initializes layout (evidence: `engine/main.py`)
- History archive → Local datastore: persists history
