# router-for-me/easycliproxyapi architecture

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

- Interactive diagram: https://gitdiagram.com/router-for-me/easycliproxyapi
- Repository: https://github.com/router-for-me/easycliproxyapi

## Overview

EasyCLIProxyAPI is a Tauri/React desktop console for managing a local CLIProxyAPI core. Users install or update the core, start it from Home, then configure providers or OAuth and use the local API; the console also manages credentials, quotas, usage, plugins, and agent clients. The graph preserves these documented product areas and the Codex session workflow. Source excerpts are incomplete, so some subsystem links rely on README descriptions rather than inspected implementation calls.

Main entry points: [`src/App.tsx`](https://github.com/router-for-me/easycliproxyapi/blob/main/src/App.tsx) (Console navigation), [`src-tauri/src/core_runtime.rs`](https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/core_runtime.rs) (CLIProxyAPI core), [`src/pages/ApiAccessPage.tsx`](https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/ApiAccessPage.tsx) (Provider workspace), [`src/services/managementApi.ts`](https://github.com/router-for-me/easycliproxyapi/blob/main/src/services/managementApi.ts) (Management API bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop console"]
  node_app["Console navigation<br/>[App.tsx]"]
  node_home["Home dashboard<br/>[Kernel.tsx]"]
  node_plugins["Plugin management<br/>[PluginsPage.tsx]"]
  node_pluginresources["Plugin pages"]
end

subgraph group_runtime["Core lifecycle"]
  node_version["Version management"]
  node_core["CLIProxyAPI core<br/>[core_runtime.rs]"]
  node_settings["Core settings<br/>[aliases.rs]"]
end

subgraph group_providers["Providers and credentials"]
  node_oauth["OAuth authorization<br/>[native_oauth.rs]"]
  node_providerui["Provider workspace<br/>[ApiAccessPage.tsx]"]
  node_management["Management API bridge<br/>[managementApi.ts]"]
  node_authfiles["Credential files<br/>[authFiles.ts]"]
  node_quotas["Quota inspection<br/>[quotaService.ts]"]
end

subgraph group_insights["Usage and agents"]
  node_usageui["Usage analytics"]
  node_usagebackend["Usage collection<br/>[usage.rs]"]
  node_agentsui["Agent configuration<br/>[AgentsPage.tsx]"]
  node_agentbackend["Agent configuration and launch<br/>[commands.rs]"]
  node_catalog["Codex model catalog<br/>[codex_catalog.rs]"]
  node_sessions["Codex sessions<br/>[codex_sessions.rs]"]
  node_sessioneditor["Session context editor"]
end

node_user(("Desktop user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_version
node_app -->|"routes to"| node_providerui
node_app -->|"routes to"| node_plugins
node_app -->|"routes to"| node_usageui
node_app -->|"routes to"| node_agentsui
node_app -->|"routes to"| node_sessioneditor
node_home -->|"controls lifecycle"| node_core
node_version -->|"installs and updates"| node_core
node_providerui -->|"sends requests"| node_management
node_management -->|"calls local API"| node_core
node_oauth -->|"completes callback"| node_core
node_providerui -->|"starts authorization"| node_oauth
node_management -->|"manages files"| node_authfiles
node_authfiles -->|"provides credentials"| node_quotas
node_plugins -->|"opens plugin pages"| node_pluginresources
node_usageui -->|"reviews collected activity"| node_usagebackend
node_agentsui -->|"configures clients"| node_agentbackend
node_agentbackend -->|"synchronizes models"| node_catalog
node_sessioneditor -->|"edits session context"| node_sessions
node_sessions -->|"returns session data"| node_sessioneditor
node_settings -.->|"configures"| node_core

click node_app "https://github.com/router-for-me/easycliproxyapi/blob/main/src/App.tsx"
click node_home "https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/Kernel.tsx"
click node_version "https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/VersionManagementPage.tsx"
click node_core "https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/core_runtime.rs"
click node_settings "https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/core_config/aliases.rs"
click node_oauth "https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/agents/native_oauth.rs"
click node_providerui "https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/ApiAccessPage.tsx"
click node_management "https://github.com/router-for-me/easycliproxyapi/blob/main/src/services/managementApi.ts"
click node_authfiles "https://github.com/router-for-me/easycliproxyapi/blob/main/src/services/authFiles.ts"
click node_quotas "https://github.com/router-for-me/easycliproxyapi/blob/main/src/services/quotaService.ts"
click node_plugins "https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/PluginsPage.tsx"
click node_pluginresources "https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/PluginResourcePage.tsx"
click node_usageui "https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/UsageRecordsPage.tsx"
click node_usagebackend "https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/usage.rs"
click node_agentsui "https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/AgentsPage.tsx"
click node_agentbackend "https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/agents/commands.rs"
click node_catalog "https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/codex_catalog.rs"
click node_sessions "https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/codex_sessions.rs"
click node_sessioneditor "https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/CodexSessionContextEditor.tsx"

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_app,node_home,node_plugins,node_pluginresources,node_user toneBlue
class node_version,node_core,node_settings toneAmber
class node_oauth,node_providerui,node_management,node_authfiles,node_quotas toneMint
class node_usageui,node_usagebackend,node_agentsui,node_agentbackend,node_catalog,node_sessions,node_sessioneditor toneRose
```

## Components

### Desktop console

- [Console navigation](https://github.com/router-for-me/easycliproxyapi/blob/main/src/App.tsx): `src/App.tsx`
- [Home dashboard](https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/Kernel.tsx): `src/pages/Kernel.tsx`
- [Plugin management](https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/PluginsPage.tsx): `src/pages/PluginsPage.tsx`
- [Plugin pages](https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/PluginResourcePage.tsx): `src/pages/PluginResourcePage.tsx`

### Core lifecycle

- [Version management](https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/VersionManagementPage.tsx): `src/pages/VersionManagementPage.tsx`
- [CLIProxyAPI core](https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/core_runtime.rs): `src-tauri/src/core_runtime.rs`
- [Core settings](https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/core_config/aliases.rs): `src-tauri/src/core_config/aliases.rs`

### Providers and credentials

- [OAuth authorization](https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/agents/native_oauth.rs): `src-tauri/src/agents/native_oauth.rs`
- [Provider workspace](https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/ApiAccessPage.tsx): `src/pages/ApiAccessPage.tsx`
- [Management API bridge](https://github.com/router-for-me/easycliproxyapi/blob/main/src/services/managementApi.ts): `src/services/managementApi.ts`
- [Credential files](https://github.com/router-for-me/easycliproxyapi/blob/main/src/services/authFiles.ts): `src/services/authFiles.ts`
- [Quota inspection](https://github.com/router-for-me/easycliproxyapi/blob/main/src/services/quotaService.ts): `src/services/quotaService.ts`

### Usage and agents

- [Usage analytics](https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/UsageRecordsPage.tsx): `src/pages/UsageRecordsPage.tsx`
- [Usage collection](https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/usage.rs): `src-tauri/src/usage.rs`
- [Agent configuration](https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/AgentsPage.tsx): `src/pages/AgentsPage.tsx`
- [Agent configuration and launch](https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/agents/commands.rs): `src-tauri/src/agents/commands.rs`
- [Codex model catalog](https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/codex_catalog.rs): `src-tauri/src/codex_catalog.rs`
- [Codex sessions](https://github.com/router-for-me/easycliproxyapi/blob/main/src-tauri/src/codex_sessions.rs): `src-tauri/src/codex_sessions.rs`
- [Session context editor](https://github.com/router-for-me/easycliproxyapi/blob/main/src/pages/CodexSessionContextEditor.tsx): `src/pages/CodexSessionContextEditor.tsx`

### Other components

- **Desktop user**

## Connections

- Desktop user → Console navigation: uses (evidence: `README.md`)
- Console navigation → Home dashboard: routes to (evidence: `src/App.tsx`)
- Console navigation → Version management: routes to (evidence: `src/App.tsx`)
- Console navigation → Provider workspace: routes to (evidence: `src/App.tsx`)
- Console navigation → Plugin management: routes to (evidence: `src/App.tsx`)
- Console navigation → Usage analytics: routes to (evidence: `src/App.tsx`)
- Console navigation → Agent configuration: routes to (evidence: `src/App.tsx`)
- Console navigation → Session context editor: routes to (evidence: `src/App.tsx`)
- Home dashboard → CLIProxyAPI core: controls lifecycle (evidence: `README.md`)
- Version management → CLIProxyAPI core: installs and updates (evidence: `README.md`)
- Provider workspace → Management API bridge: sends requests (evidence: `README.md`)
- Management API bridge → CLIProxyAPI core: calls local API (evidence: `src/services/managementApi.ts`)
- OAuth authorization → CLIProxyAPI core: completes callback (evidence: `README.md`)
- Provider workspace → OAuth authorization: starts authorization (evidence: `README.md`)
- Management API bridge → Credential files: manages files (evidence: `src/services/authFiles.ts`)
- Credential files → Quota inspection: provides credentials (evidence: `src/services/quotaService.ts`)
- Plugin management → Plugin pages: opens plugin pages (evidence: `README.md`)
- Usage analytics → Usage collection: reviews collected activity (evidence: `README.md`)
- Agent configuration → Agent configuration and launch: configures clients (evidence: `README.md`)
- Agent configuration and launch → Codex model catalog: synchronizes models (evidence: `README.md`)
- Session context editor → Codex sessions: edits session context (evidence: `README.md`)
- Codex sessions → Session context editor: returns session data (evidence: `README.md`)
- Core settings → CLIProxyAPI core: configures
