# oriondesign2015/setuporion architecture

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

- Interactive diagram: https://gitdiagram.com/oriondesign2015/setuporion
- Repository: https://github.com/oriondesign2015/setuporion

## Overview

1. **What this repository is**
   This is not a single product application. It is a **self-hosting installer and asset repository** for OrionDesign’s stack of automation, marketing, CRM, AI, and observability tools. The README shows the intended entrypoint: a remote bootstrap script that provisions a selected set of services on a VPS.

2. **Control-plane vs workload separation**
   The architecture is split between:
   - the **installer/orchestrator** that prepares the server and deploys chosen tools
   - the **service bundles** under `Extras/` that provide configs, templates, migrations, and deployment assets for each tool  
   This is important for a diagram: the repo mostly supplies **provisioning artifacts**, not one centralized runtime.

3. **Shared hosting layer**
   The README lists common platform services such as **Traefik** and **Portainer**, which act as the shared edge and container-management layer for the installed tools. In practice, the stack is designed for **containerized deployment on a clean Ubuntu VPS** with shared routing and isolated per-app runtime containers.

4. **Supabase bundle**
   `Extras/Supabase/docker/volumes/` contains a full self-hosted Supabase layout:
   - `api/kong.yml` for the API gateway
   - `db/` SQL initialization and role/schema setup
   - `functions/` TypeScript edge functions
   - `logs/vector.yml` for log shipping
   - `pooler/pooler.exs` for connection pooling  
   This indicates Supabase is deployed as a **multi-component platform** with Postgres at the center, plus gateway, functions, logs, and pooling.

5. **Monitoring bundle**
   `Extras/Grafana/monitor-orion/` contains **Grafana + Prometheus** provisioning:
   - Grafana dashboards and datasource provisioning
   - Prometheus config
   - prebuilt dashboard JSON  
   This is a classic **observability sidecar stack** meant to monitor the other deployed services rather than power business logic.

6. **Zep bundle: a full embedded service**
   `Extras/Zep/` is a complete Go codebase for Zep, a memory/LLM context service. Its internal structure is substantial:
   - `cmd/` application entry
   - `pkg/server/` HTTP routes, middleware, handlers
   - `pkg/store/postgres/` persistence and migrations
   - `pkg/tasks/` async processing and embeddings/summarization
   - `pkg/llms/` OpenAI, Anthropic, and local embedding providers
   - `web/` server-rendered admin UI  
   Zep is architected as a **web/API service backed by Postgres**, with background task processing and LLM integrations.

7. **Zep data flow**
   Zep’s flow is: API requests enter the server, authenticate via JWT, hit domain handlers, persist or query via Postgres-backed stores, and trigger tasks for embedding, summarization, intent analysis, and NER. The `web/` layer is an admin/ops UI on top of those same backend stores.

8. **Integration and automation assets**
   Several `Extras/Meets/` JSON files are **automation workflow exports** for N8N and Typebot. `Extras/Chatwoot/emails/` contains email templates for account lifecycle actions. These are not standalone services; they are **integration artifacts** used to seed or configure flows around the installed stack.

9. **Other bundled app-specific configs**
   Files like `Extras/Krayin/app.php` and the video/pdf materials under `Extras/Arquivos de Videos/` are supporting assets and examples. They suggest the repo also acts as a **knowledge and configuration pack** for specific third-party tools, not just an installer.

10. **Persistence and boundaries**
   Most workloads are designed to keep their own state in **service-specific volumes or databases**:
   - Supabase owns its DB, functions, logs, and pooler configs
   - Zep owns Postgres tables/migrations and app state
   - Grafana/Prometheus keep monitoring state separately  
   The main architectural boundary is between the **installer** and the **per-tool isolated runtime stacks**.

