# dmitriykuptsov/process-historian-cassandra architecture

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

- Interactive diagram: https://gitdiagram.com/dmitriykuptsov/process-historian-cassandra
- Repository: https://github.com/dmitriykuptsov/process-historian-cassandra

## Overview

Process Historian is a time-series collection and management system: producers submit sensor measurements, the service checks configured filters and stores points in Cassandra; users manage sensors and inspect data through a Vue UI backed by Flask APIs. The API also handles accounts, token validation, sensor metadata, permissions and alerts. The excerpts establish ingestion writes and several UI/API calls, but do not show the Python client’s behavior or the complete data-view workflow, so those links are omitted where unsupported.

Main entry points: [`rest-api/app/api/controllers.py`](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/api/controllers.py) (Sensor and data API), [`rest-api/app/ingestion/controllers.py`](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/ingestion/controllers.py) (Ingestion routes), [`rest-api/app/api/models.py`](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/api/models.py) (Sensor metadata models), [`frontend/src/App.vue`](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/frontend/src/App.vue) (App and demo)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_appui["App and demo<br/>[App.vue]"]
  node_login["Login view<br/>[Login.vue]"]
  node_sensorsui["Sensor management<br/>[Sensors.vue]"]
  node_tagcomponents["Tag and filter editors"]
  node_dataui["Data view<br/>[Data.vue]"]
end

subgraph group_service["Flask service"]
  node_authapi["Authentication routes<br/>[controllers.py]"]
  node_api["Sensor and data API<br/>[controllers.py]"]
  node_ingestion["Ingestion routes<br/>[controllers.py]"]
  node_filters["Threshold filters<br/>[filters.py]"]
end

subgraph group_metadata["Metadata and security"]
  node_security["Token and hashing helpers<br/>[utils.py]"]
  node_users["User model<br/>[models.py]"]
  node_sensor_models["Sensor metadata models<br/>[models.py]"]
  node_sqlstore[("Metadata database<br/>[schema.sql]")]
end

subgraph group_timeseries["Time-series storage"]
  node_cassandra[("Cassandra time-series store")]
end

node_user(("Historian user"))
node_producer(("Data producer"))

node_user -->|"uses"| node_appui
node_user -->|"manages sensors"| node_sensorsui
node_user -.->|"views data"| node_dataui
node_appui -->|"validates token"| node_authapi
node_appui -->|"requests public data"| node_api
node_sensorsui -->|"manages tags"| node_api
node_sensorsui -->|"opens editors"| node_tagcomponents
node_tagcomponents -->|"updates sensor"| node_api
node_dataui -.->|"fetches data"| node_api
node_authapi -->|"checks tokens"| node_security
node_authapi -->|"queries users"| node_users
node_api -->|"queries metadata"| node_sensor_models
node_api -->|"queries accounts"| node_users
node_api -->|"gets identity"| node_security
node_api -->|"uses filter constants"| node_filters
node_sensor_models -.->|"maps metadata"| node_sqlstore
node_users -.->|"maps accounts"| node_sqlstore
node_producer -.->|"submits points"| node_ingestion
node_ingestion -->|"loads sensor filters"| node_sensor_models
node_ingestion -->|"checks thresholds"| node_filters
node_ingestion -->|"writes measurements"| node_cassandra
node_ingestion -->|"records alerts"| node_sensor_models

