# lackx741-tech/aegion architecture

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

- Interactive diagram: https://gitdiagram.com/lackx741-tech/aegion
- Repository: https://github.com/lackx741-tech/aegion

## Overview

The repository presents Legion Engine as an API-first, multi-chain asset orchestration platform, alongside campaign, trading, and administration interfaces. A user-facing workflow visible in the sampled code is managing campaigns in the dashboard: the app loads campaign and statistics data, submits create or rotate actions through its API client, and refreshes its displayed state. The graph focuses on documented interface and configuration surfaces; it does not map the README’s extraction and execution capabilities because their implementation was not sampled. Connections are limited to relationships visible in the excerpts or SOURCE INDEX.

Main entry points: [`apps/dashboard/src/App.tsx`](https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/App.tsx) (Campaign App), [`apps/master-dashboard/src/App.js`](https://github.com/lackx741-tech/aegion/blob/main/apps/master-dashboard/src/App.js) (Master Console), [`apps/dashboard/src/pages/CurveFinance.tsx`](https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/pages/CurveFinance.tsx) (Curve Finance), [`packages/sovereign-admin/src/app/api/command-center/engine-config/route.ts`](https://github.com/lackx741-tech/aegion/blob/main/packages/sovereign-admin/src/app/api/command-center/engine-config/route.ts) (Engine Config API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_campaign["Campaign Dashboard"]
  node_campaign_app["Campaign App<br/>[App.tsx]"]
  node_campaign_api["Campaign API Client<br/>[api.ts]"]
  node_campaign_table["Campaign Table<br/>[CampaignTable.tsx]"]
  node_campaign_create["Create Campaign"]
end

subgraph group_admin["Administration"]
  node_master_app["Master Console<br/>[App.js]"]
  node_master_layout["Console Layout<br/>[Layout.tsx]"]
  node_master_login["Console Login<br/>[Login.tsx]"]
  node_master_dashboard["Console Dashboard<br/>[Dashboard.tsx]"]
  node_legion_tool["Legion Tool<br/>[LegionTool.tsx]"]
  node_engine_config["Engine Config API<br/>[route.ts]"]
end

subgraph group_trading["Trading Interfaces"]
  node_curve_page["Curve Finance<br/>[CurveFinance.tsx]"]
  node_curve_pool["Pool Selector<br/>[PoolSelector.tsx]"]
  node_curve_swap["Swap Interface<br/>[SwapInterface.tsx]"]
  node_curve_liquidity["Liquidity Provider"]
  node_curve_farming["Yield Farming<br/>[YieldFarming.tsx]"]
end

node_operator(("Operator"))
node_supabase_auth["Supabase Auth"]
node_supabase_store[("Supabase Store")]
node_core_config["Remote Config"]

node_operator -->|"manages"| node_campaign_app
node_campaign_app -->|"requests data"| node_campaign_api
node_campaign_app -->|"renders"| node_campaign_table
node_campaign_app -->|"opens"| node_campaign_create
node_campaign_app -->|"renders"| node_curve_page
node_curve_page -->|"renders"| node_curve_pool
node_curve_page -->|"renders"| node_curve_swap
node_curve_page -->|"renders"| node_curve_liquidity
node_curve_page -->|"renders"| node_curve_farming
node_operator -->|"uses"| node_master_app
node_master_app -->|"renders"| node_master_layout
node_master_app -->|"routes to"| node_master_login
node_master_app -->|"routes to"| node_master_dashboard
node_master_app -->|"routes to"| node_legion_tool
node_operator -.->|"requests overrides"| node_engine_config
node_engine_config -->|"checks identity"| node_supabase_auth
node_engine_config -->|"reads and writes"| node_supabase_store
node_engine_config -->|"invalidates cache"| node_core_config

click node_campaign_app "https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/App.tsx"
click node_campaign_api "https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/api.ts"
click node_campaign_table "https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/components/CampaignTable.tsx"
click node_campaign_create "https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/components/CreateCampaignModal.tsx"
click node_curve_page "https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/pages/CurveFinance.tsx"
click node_curve_pool "https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/components/curve/PoolSelector.tsx"
click node_curve_swap "https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/components/curve/SwapInterface.tsx"
click node_curve_liquidity "https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/components/curve/LiquidityProvider.tsx"
click node_curve_farming "https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/components/curve/YieldFarming.tsx"
click node_master_app "https://github.com/lackx741-tech/aegion/blob/main/apps/master-dashboard/src/App.js"
click node_master_layout "https://github.com/lackx741-tech/aegion/blob/main/apps/master-dashboard/src/components/Layout.tsx"
click node_master_login "https://github.com/lackx741-tech/aegion/blob/main/apps/master-dashboard/src/pages/Login.tsx"
click node_master_dashboard "https://github.com/lackx741-tech/aegion/blob/main/apps/master-dashboard/src/pages/Dashboard.tsx"
click node_legion_tool "https://github.com/lackx741-tech/aegion/blob/main/apps/master-dashboard/src/pages/LegionTool.tsx"
click node_engine_config "https://github.com/lackx741-tech/aegion/blob/main/packages/sovereign-admin/src/app/api/command-center/engine-config/route.ts"
click node_core_config "https://github.com/lackx741-tech/aegion/blob/main/packages/core/src/config/sovereign-engine-config-defaults.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_campaign_app,node_campaign_api,node_campaign_table,node_campaign_create toneBlue
class node_master_app,node_master_layout,node_master_login,node_master_dashboard,node_legion_tool,node_engine_config,node_supabase_store toneAmber
class node_curve_page,node_curve_pool,node_curve_swap,node_curve_liquidity,node_curve_farming toneMint
class node_operator,node_supabase_auth toneIndigo
class node_core_config toneTeal
```

## Components

### Campaign Dashboard

- [Campaign App](https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/App.tsx): `apps/dashboard/src/App.tsx`
- [Campaign API Client](https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/api.ts): `apps/dashboard/src/api.ts`
- [Campaign Table](https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/components/CampaignTable.tsx): `apps/dashboard/src/components/CampaignTable.tsx`
- [Create Campaign](https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/components/CreateCampaignModal.tsx): `apps/dashboard/src/components/CreateCampaignModal.tsx`

### Administration

- [Master Console](https://github.com/lackx741-tech/aegion/blob/main/apps/master-dashboard/src/App.js): `apps/master-dashboard/src/App.js`
- [Console Layout](https://github.com/lackx741-tech/aegion/blob/main/apps/master-dashboard/src/components/Layout.tsx): `apps/master-dashboard/src/components/Layout.tsx`
- [Console Login](https://github.com/lackx741-tech/aegion/blob/main/apps/master-dashboard/src/pages/Login.tsx): `apps/master-dashboard/src/pages/Login.tsx`
- [Console Dashboard](https://github.com/lackx741-tech/aegion/blob/main/apps/master-dashboard/src/pages/Dashboard.tsx): `apps/master-dashboard/src/pages/Dashboard.tsx`
- [Legion Tool](https://github.com/lackx741-tech/aegion/blob/main/apps/master-dashboard/src/pages/LegionTool.tsx): `apps/master-dashboard/src/pages/LegionTool.tsx`
- [Engine Config API](https://github.com/lackx741-tech/aegion/blob/main/packages/sovereign-admin/src/app/api/command-center/engine-config/route.ts): `packages/sovereign-admin/src/app/api/command-center/engine-config/route.ts`

### Trading Interfaces

- [Curve Finance](https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/pages/CurveFinance.tsx): `apps/dashboard/src/pages/CurveFinance.tsx`
- [Pool Selector](https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/components/curve/PoolSelector.tsx): `apps/dashboard/src/components/curve/PoolSelector.tsx`
- [Swap Interface](https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/components/curve/SwapInterface.tsx): `apps/dashboard/src/components/curve/SwapInterface.tsx`
- [Liquidity Provider](https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/components/curve/LiquidityProvider.tsx): `apps/dashboard/src/components/curve/LiquidityProvider.tsx`
- [Yield Farming](https://github.com/lackx741-tech/aegion/blob/main/apps/dashboard/src/components/curve/YieldFarming.tsx): `apps/dashboard/src/components/curve/YieldFarming.tsx`

### Other components

- **Operator**
- **Supabase Auth**
- **Supabase Store**
- [Remote Config](https://github.com/lackx741-tech/aegion/blob/main/packages/core/src/config/sovereign-engine-config-defaults.ts): `packages/core/src/config/sovereign-engine-config-defaults.ts`

## Connections

- Operator → Campaign App: manages
- Campaign App → Campaign API Client: requests data (evidence: `apps/dashboard/src/App.tsx`)
- Campaign App → Campaign Table: renders (evidence: `apps/dashboard/src/App.tsx`)
- Campaign App → Create Campaign: opens (evidence: `apps/dashboard/src/App.tsx`)
- Campaign App → Curve Finance: renders (evidence: `apps/dashboard/src/App.tsx`)
- Curve Finance → Pool Selector: renders (evidence: `apps/dashboard/src/pages/CurveFinance.tsx`)
- Curve Finance → Swap Interface: renders (evidence: `apps/dashboard/src/pages/CurveFinance.tsx`)
- Curve Finance → Liquidity Provider: renders (evidence: `apps/dashboard/src/pages/CurveFinance.tsx`)
- Curve Finance → Yield Farming: renders (evidence: `apps/dashboard/src/pages/CurveFinance.tsx`)
- Operator → Master Console: uses
- Master Console → Console Layout: renders (evidence: `apps/master-dashboard/src/App.js`)
- Master Console → Console Login: routes to (evidence: `apps/master-dashboard/src/App.js`)
- Master Console → Console Dashboard: routes to (evidence: `apps/master-dashboard/src/App.js`)
- Master Console → Legion Tool: routes to (evidence: `apps/master-dashboard/src/App.js`)
- Operator → Engine Config API: requests overrides
- Engine Config API → Supabase Auth: checks identity (evidence: `packages/sovereign-admin/src/app/api/command-center/engine-config/route.ts`)
- Engine Config API → Supabase Store: reads and writes (evidence: `packages/sovereign-admin/src/app/api/command-center/engine-config/route.ts`)
- Engine Config API → Remote Config: invalidates cache (evidence: `packages/sovereign-admin/src/app/api/command-center/engine-config/route.ts`)