11. **What an architecture diagram should emphasize**
   A good diagram should show:
   - a **bootstrap installer** entering through the Orion script
   - a **selection layer** that deploys one or more tools
   - a **shared container/network edge** for routing and management
   - separate **service stacks** for Supabase, Grafana/Prometheus, Zep, Chatwoot, and other optional apps
   - attached **data stores, volumes, and config artifacts** per stack  
   In short: this repo is a **deployment platform and asset catalog** for a multi-tool self-hosted environment.

Main entry points: [`SetupOrion`](https://github.com/oriondesign2015/setuporion/tree/main/SetupOrion) (SetupOrion), [`Extras/Supabase`](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Supabase) (Supabase), [`Extras/Zep/pkg/server`](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep/pkg/server) (API server), [`Extras/Grafana/monitor-orion/grafana`](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Grafana/monitor-orion/grafana) (Grafana)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_installer["Installer"]
  node_setuporion["SetupOrion<br/>bootstrap script"]
  node_setup["Setup<br/>installer assets"]
end

subgraph group_platform["Shared platform"]
  node_edge(("Shared edge<br/>routing layer"))
  node_portainer["Portainer<br/>container manager"]
end

subgraph group_workloads["Service bundles"]
  node_supabase[("Supabase<br/>platform bundle")]
  node_supabase_gateway["Gateway<br/>[kong.yml]"]
  node_supabase_db[("Database<br/>postgres bootstrap")]
  node_supabase_functions["Functions"]
  node_supabase_logs["Logs<br/>vector config<br/>[vector.yml]"]
  node_supabase_pooler["Pooler<br/>connection pooling<br/>[pooler.exs]"]
  node_zep[("Zep<br/>LLM memory service")]
  node_zep_server["API server<br/>HTTP backend"]
  node_zep_store[("Postgres store<br/>persistence layer")]
  node_zep_tasks["Task pipeline<br/>async processing"]
  node_zep_llms["LLM providers<br/>model adapters"]
  node_zep_web["Admin UI<br/>server UI"]
  node_grafana["Grafana<br/>dashboards"]
  node_prometheus[("Prometheus<br/>metrics config")]
end

subgraph group_assets["Supporting assets"]
  node_chatwoot["Chatwoot emails<br/>template pack"]
  node_meets["Meets flows<br/>workflow exports"]
  node_krayin["Krayin config<br/>app config<br/>[app.php]"]
  node_videos["Video assets<br/>training material"]
end

node_setuporion -->|"boots"| node_setup
node_setuporion -->|"provisions"| node_edge
node_setuporion -->|"installs"| node_portainer
node_setuporion -->|"deploys"| node_supabase
node_setuporion -->|"deploys"| node_grafana
node_setuporion -->|"deploys"| node_zep
node_edge -->|"routes"| node_supabase
node_edge -->|"routes"| node_zep
node_edge -->|"routes"| node_grafana
node_supabase -->|"contains"| node_supabase_gateway
node_supabase -->|"centers"| node_supabase_db
node_supabase -->|"extends"| node_supabase_functions
node_supabase -->|"ships"| node_supabase_logs
node_supabase -->|"pools"| node_supabase_pooler
node_zep -->|"serves"| node_zep_server
node_zep_server -->|"persists"| node_zep_store
node_zep_server -->|"enqueues"| node_zep_tasks
node_zep_tasks -->|"calls"| node_zep_llms
node_zep_server -->|"renders"| node_zep_web
node_grafana -->|"reads"| node_prometheus
node_grafana -.->|"observes"| node_setuporion
node_chatwoot -.->|"seeds"| node_setuporion
node_meets -.->|"automates"| node_setuporion
node_krayin -.->|"configures"| node_setuporion
node_videos -.->|"documents"| node_supabase

click node_setuporion "https://github.com/oriondesign2015/setuporion/tree/main/SetupOrion"
click node_setup "https://github.com/oriondesign2015/setuporion/tree/main/Setup"
click node_supabase "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Supabase"
click node_supabase_gateway "https://github.com/oriondesign2015/setuporion/blob/main/Extras/Supabase/docker/volumes/api/kong.yml"
click node_supabase_db "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Supabase/docker/volumes/db"
click node_supabase_functions "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Supabase/docker/volumes/functions"
click node_supabase_logs "https://github.com/oriondesign2015/setuporion/blob/main/Extras/Supabase/docker/volumes/logs/vector.yml"
click node_supabase_pooler "https://github.com/oriondesign2015/setuporion/blob/main/Extras/Supabase/docker/volumes/pooler/pooler.exs"
click node_zep "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep"
click node_zep_server "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep/pkg/server"
click node_zep_store "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep/pkg/store/postgres"
click node_zep_tasks "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep/pkg/tasks"
click node_zep_llms "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep/pkg/llms"
click node_zep_web "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep/web"
click node_grafana "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Grafana/monitor-orion/grafana"
click node_prometheus "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Grafana/monitor-orion/prometheus"
click node_chatwoot "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Chatwoot/emails"
click node_meets "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Meets"
click node_krayin "https://github.com/oriondesign2015/setuporion/blob/main/Extras/Krayin/app.php"
click node_videos "https://github.com/oriondesign2015/setuporion/tree/main/Extras/Arquivos de Videos"

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_setuporion,node_setup toneBlue
class node_edge,node_portainer toneAmber
class node_supabase,node_supabase_gateway,node_supabase_db,node_supabase_functions,node_supabase_logs,node_supabase_pooler,node_zep,node_zep_server,node_zep_store,node_zep_tasks,node_zep_llms,node_zep_web,node_grafana,node_prometheus toneMint
class node_chatwoot,node_meets,node_krayin,node_videos toneRose
```

## Components

### Installer

Bootstrap and orchestration entrypoints for provisioning the stack.

- [SetupOrion](https://github.com/oriondesign2015/setuporion/tree/main/SetupOrion): bootstrap script · Remote entrypoint that starts provisioning on a VPS. · `SetupOrion`
- [Setup](https://github.com/oriondesign2015/setuporion/tree/main/Setup): installer assets · Supporting installer material and provisioning helpers. · `Setup`

### Shared platform

Common edge and management layer used by the deployed services.

- **Shared edge**: routing layer · Common container edge for ingress and cross-service access.
- **Portainer**: container manager · Container administration layer for deployed workloads.

### Service bundles

Self-hosted application stacks and their internal runtime components.

- [Supabase](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Supabase): platform bundle · Self-hosted backend platform deployed as multiple coordinated containers. · `Extras/Supabase`
- [Gateway](https://github.com/oriondesign2015/setuporion/blob/main/Extras/Supabase/docker/volumes/api/kong.yml): api gateway · Kong-based API edge for the Supabase stack. · `Extras/Supabase/docker/volumes/api/kong.yml`
- [Database](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Supabase/docker/volumes/db): postgres bootstrap · SQL initialization, roles, schemas, realtime, pooler, and webhook setup. · `Extras/Supabase/docker/volumes/db`
- [Functions](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Supabase/docker/volumes/functions): edge functions · TypeScript serverless functions bundled with the Supabase deployment. · `Extras/Supabase/docker/volumes/functions`
- [Logs](https://github.com/oriondesign2015/setuporion/blob/main/Extras/Supabase/docker/volumes/logs/vector.yml): vector config · Log shipping configuration for the Supabase stack. · `Extras/Supabase/docker/volumes/logs/vector.yml`
- [Pooler](https://github.com/oriondesign2015/setuporion/blob/main/Extras/Supabase/docker/volumes/pooler/pooler.exs): connection pooling · Database pooler configuration for Supabase connectivity. · `Extras/Supabase/docker/volumes/pooler/pooler.exs`
- [Zep](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep): LLM memory service · Full Go service for memory, documents, sessions, and admin UI. · `Extras/Zep`
- [API server](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep/pkg/server): HTTP backend · JWT-protected routes, middleware, and handlers for Zep APIs. · `Extras/Zep/pkg/server`
- [Postgres store](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep/pkg/store/postgres): persistence layer · Database-backed stores, schema, and migrations for Zep state. · `Extras/Zep/pkg/store/postgres`
- [Task pipeline](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep/pkg/tasks): async processing · Embedding, summarization, NER, intent analysis, and queue handling. · `Extras/Zep/pkg/tasks`
- [LLM providers](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep/pkg/llms): model adapters · OpenAI, Anthropic, and local embedding integrations. · `Extras/Zep/pkg/llms`
- [Admin UI](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Zep/web): server UI · Rendered web interface for collections, sessions, users, and settings. · `Extras/Zep/web`
- [Grafana](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Grafana/monitor-orion/grafana): dashboards · Provisioned dashboard and datasource layer for observability. · `Extras/Grafana/monitor-orion/grafana`
- [Prometheus](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Grafana/monitor-orion/prometheus): metrics config · Metrics collection configuration for monitoring the deployed stack. · `Extras/Grafana/monitor-orion/prometheus`

### Supporting assets

Templates, workflows, docs, and example materials used to seed or configure services.

- [Chatwoot emails](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Chatwoot/emails): template pack · Email templates for account and lifecycle events. · `Extras/Chatwoot/emails`
- [Meets flows](https://github.com/oriondesign2015/setuporion/tree/main/Extras/Meets): workflow exports · N8N and Typebot automation exports for onboarding and bot transfer flows. · `Extras/Meets`
- [Krayin config](https://github.com/oriondesign2015/setuporion/blob/main/Extras/Krayin/app.php): app config · Application-specific configuration artifact for Krayin. · `Extras/Krayin/app.php`
- [Video assets](https://github.com/oriondesign2015/setuporion/tree/HEAD/Extras/Arquivos%20de%20Videos): training material · Supporting media and example materials for Supabase and related workflows. · `Extras/Arquivos de Videos`

## Connections

- SetupOrion → Setup: boots · Installer entrypoint uses local setup assets and helpers.
- SetupOrion → Shared edge: provisions · Remote bootstrap prepares the shared routing layer.
- SetupOrion → Portainer: installs · Provisioning includes container management for the VPS.
- SetupOrion → Supabase: deploys · Installer can deploy the Supabase bundle.
- SetupOrion → Grafana: deploys · Installer can deploy observability components.
- SetupOrion → Zep: deploys · Installer can deploy the Zep service stack.
- Shared edge → Supabase: routes · Shared ingress exposes the app bundle.
- Shared edge → Zep: routes · Shared ingress exposes the Zep service.
- Shared edge → Grafana: routes · Shared ingress exposes dashboards and metrics UI.
- Supabase → Gateway: contains · Supabase API edge component.
- Supabase → Database: centers · Postgres initialization and service state are anchored here.
- Supabase → Functions: extends · Edge functions augment the platform API.
- Supabase → Logs: ships · Logs are handled through vector config.
- Supabase → Pooler: pools · Connection pooling is part of the bundle.
- Zep → API server: serves · HTTP backend handles API and route layers.
- API server → Postgres store: persists · Handlers read and write through Postgres stores.
- API server → Task pipeline: enqueues · Requests trigger async processing for embeddings and analysis.
- Task pipeline → LLM providers: calls · Task workers use LLM and embedding providers.
- API server → Admin UI: renders · Admin UI sits on top of the same backend services.
- Grafana → Prometheus: reads · Dashboards rely on metrics from Prometheus.
- Grafana → SetupOrion: observes · Monitoring bundle is intended to watch the provisioned stack.
- Chatwoot emails → SetupOrion: seeds · Email templates are consumed during setup or configuration.
- Meets flows → SetupOrion: automates · Workflow exports support adjacent automation around the installer.
- Krayin config → SetupOrion: configures · Application-specific config is bundled for installation support.
- Video assets → Supabase: documents · Training materials explain selected bundle usage.
