# debojyotimondaldev/pulsemonitor architecture

> Architecture diagram of the GitHub repository debojyotimondaldev/pulsemonitor, 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/debojyotimondaldev/pulsemonitor
- Repository: https://github.com/debojyotimondaldev/pulsemonitor

## Overview

Pulse Monitor is a local Flask system-monitoring dashboard with a separate public-dataset evaluation workflow. Live metrics are collected in the background, stored locally, then read by web routes for anomaly detection, health scoring, and dashboard/history responses. Dataset analysis evaluates selected public metrics against annotated events and returns scores and chart data to its interface. The graph reflects the inspected runtime excerpts and README; unsampled template wiring and other implementation details are not inferred beyond documented capabilities.

Main entry points: [`app/routes.py`](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/app/routes.py) (Flask routes), [`collector/collector_service.py`](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/collector/collector_service.py) (Background collector), [`main.py`](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/main.py) (Application launcher), [`database/queries.py`](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/database/queries.py) (Metrics query)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Collection and storage"]
  node_launcher["Application launcher<br/>[main.py]"]
  node_collector["Background collector"]
  node_monitor["System metrics<br/>[system_monitor.py]"]
  node_store[("SQLite metrics store<br/>[database.py]")]
  node_queries["Metrics query<br/>[queries.py]"]
end

subgraph group_live["Live monitoring"]
  node_anomaly["Live anomaly detection"]
  node_health["Health scoring<br/>[health_score.py]"]
end

subgraph group_dataset["Dataset evaluation"]
  node_datasetmodel["Dataset evaluation"]
  node_publicdata["Public metric data"]
end

subgraph group_web["Web interfaces"]
  node_routes["Flask routes<br/>[routes.py]"]
  node_dashboard["Dashboard interface<br/>[dashboard.html]"]
  node_dashboardjs["Dashboard behavior<br/>[dashboard.js]"]
  node_datasetpage["Dataset interface"]
  node_datasetjs["Dataset interactions"]
end

node_user(("Local user"))

node_user -.->|"starts locally"| node_launcher
node_launcher -->|"starts thread"| node_collector
node_collector -->|"collects metrics"| node_monitor
node_collector -->|"inserts metrics"| node_store
node_routes -->|"loads metrics"| node_queries
node_queries -->|"reads metrics"| node_store
node_routes -->|"detects anomalies"| node_anomaly
node_routes -->|"calculates score"| node_health
node_routes -->|"renders dashboard"| node_dashboard
node_routes -->|"renders analysis page"| node_datasetpage
node_datasetjs -->|"requests results"| node_routes
node_routes -->|"analyzes metric"| node_datasetmodel
node_datasetmodel -->|"reads CSV data"| node_publicdata
node_user -.->|"views dashboard"| node_dashboardjs

click node_launcher "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/main.py"
click node_collector "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/collector/collector_service.py"
click node_monitor "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/collector/system_monitor.py"
click node_store "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/database/database.py"
click node_queries "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/database/queries.py"
click node_routes "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/app/routes.py"
click node_anomaly "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/models/anomaly_detector.py"
click node_health "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/utils/health_score.py"
click node_dashboard "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/app/templates/dashboard.html"
click node_dashboardjs "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/app/static/js/dashboard.js"
click node_datasetpage "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/app/templates/dataset_analysis.html"
click node_datasetjs "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/app/static/js/dataset_analysis.js"
click node_datasetmodel "https://github.com/debojyotimondaldev/pulsemonitor/blob/main/models/public_dataset_analysis.py"
click node_publicdata "https://github.com/debojyotimondaldev/pulsemonitor/tree/main/data/public_dataset"

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_launcher,node_collector,node_monitor,node_store,node_queries,node_user toneBlue
class node_anomaly,node_health toneAmber
class node_datasetmodel,node_publicdata toneMint
class node_routes,node_dashboard,node_dashboardjs,node_datasetpage,node_datasetjs toneRose
```

## Components

### Collection and storage

- [Application launcher](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/main.py): `main.py`
- [Background collector](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/collector/collector_service.py): `collector/collector_service.py`
- [System metrics](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/collector/system_monitor.py): `collector/system_monitor.py`
- [SQLite metrics store](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/database/database.py): `database/database.py`
- [Metrics query](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/database/queries.py): `database/queries.py`

### Live monitoring

- [Live anomaly detection](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/models/anomaly_detector.py): `models/anomaly_detector.py`
- [Health scoring](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/utils/health_score.py): `utils/health_score.py`

### Dataset evaluation

- [Dataset evaluation](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/models/public_dataset_analysis.py): `models/public_dataset_analysis.py`
- [Public metric data](https://github.com/debojyotimondaldev/pulsemonitor/tree/main/data/public_dataset): `data/public_dataset`

### Web interfaces

- [Flask routes](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/app/routes.py): `app/routes.py`
- [Dashboard interface](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/app/templates/dashboard.html): `app/templates/dashboard.html`
- [Dashboard behavior](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/app/static/js/dashboard.js): `app/static/js/dashboard.js`
- [Dataset interface](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/app/templates/dataset_analysis.html): `app/templates/dataset_analysis.html`
- [Dataset interactions](https://github.com/debojyotimondaldev/pulsemonitor/blob/main/app/static/js/dataset_analysis.js): `app/static/js/dataset_analysis.js`

### Other components

- **Local user**

## Connections

- Local user → Application launcher: starts locally (evidence: `README.md`)
- Application launcher → Background collector: starts thread (evidence: `main.py`)
- Background collector → System metrics: collects metrics (evidence: `collector/collector_service.py`)
- Background collector → SQLite metrics store: inserts metrics (evidence: `collector/collector_service.py`)
- Flask routes → Metrics query: loads metrics (evidence: `app/routes.py`)
- Metrics query → SQLite metrics store: reads metrics (evidence: `database/queries.py`)
- Flask routes → Live anomaly detection: detects anomalies (evidence: `app/routes.py`)
- Flask routes → Health scoring: calculates score (evidence: `app/routes.py`)
- Flask routes → Dashboard interface: renders dashboard (evidence: `app/routes.py`)
- Flask routes → Dataset interface: renders analysis page (evidence: `app/routes.py`)
- Dataset interactions → Flask routes: requests results (evidence: `app/static/js/dataset_analysis.js`)
- Flask routes → Dataset evaluation: analyzes metric (evidence: `app/routes.py`)
- Dataset evaluation → Public metric data: reads CSV data (evidence: `models/public_dataset_analysis.py`)
- Local user → Dashboard behavior: views dashboard (evidence: `README.md`)
