# uchejerla/holo-profiler architecture

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

- Interactive diagram: https://gitdiagram.com/uchejerla/holo-profiler
- Repository: https://github.com/uchejerla/holo-profiler

## Overview

Holo Profiler profiles local files in a browser, scores data quality, suggests and manages rules, and can monitor connected Snowflake or S3 sources on a schedule. Its server runner reuses the profiling and operations logic, persists runs and exceptions, and exposes workspace APIs. The README documents dashboard, wide-file visualization, SQL/JSON rule export, and exception workflows; their exact call wiring is not established by the sampled excerpts, so those branches are kept conservative.

Main entry points: [`hud/src/ui-main.js`](https://github.com/uchejerla/holo-profiler/blob/main/hud/src/ui-main.js) (Profiler interface), [`lib/core/runner.js`](https://github.com/uchejerla/holo-profiler/blob/main/lib/core/runner.js) (Scheduled run orchestrator), [`lib/core/sources.js`](https://github.com/uchejerla/holo-profiler/blob/main/lib/core/sources.js) (Source readers), [`lib/server-deps.ts`](https://github.com/uchejerla/holo-profiler/blob/main/lib/server-deps.ts) (Server dependencies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser profiling"]
  node_hud["Profiler interface<br/>[ui-main.js]"]
  node_visual["Holo visualization<br/>[space.js]"]
  node_rule_ui["Rule editor<br/>[ui-rules.js]"]
  node_ops_ui["Monitoring dashboard<br/>[ui-ops.js]"]
  node_source_ui["Source setup<br/>[ui-sources.js]"]
  node_bridge["Browser persistence bridge<br/>[server-bridge.js]"]
end

subgraph group_quality["Quality logic"]
  node_engine["Profiler and scoring<br/>[engine.js]"]
  node_rules["Rule evaluation<br/>[rules.js]"]
  node_ops["Runs and exceptions<br/>[ops.js]"]
end

subgraph group_server["Server monitoring"]
  node_sources_api["Source API<br/>[route.ts]"]
  node_runner["Scheduled run orchestrator<br/>[runner.js]"]
  node_api["Dataset and schedule APIs<br/>[route.ts]"]
end

subgraph group_data["Sources and storage"]
  node_source_reader["Source readers<br/>[sources.js]"]
  node_credentials["Credential encryption<br/>[crypto.js]"]
  node_deps["Server dependencies<br/>[server-deps.ts]"]
  node_store["Workspace data store<br/>[store.js]"]
end

subgraph group_access["Workspace access"]
  node_auth["Sign-in and workspace context<br/>[context.ts]"]
  node_auth_routes["Magic-link routes<br/>[route.ts]"]
  node_supabase_user["User Supabase client<br/>[server.ts]"]
end

node_person(("Data practitioner"))
node_file["Local data file"]
node_cron(("Schedule trigger"))
node_postgres[("Supabase Postgres")]
node_snowflake[("Snowflake")]
node_s3[("S3 storage")]

node_person -->|"uses"| node_hud
node_file -->|"drops into"| node_hud
node_hud -->|"profiles locally"| node_engine
node_hud -->|"explores records"| node_visual
node_hud -->|"edits rules"| node_rule_ui
node_hud -->|"views monitoring"| node_ops_ui
node_hud -->|"configures sources"| node_source_ui
node_rules -->|"uses profiler"| node_engine
node_runner -->|"profiles rows"| node_engine
node_runner -->|"builds and applies runs"| node_ops
node_cron -->|"triggers due runs"| node_runner
node_api -->|"runs dataset"| node_runner
node_runner -->|"loads dependencies"| node_deps
node_deps -->|"creates store"| node_store
node_deps -->|"fetches rows"| node_source_reader
node_deps -->|"decrypts secrets"| node_credentials
node_runner -->|"reads and records runs"| node_store
node_source_reader -->|"shares row format"| node_engine
node_source_reader -->|"reads tables"| node_snowflake
node_source_reader -->|"reads files"| node_s3
node_sources_api -->|"encrypts credentials"| node_credentials
node_sources_api -->|"stores source metadata"| node_postgres
node_store -->|"reads and writes records"| node_postgres
node_auth -->|"gets signed-in user"| node_supabase_user
node_auth -->|"loads workspace membership"| node_postgres
node_auth_routes -->|"verifies magic link"| node_supabase_user
node_bridge -.->|"persists selected data"| node_api

click node_hud "https://github.com/uchejerla/holo-profiler/blob/main/hud/src/ui-main.js"
click node_visual "https://github.com/uchejerla/holo-profiler/blob/main/hud/src/space.js"
click node_rule_ui "https://github.com/uchejerla/holo-profiler/blob/main/hud/src/ui-rules.js"
click node_ops_ui "https://github.com/uchejerla/holo-profiler/blob/main/hud/src/ui-ops.js"
click node_source_ui "https://github.com/uchejerla/holo-profiler/blob/main/hud/src/ui-sources.js"
click node_engine "https://github.com/uchejerla/holo-profiler/blob/main/hud/src/engine.js"
click node_rules "https://github.com/uchejerla/holo-profiler/blob/main/hud/src/rules.js"
click node_ops "https://github.com/uchejerla/holo-profiler/blob/main/hud/src/ops.js"
click node_bridge "https://github.com/uchejerla/holo-profiler/blob/main/hud/src/server-bridge.js"
click node_sources_api "https://github.com/uchejerla/holo-profiler/blob/main/app/api/sources/route.ts"
click node_runner "https://github.com/uchejerla/holo-profiler/blob/main/lib/core/runner.js"
click node_source_reader "https://github.com/uchejerla/holo-profiler/blob/main/lib/core/sources.js"
click node_credentials "https://github.com/uchejerla/holo-profiler/blob/main/lib/core/crypto.js"
click node_deps "https://github.com/uchejerla/holo-profiler/blob/main/lib/server-deps.ts"
click node_store "https://github.com/uchejerla/holo-profiler/blob/main/lib/core/store.js"
click node_auth "https://github.com/uchejerla/holo-profiler/blob/main/lib/context.ts"
click node_auth_routes "https://github.com/uchejerla/holo-profiler/blob/main/app/auth/confirm/route.ts"
click node_supabase_user "https://github.com/uchejerla/holo-profiler/blob/main/lib/supabase/server.ts"
click node_api "https://github.com/uchejerla/holo-profiler/blob/main/app/api/datasets/%5Bid%5D/run/route.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_hud,node_visual,node_rule_ui,node_ops_ui,node_source_ui,node_bridge toneBlue
class node_engine,node_rules,node_ops,node_postgres,node_snowflake,node_s3 toneAmber
class node_sources_api,node_runner,node_api toneMint
class node_source_reader,node_credentials,node_deps,node_store toneRose
class node_auth,node_auth_routes,node_supabase_user,node_person,node_file,node_cron toneIndigo
```

## Components

### Browser profiling

- [Profiler interface](https://github.com/uchejerla/holo-profiler/blob/main/hud/src/ui-main.js): `hud/src/ui-main.js`
- [Holo visualization](https://github.com/uchejerla/holo-profiler/blob/main/hud/src/space.js): `hud/src/space.js`
- [Rule editor](https://github.com/uchejerla/holo-profiler/blob/main/hud/src/ui-rules.js): `hud/src/ui-rules.js`
- [Monitoring dashboard](https://github.com/uchejerla/holo-profiler/blob/main/hud/src/ui-ops.js): `hud/src/ui-ops.js`
- [Source setup](https://github.com/uchejerla/holo-profiler/blob/main/hud/src/ui-sources.js): `hud/src/ui-sources.js`
- [Browser persistence bridge](https://github.com/uchejerla/holo-profiler/blob/main/hud/src/server-bridge.js): `hud/src/server-bridge.js`

### Quality logic

- [Profiler and scoring](https://github.com/uchejerla/holo-profiler/blob/main/hud/src/engine.js): `hud/src/engine.js`
- [Rule evaluation](https://github.com/uchejerla/holo-profiler/blob/main/hud/src/rules.js): `hud/src/rules.js`
- [Runs and exceptions](https://github.com/uchejerla/holo-profiler/blob/main/hud/src/ops.js): `hud/src/ops.js`

### Server monitoring

- [Source API](https://github.com/uchejerla/holo-profiler/blob/main/app/api/sources/route.ts): `app/api/sources/route.ts`
- [Scheduled run orchestrator](https://github.com/uchejerla/holo-profiler/blob/main/lib/core/runner.js): `lib/core/runner.js`
- [Dataset and schedule APIs](https://github.com/uchejerla/holo-profiler/blob/main/app/api/datasets/%5Bid%5D/run/route.ts): `app/api/datasets/[id]/run/route.ts`

### Sources and storage

- [Source readers](https://github.com/uchejerla/holo-profiler/blob/main/lib/core/sources.js): `lib/core/sources.js`
- [Credential encryption](https://github.com/uchejerla/holo-profiler/blob/main/lib/core/crypto.js): `lib/core/crypto.js`
- [Server dependencies](https://github.com/uchejerla/holo-profiler/blob/main/lib/server-deps.ts): `lib/server-deps.ts`
- [Workspace data store](https://github.com/uchejerla/holo-profiler/blob/main/lib/core/store.js): `lib/core/store.js`

### Workspace access

- [Sign-in and workspace context](https://github.com/uchejerla/holo-profiler/blob/main/lib/context.ts): `lib/context.ts`
- [Magic-link routes](https://github.com/uchejerla/holo-profiler/blob/main/app/auth/confirm/route.ts): `app/auth/confirm/route.ts`
- [User Supabase client](https://github.com/uchejerla/holo-profiler/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`

### Other components

- **Data practitioner**
- **Local data file**
- **Schedule trigger**
- **Supabase Postgres**
- **Snowflake**
- **S3 storage**

## Connections

- Data practitioner → Profiler interface: uses
- Local data file → Profiler interface: drops into
- Profiler interface → Profiler and scoring: profiles locally
- Profiler interface → Holo visualization: explores records
- Profiler interface → Rule editor: edits rules
- Profiler interface → Monitoring dashboard: views monitoring
- Profiler interface → Source setup: configures sources
- Rule evaluation → Profiler and scoring: uses profiler (evidence: `hud/src/rules.js`)
- Scheduled run orchestrator → Profiler and scoring: profiles rows (evidence: `lib/core/runner.js`)
- Scheduled run orchestrator → Runs and exceptions: builds and applies runs (evidence: `lib/core/runner.js`)
- Schedule trigger → Scheduled run orchestrator: triggers due runs
- Dataset and schedule APIs → Scheduled run orchestrator: runs dataset (evidence: `app/api/datasets/[id]/run/route.ts`)
- Scheduled run orchestrator → Server dependencies: loads dependencies (evidence: `app/api/datasets/[id]/run/route.ts`)
- Server dependencies → Workspace data store: creates store (evidence: `lib/server-deps.ts`)
- Server dependencies → Source readers: fetches rows (evidence: `lib/server-deps.ts`)
- Server dependencies → Credential encryption: decrypts secrets (evidence: `lib/server-deps.ts`)
- Scheduled run orchestrator → Workspace data store: reads and records runs (evidence: `lib/core/runner.js`)
- Source readers → Profiler and scoring: shares row format (evidence: `lib/core/sources.js`)
- Source readers → Snowflake: reads tables
- Source readers → S3 storage: reads files
- Source API → Credential encryption: encrypts credentials (evidence: `app/api/sources/route.ts`)
- Source API → Supabase Postgres: stores source metadata (evidence: `app/api/sources/route.ts`)
- Workspace data store → Supabase Postgres: reads and writes records (evidence: `lib/core/store.js`)
- Sign-in and workspace context → User Supabase client: gets signed-in user (evidence: `lib/context.ts`)
- Sign-in and workspace context → Supabase Postgres: loads workspace membership (evidence: `lib/context.ts`)
- Magic-link routes → User Supabase client: verifies magic link (evidence: `app/auth/confirm/route.ts`)
- Browser persistence bridge → Dataset and schedule APIs: persists selected data