click node_appui "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/frontend/src/App.vue"
click node_login "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/frontend/src/views/Login.vue"
click node_sensorsui "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/frontend/src/views/Sensors.vue"
click node_tagcomponents "https://github.com/dmitriykuptsov/process-historian-cassandra/tree/main/frontend/src/components"
click node_dataui "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/frontend/src/views/Data.vue"
click node_authapi "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/auth/controllers.py"
click node_api "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/api/controllers.py"
click node_ingestion "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/ingestion/controllers.py"
click node_filters "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/utils/filters.py"
click node_security "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/utils/utils.py"
click node_users "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/auth/models.py"
click node_sensor_models "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/api/models.py"
click node_sqlstore "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/mysql/schema.sql"
click node_cassandra "https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/cassandra/scripts/create_database.cql"

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_appui,node_login,node_sensorsui,node_tagcomponents,node_dataui,node_user toneBlue
class node_authapi,node_api,node_ingestion,node_filters toneAmber
class node_security,node_users,node_sensor_models,node_sqlstore toneMint
class node_cassandra toneRose
class node_producer toneIndigo
```

## Components

### Web interface

- [App and demo](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/frontend/src/App.vue): `frontend/src/App.vue`
- [Login view](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/frontend/src/views/Login.vue): `frontend/src/views/Login.vue`
- [Sensor management](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/frontend/src/views/Sensors.vue): `frontend/src/views/Sensors.vue`
- [Tag and filter editors](https://github.com/dmitriykuptsov/process-historian-cassandra/tree/main/frontend/src/components): `frontend/src/components`
- [Data view](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/frontend/src/views/Data.vue): `frontend/src/views/Data.vue`

### Flask service

- [Authentication routes](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/auth/controllers.py): `rest-api/app/auth/controllers.py`
- [Sensor and data API](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/api/controllers.py): `rest-api/app/api/controllers.py`
- [Ingestion routes](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/ingestion/controllers.py): `rest-api/app/ingestion/controllers.py`
- [Threshold filters](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/utils/filters.py): `rest-api/app/utils/filters.py`

### Metadata and security

- [Token and hashing helpers](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/utils/utils.py): `rest-api/app/utils/utils.py`
- [User model](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/auth/models.py): `rest-api/app/auth/models.py`
- [Sensor metadata models](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/rest-api/app/api/models.py): `rest-api/app/api/models.py`
- [Metadata database](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/mysql/schema.sql): `mysql/schema.sql`

### Time-series storage

- [Cassandra time-series store](https://github.com/dmitriykuptsov/process-historian-cassandra/blob/main/cassandra/scripts/create_database.cql): `cassandra/scripts/create_database.cql`

### Other components

- **Historian user**
- **Data producer**

## Connections

- Historian user → App and demo: uses (evidence: `frontend/src/App.vue`)
- Historian user → Sensor management: manages sensors (evidence: `frontend/src/views/Sensors.vue`)
- Historian user → Data view: views data
- App and demo → Authentication routes: validates token (evidence: `frontend/src/App.vue`)
- App and demo → Sensor and data API: requests public data (evidence: `frontend/src/App.vue`)
- Sensor management → Sensor and data API: manages tags (evidence: `frontend/src/views/Sensors.vue`)
- Sensor management → Tag and filter editors: opens editors (evidence: `frontend/src/views/Sensors.vue`)
- Tag and filter editors → Sensor and data API: updates sensor (evidence: `frontend/src/components/EditTag.vue`)
- Data view → Sensor and data API: fetches data
- Authentication routes → Token and hashing helpers: checks tokens (evidence: `rest-api/app/auth/controllers.py`)
- Authentication routes → User model: queries users (evidence: `rest-api/app/auth/controllers.py`)
- Sensor and data API → Sensor metadata models: queries metadata (evidence: `rest-api/app/api/controllers.py`)
- Sensor and data API → User model: queries accounts (evidence: `rest-api/app/api/controllers.py`)
- Sensor and data API → Token and hashing helpers: gets identity (evidence: `rest-api/app/api/controllers.py`)
- Sensor and data API → Threshold filters: uses filter constants (evidence: `rest-api/app/api/controllers.py`)
- Sensor metadata models → Metadata database: maps metadata
- User model → Metadata database: maps accounts
- Data producer → Ingestion routes: submits points
- Ingestion routes → Sensor metadata models: loads sensor filters (evidence: `rest-api/app/ingestion/controllers.py`)
- Ingestion routes → Threshold filters: checks thresholds (evidence: `rest-api/app/ingestion/controllers.py`)
- Ingestion routes → Cassandra time-series store: writes measurements (evidence: `rest-api/app/ingestion/controllers.py`)
- Ingestion routes → Sensor metadata models: records alerts (evidence: `rest-api/app/ingestion/controllers.py`)
