# hipcityreg/situation-monitor architecture

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

- Interactive diagram: https://gitdiagram.com/hipcityreg/situation-monitor
- Repository: https://github.com/hipcityreg/situation-monitor

## Overview

Situation Monitor is a Svelte dashboard for viewing market, news, Federal Reserve, geopolitical, and analytical signals, with configurable monitors and settings. The apparent user workflow is opening the dashboard and inspecting its panels, then managing monitors or preferences. The tree identifies those product areas, but the README is empty and the sampled page and panel source does not expose its wiring; links between UI, stores, and API modules are therefore omitted. The visible service client does show how external requests are configured and protected by cache, deduplication, and circuit breakers.

Main entry points: [`src/lib/services/client.ts`](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/services/client.ts) (Service client), [`src/lib/components/modals/MonitorFormModal.svelte`](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/components/modals/MonitorFormModal.svelte) (Monitor editor), [`src/lib/components/modals/Modal.svelte`](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/components/modals/Modal.svelte) (Modal framework), [`src/lib/stores/monitors.ts`](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/stores/monitors.ts) (Monitor state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard UI"]
  node_page["Dashboard page<br/>[+page.svelte]"]
  node_layout["Dashboard layout<br/>[Dashboard.svelte]"]
  node_panels["Signal panels"]
  node_modal["Modal framework<br/>[Modal.svelte]"]
  node_monitorform["Monitor editor"]
end

subgraph group_domain["Signals and Analysis"]
  node_marketapi["Market data APIs<br/>[markets.ts]"]
  node_newsapi["News API<br/>[news.ts]"]
  node_fredapi["Federal Reserve API<br/>[fred.ts]"]
  node_analysis["Signal analysis"]
end

subgraph group_state["Client State"]
  node_stores["Dashboard stores"]
  node_monitors["Monitor state<br/>[monitors.ts]"]
end

subgraph group_services["External Data Services"]
  node_client["Service client<br/>[client.ts]"]
  node_registry["Service registry<br/>[registry.ts]"]
  node_cache["Response cache<br/>[cache.ts]"]
  node_breaker["Circuit breakers<br/>[circuit-breaker.ts]"]
  node_dedupe["Request deduplicator<br/>[deduplicator.ts]"]
end

node_user(("Dashboard user"))
node_external{{"External data services"}}

node_monitorform -->|"renders"| node_modal
node_monitorform -->|"updates"| node_monitors
node_client -->|"loads config"| node_registry
node_client -->|"reads and writes"| node_cache
node_client -->|"checks health"| node_breaker
node_client -->|"deduplicates"| node_dedupe
node_client -->|"fetches"| node_external

click node_page "https://github.com/hipcityreg/situation-monitor/blob/main/src/routes/%2Bpage.svelte"
click node_layout "https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/components/layout/Dashboard.svelte"
click node_panels "https://github.com/hipcityreg/situation-monitor/tree/main/src/lib/components/panels"
click node_modal "https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/components/modals/Modal.svelte"
click node_monitorform "https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/components/modals/MonitorFormModal.svelte"
click node_marketapi "https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/api/markets.ts"
click node_newsapi "https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/api/news.ts"
click node_fredapi "https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/api/fred.ts"
click node_analysis "https://github.com/hipcityreg/situation-monitor/tree/main/src/lib/analysis"
click node_stores "https://github.com/hipcityreg/situation-monitor/tree/main/src/lib/stores"
click node_monitors "https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/stores/monitors.ts"
click node_client "https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/services/client.ts"
click node_registry "https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/services/registry.ts"
click node_cache "https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/services/cache.ts"
click node_breaker "https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/services/circuit-breaker.ts"
click node_dedupe "https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/services/deduplicator.ts"

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_page,node_layout,node_panels,node_modal,node_monitorform,node_user toneBlue
class node_marketapi,node_newsapi,node_fredapi,node_analysis toneAmber
class node_stores,node_monitors toneMint
class node_client,node_registry,node_cache,node_breaker,node_dedupe toneRose
class node_external toneIndigo
```

## Components

### Dashboard UI

- [Dashboard page](https://github.com/hipcityreg/situation-monitor/blob/main/src/routes/%2Bpage.svelte): `src/routes/+page.svelte`
- [Dashboard layout](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/components/layout/Dashboard.svelte): `src/lib/components/layout/Dashboard.svelte`
- [Signal panels](https://github.com/hipcityreg/situation-monitor/tree/main/src/lib/components/panels): `src/lib/components/panels`
- [Modal framework](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/components/modals/Modal.svelte): `src/lib/components/modals/Modal.svelte`
- [Monitor editor](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/components/modals/MonitorFormModal.svelte): `src/lib/components/modals/MonitorFormModal.svelte`

### Signals and Analysis

- [Market data APIs](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/api/markets.ts): `src/lib/api/markets.ts`
- [News API](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/api/news.ts): `src/lib/api/news.ts`
- [Federal Reserve API](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/api/fred.ts): `src/lib/api/fred.ts`
- [Signal analysis](https://github.com/hipcityreg/situation-monitor/tree/main/src/lib/analysis): `src/lib/analysis`

### Client State

- [Dashboard stores](https://github.com/hipcityreg/situation-monitor/tree/main/src/lib/stores): `src/lib/stores`
- [Monitor state](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/stores/monitors.ts): `src/lib/stores/monitors.ts`

### External Data Services

- [Service client](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/services/client.ts): `src/lib/services/client.ts`
- [Service registry](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/services/registry.ts): `src/lib/services/registry.ts`
- [Response cache](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/services/cache.ts): `src/lib/services/cache.ts`
- [Circuit breakers](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/services/circuit-breaker.ts): `src/lib/services/circuit-breaker.ts`
- [Request deduplicator](https://github.com/hipcityreg/situation-monitor/blob/main/src/lib/services/deduplicator.ts): `src/lib/services/deduplicator.ts`

### Other components

- **Dashboard user**
- **External data services**

## Connections

- Monitor editor → Modal framework: renders (evidence: `src/lib/components/modals/MonitorFormModal.svelte`)
- Monitor editor → Monitor state: updates (evidence: `src/lib/components/modals/MonitorFormModal.svelte`)
- Service client → Service registry: loads config (evidence: `src/lib/services/client.ts`)
- Service client → Response cache: reads and writes (evidence: `src/lib/services/client.ts`)
- Service client → Circuit breakers: checks health (evidence: `src/lib/services/client.ts`)
- Service client → Request deduplicator: deduplicates (evidence: `src/lib/services/client.ts`)
- Service client → External data services: fetches (evidence: `src/lib/services/client.ts`)
