# mithumohan00-ship-it/safeops architecture

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

- Interactive diagram: https://gitdiagram.com/mithumohan00-ship-it/safeops
- Repository: https://github.com/mithumohan00-ship-it/safeops

## Overview

SafeOps is a two-process observability platform: customer-side telemetry is normalized and privacy-sanitized before durable, authenticated delivery to a tenant-isolated SaaS service. The SaaS evaluates health, detects and correlates anomalies, and exposes dashboards, reliability views, and policy-checked remediation. The graph follows the documented collector-to-cloud workflow and sampled module responsibilities; some internal calls and UI-to-engine wiring are supported by README descriptions rather than complete source excerpts.

Main entry points: [`tier2_saas/app.py`](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/app.py) (Ingest API), [`tier1_collector/app.py`](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/app.py) (Collector API), [`tier1_collector/buffer_sender.py`](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/buffer_sender.py) (Buffer Sender), [`tier1_collector/adapters.py`](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/adapters.py) (Input Adapters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collector["Tier 1 Collector"]
  node_collector_app["Collector API<br/>[app.py]"]
  node_adapters["Input Adapters<br/>[adapters.py]"]
  node_parser["Format Parser<br/>[format_parser.py]"]
  node_pipeline["Privacy Pipeline<br/>[pipeline.py]"]
  node_local_store[("Local SQLite<br/>[storage.py]")]
  node_sender["Buffer Sender<br/>[buffer_sender.py]"]
end

subgraph group_cloud["Tier 2 SaaS"]
  node_saas_api["Ingest API<br/>[app.py]"]
  node_auth["API Key Auth<br/>[auth.py]"]
  node_saas_store[("Tenant Database<br/>[storage.py]")]
  node_health["Health Engine<br/>[health_engine.py]"]
  node_aiops["AIOps Engine<br/>[aiops_engine.py]"]
end

subgraph group_presentation["Operator Views"]
  node_dashboard["Live Dashboard<br/>[dashboard.html]"]
  node_incidents["Incidents UI<br/>[incidents.html]"]
  node_reliability["Reliability UI<br/>[reliability.html]"]
  node_egress["Egress Proof UI<br/>[egress.html]"]
  node_control["Demo Controls<br/>[control.html]"]
end

node_operator(("Operator"))
node_telemetry["Telemetry Sources"]

node_telemetry -->|"provides feeds"| node_adapters
node_collector_app -->|"fetches records"| node_adapters
node_adapters -->|"normalizes formats"| node_parser
node_collector_app -->|"processes records"| node_pipeline
node_pipeline -.->|"stores raw data"| node_local_store
node_collector_app -->|"persists events"| node_local_store
node_collector_app -->|"starts worker"| node_sender
node_sender -->|"reads queue"| node_local_store
node_sender -->|"posts payloads"| node_saas_api
node_sender -->|"sends heartbeat"| node_saas_api
node_saas_api -->|"validates keys"| node_auth
node_saas_api -->|"records events"| node_saas_store
node_saas_api -->|"evaluates health"| node_health
node_saas_api -->|"analyzes events"| node_aiops
node_health -->|"logs transitions"| node_saas_store
node_aiops -->|"records audits"| node_saas_store
node_saas_api -->|"serves view"| node_dashboard
node_saas_api -->|"serves view"| node_incidents
node_saas_api -->|"serves view"| node_reliability
node_collector_app -->|"serves proof"| node_egress
node_operator -->|"triggers scenarios"| node_control
node_operator -->|"reviews status"| node_dashboard
node_operator -->|"reviews actions"| node_incidents
node_operator -->|"checks service"| node_reliability

click node_collector_app "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/app.py"
click node_adapters "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/adapters.py"
click node_parser "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/format_parser.py"
click node_pipeline "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/pipeline.py"
click node_local_store "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/storage.py"
click node_sender "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/buffer_sender.py"
click node_saas_api "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/app.py"
click node_auth "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/auth.py"
click node_saas_store "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/storage.py"
click node_health "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/health_engine.py"
click node_aiops "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/aiops_engine.py"
click node_dashboard "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/templates/dashboard.html"
click node_incidents "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/templates/incidents.html"
click node_reliability "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/templates/reliability.html"
click node_egress "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/templates/egress.html"
click node_control "https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/templates/control.html"

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_collector_app,node_adapters,node_parser,node_pipeline,node_local_store,node_sender toneBlue
class node_saas_api,node_auth,node_saas_store,node_health,node_aiops toneAmber
class node_dashboard,node_incidents,node_reliability,node_egress,node_control toneMint
class node_operator,node_telemetry toneIndigo
```

## Components

### Tier 1 Collector

- [Collector API](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/app.py): `tier1_collector/app.py`
- [Input Adapters](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/adapters.py): `tier1_collector/adapters.py`
- [Format Parser](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/format_parser.py): `tier1_collector/format_parser.py`
- [Privacy Pipeline](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/pipeline.py): `tier1_collector/pipeline.py`
- [Local SQLite](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/storage.py): `tier1_collector/storage.py`
- [Buffer Sender](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/buffer_sender.py): `tier1_collector/buffer_sender.py`

### Tier 2 SaaS

- [Ingest API](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/app.py): `tier2_saas/app.py`
- [API Key Auth](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/auth.py): `tier2_saas/auth.py`
- [Tenant Database](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/storage.py): `tier2_saas/storage.py`
- [Health Engine](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/health_engine.py): `tier2_saas/health_engine.py`
- [AIOps Engine](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/aiops_engine.py): `tier2_saas/aiops_engine.py`

### Operator Views

- [Live Dashboard](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/templates/dashboard.html): `tier2_saas/templates/dashboard.html`
- [Incidents UI](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/templates/incidents.html): `tier2_saas/templates/incidents.html`
- [Reliability UI](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier2_saas/templates/reliability.html): `tier2_saas/templates/reliability.html`
- [Egress Proof UI](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/templates/egress.html): `tier1_collector/templates/egress.html`
- [Demo Controls](https://github.com/mithumohan00-ship-it/safeops/blob/main/tier1_collector/templates/control.html): `tier1_collector/templates/control.html`

### Other components

- **Operator**
- **Telemetry Sources**

## Connections

- Telemetry Sources → Input Adapters: provides feeds (evidence: `README.md`)
- Collector API → Input Adapters: fetches records (evidence: `tier1_collector/app.py`)
- Input Adapters → Format Parser: normalizes formats (evidence: `tier1_collector/adapters.py`)
- Collector API → Privacy Pipeline: processes records (evidence: `tier1_collector/app.py`)
- Privacy Pipeline → Local SQLite: stores raw data (evidence: `README.md`)
- Collector API → Local SQLite: persists events (evidence: `tier1_collector/app.py`)
- Collector API → Buffer Sender: starts worker (evidence: `tier1_collector/app.py`)
- Buffer Sender → Local SQLite: reads queue (evidence: `tier1_collector/buffer_sender.py`)
- Buffer Sender → Ingest API: posts payloads (evidence: `README.md`)
- Buffer Sender → Ingest API: sends heartbeat (evidence: `README.md`)
- Ingest API → API Key Auth: validates keys (evidence: `tier2_saas/app.py`)
- Ingest API → Tenant Database: records events (evidence: `tier2_saas/app.py`)
- Ingest API → Health Engine: evaluates health (evidence: `tier2_saas/app.py`)
- Ingest API → AIOps Engine: analyzes events (evidence: `tier2_saas/app.py`)
- Health Engine → Tenant Database: logs transitions (evidence: `tier2_saas/health_engine.py`)
- AIOps Engine → Tenant Database: records audits (evidence: `tier2_saas/aiops_engine.py`)
- Ingest API → Live Dashboard: serves view (evidence: `README.md`)
- Ingest API → Incidents UI: serves view (evidence: `tier2_saas/app.py`)
- Ingest API → Reliability UI: serves view (evidence: `tier2_saas/app.py`)
- Collector API → Egress Proof UI: serves proof (evidence: `tier1_collector/app.py`)
- Operator → Demo Controls: triggers scenarios (evidence: `README.md`)
- Operator → Live Dashboard: reviews status (evidence: `README.md`)
- Operator → Incidents UI: reviews actions (evidence: `README.md`)
- Operator → Reliability UI: checks service (evidence: `README.md`)
