# iamdevendrab/cipherwatch architecture

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

- Interactive diagram: https://gitdiagram.com/iamdevendrab/cipherwatch
- Repository: https://github.com/iamdevendrab/cipherwatch

## Overview

CipherWatch is a small Flask-based security-alert demo: one service exposes a status page, while a separate SOAR service accepts alerts and asks an Ollama model to classify severity and suggest remediation. The SOAR service returns the submitted alert and model response; if the model call fails, it returns an error string instead. The excerpts show these runtime paths, but not deployment wiring or any Kubernetes client behavior, so those are omitted.

Main entry points: [`soar-engine/app.py`](https://github.com/iamdevendrab/cipherwatch/blob/main/soar-engine/app.py) (Alert Endpoint), [`app/app.py`](https://github.com/iamdevendrab/cipherwatch/blob/main/app/app.py) (Status Route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_status["Status Service"]
  node_status_route["Status Route<br/>[app.py]"]
end

subgraph group_soar["Alert Analysis"]
  node_alert_route["Alert Endpoint<br/>[app.py]"]
  node_prompt_builder["Prompt Builder<br/>[app.py]"]
  node_alert_result["Analysis Response<br/>[app.py]"]
  node_health_route["Health Route<br/>[app.py]"]
end

node_visitor(("Web Visitor"))
node_alert_sender(("Alert Sender"))
node_ollama{{"Ollama API"}}

node_visitor -->|"requests page"| node_status_route
node_status_route -->|"returns status"| node_visitor
node_alert_sender -->|"posts alert"| node_alert_route
node_alert_route -->|"builds prompt"| node_prompt_builder
node_prompt_builder -->|"requests analysis"| node_ollama
node_alert_route -->|"returns alert and analysis"| node_alert_result
node_alert_sender -->|"checks health"| node_health_route

click node_status_route "https://github.com/iamdevendrab/cipherwatch/blob/main/app/app.py"
click node_alert_route "https://github.com/iamdevendrab/cipherwatch/blob/main/soar-engine/app.py"
click node_prompt_builder "https://github.com/iamdevendrab/cipherwatch/blob/main/soar-engine/app.py"
click node_alert_result "https://github.com/iamdevendrab/cipherwatch/blob/main/soar-engine/app.py"
click node_health_route "https://github.com/iamdevendrab/cipherwatch/blob/main/soar-engine/app.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_status_route toneBlue
class node_alert_route,node_prompt_builder,node_alert_result,node_health_route toneAmber
class node_visitor,node_alert_sender toneIndigo
class node_ollama toneMint
```

## Components

### Status Service

- [Status Route](https://github.com/iamdevendrab/cipherwatch/blob/main/app/app.py): `app/app.py`

### Alert Analysis

- [Alert Endpoint](https://github.com/iamdevendrab/cipherwatch/blob/main/soar-engine/app.py): `soar-engine/app.py`
- [Prompt Builder](https://github.com/iamdevendrab/cipherwatch/blob/main/soar-engine/app.py): `soar-engine/app.py`
- [Analysis Response](https://github.com/iamdevendrab/cipherwatch/blob/main/soar-engine/app.py): `soar-engine/app.py`
- [Health Route](https://github.com/iamdevendrab/cipherwatch/blob/main/soar-engine/app.py): `soar-engine/app.py`

### Other components

- **Web Visitor**
- **Alert Sender**
- **Ollama API**

## Connections

- Web Visitor → Status Route: requests page (evidence: `app/app.py`)
- Status Route → Web Visitor: returns status (evidence: `app/app.py`)
- Alert Sender → Alert Endpoint: posts alert (evidence: `soar-engine/app.py`)
- Alert Endpoint → Prompt Builder: builds prompt (evidence: `soar-engine/app.py`)
- Prompt Builder → Ollama API: requests analysis (evidence: `soar-engine/app.py`)
- Alert Endpoint → Analysis Response: returns alert and analysis (evidence: `soar-engine/app.py`)
- Alert Sender → Health Route: checks health (evidence: `soar-engine/app.py`)
