Skip to content

kittors/codeProxy

Repository files navigation

React Vite TypeScript Tailwind CSS Bun

πŸ–₯️ Code Proxy Β· Admin Dashboard

The official frontend management panel for CliRelay (CLI Proxy API)

Monitor, manage, and configure your CLI proxy channels β€” all from a modern web UI.

Stars Forks Issues License


✨ Overview

Code Proxy is the official web-based admin panel for CliRelay β€” a proxy server that wraps Gemini CLI, Antigravity, ChatGPT Codex, Claude Code, Qwen Code, Kiro, and iFlow as OpenAI/Gemini/Claude compatible API services.

This dashboard provides a complete management interface for your AI proxy infrastructure:

  • πŸ“Š Real-time Dashboard β€” KPI cards, health score, system monitoring, channel latency
  • πŸ“ˆ Advanced Monitoring Center β€” Model usage distribution, daily trends, hourly heatmaps with API Key filtering
  • πŸ“‹ Request Logs β€” Full request history with token counts, latency, status, and clickable error details
  • πŸ’¬ Message Viewer β€” Beautiful Markdown-rendered input/output content with XML tag collapsible sections
  • πŸ”— AI Provider Management β€” Multi-tab provider config (Gemini, Claude, Codex, Vertex, OpenAI, Ampcode) with enable/disable toggles
  • πŸ—‚οΈ Auth File Workspace β€” Saved OAuth/auth files with model inspection, prefix/proxy controls, and download actions
  • πŸ§ͺ OAuth Workbench β€” Provider-specific authorization launcher with remote callback submission
  • πŸ”‘ API Key Management β€” Create, edit, delete keys with quota & rate limit controls
  • πŸ” OAuth Login Management β€” Manage OAuth authentication credentials
  • πŸ“¦ Config Panel β€” Visual YAML configuration editor with import/export
  • 🎯 Model Management β€” Model alias mapping and routing rules
  • πŸ“Š Quota Management β€” Per-key usage quota tracking and limits
  • πŸ” API Key Lookup β€” Public self-service page for users to check their own usage statistics and request logs
  • πŸ’² Model Pricing β€” Built-in pricing table for quota cost accounting and per-model cost controls
  • ℹ️ System Info β€” Connection info grid, version/build metadata, model listing with colorful vendor icons and click-to-copy
  • πŸͺ΅ Live Logs β€” Streaming log viewer with search, download, clear, and runtime filter controls
  • πŸŒ™ Dark Mode β€” Full dark theme with smooth transitions
  • 🌐 i18n Ready β€” Internationalization support (Chinese, English)

πŸ“Έ Screenshots

The gallery below uses the latest 13 management-panel screenshots and maps each screen to its operational role.

Screen What it shows
Dashboard Overview KPI cards, health score, live system monitor, throughput, resource usage, latency ranking
Monitor Center Request KPIs, model distribution, daily token trends, API Key usage share
Request Logs Multi-filter log table, time range selector, status/channel/model filtering
Request Details Input/output viewer with Markdown rendering and instruction block inspection
AI Providers Multi-provider tabs, per-channel success rate, model tags, enable/edit/delete controls
Auth Files Saved auth file inventory with model inspection, proxy prefix controls, and download
OAuth Login Authorization launcher plus remote callback submission workflow
API Keys Keys, quotas, RPM/TPM, model permissions, channel bindings, quick actions
Models Pricing table for input/output/cache cost accounting
Quota Remaining refresh time and current usage bars for provider-specific quotas
Config YAML source editor with search and runtime mode switching
System API base, management endpoint, version metadata, API Key lookup link, model tags
Logs Live log console with search, download, clear, and toggleable filters

1. Dashboard Overview

Dashboard β€” KPI cards, health score, live system monitor, throughput, storage, and channel latency ranking.

2. Monitor Center

Monitor Center (Chinese locale) β€” request summary, model distribution, daily token/request trends, and API Key usage share.

3. Request Logs

Request Logs β€” time-range switcher, multi-filter toolbar, high-density table, and success metrics at a glance.

4. Request Details Viewer

Request Details β€” input/output tabs, Markdown rendering, collapsible sections, and copy/export helpers.

5. AI Providers

AI Providers β€” provider tabs, per-channel success/failure stats, model badges, latency bars, and CRUD actions.

6. Auth Files

Auth Files β€” card-based inventory for saved credentials with model inspection, rename, proxy-prefix, download, and delete actions.

7. OAuth Login Workbench

OAuth Login β€” provider-specific authorization launcher plus remote callback URL submission workflow.

8. API Keys Management

API Keys β€” quotas, RPM/TPM limits, model permissions, channel bindings, and quick analytics/edit actions.

9. Model Pricing

Models β€” built-in pricing catalog for input/output/cache cost calculation and quota accounting.

10. Quota Management

Quota β€” remaining refresh time and progress bars for Codex, Gemini CLI, Kiro, and other provider-specific quotas.

11. Config Editor

Config β€” source editor mode with YAML search, keyboard-friendly navigation, and runtime config switching.

12. System Info

System β€” API base, management endpoint, version/build metadata, API Key lookup entry, and vendor-colored model tags.

13. Live Logs

Logs β€” live stream viewer with keyword search, hide-management toggle, download, clear, and jump-to-latest controls.

🧩 Feature Details

πŸ“Š Dashboard

Module Description
KPI Cards Total requests, success rate, token consumption, failed request count (7-day / 30-day)
Health Score Real-time circular gauge (0–100) evaluating overall system health
System Monitor WebSocket-powered live stats: uptime, goroutines, CPU, memory, network I/O, DB size
Channel Latency Top 5 channel average latency with visual bar indicators
Resource Bars System CPU, memory, service CPU, memory, database size β€” color-coded status

πŸ“ˆ Monitor Center

Module Description
KPI Summary Total requests, success rate, total/output tokens with time range selection
Model Distribution Interactive donut chart showing Top 10 model usage by request count or token
Daily Trends Dual-axis chart with input/output tokens (bar) and request count (line) over time
Hourly Heatmap Stacked bar chart showing per-model hourly request distribution (6h / 12h / 24h)
API Key Filter Filter all metrics by specific API Key prefix

πŸ“‹ Request Logs

Module Description
Virtual Table High-performance virtual scrolling for 10,000+ log entries
Multi-Filter Filter by Key, model, status (success/fail), with time range selection
Token Details Click on input/output tokens to view full message content
Error Modal Click on "ε€±θ΄₯" (Failed) status to view error details in a red-themed modal
Message Viewer Markdown rendering with syntax highlighting, XML tag detection, and role-based collapsible blocks

πŸ”— AI Providers

Module Description
Multi-Tab Gemini, Claude, Codex, Vertex, OpenAI Compatible, Ampcode tabs
Channel Cards Name, masked API key, base URL, model count, success/fail stats, latency bar
CRUD Add, edit, delete channels with full configuration (proxyUrl, headers, model aliases, excluded models)
Toggle Enable/disable individual channels with instant visual feedback

πŸ” API Key Lookup

Module Description
Self-Service Public page (no login required) for end users to check their API Key usage
Usage Stats Per-key KPI cards, model distribution chart, daily trend chart
Request Logs Per-key request history with detailed virtual table and source channel info

πŸ› οΈ Tech Stack

Category Technology
Framework React 19.2 + TypeScript 5.9
Build Tool Vite 7.3
Package Manager Bun 1.2
Styling Tailwind CSS v4
State Management Zustand
Charts Apache ECharts
Routing React Router v7
HTTP Axios + WebSocket (real-time monitoring)
Icons Lucide React + Custom vendor SVGs (14 vendors)
Linting oxlint + oxfmt

πŸš€ Getting Started

Prerequisites

  • Bun β‰₯ 1.2 (or Node.js β‰₯ 18)
  • A running CliRelay backend instance

Install & Run

# Clone the repository
git clone https://github.com/kittors/codeProxy.git
cd codeProxy

# Install dependencies
bun install

# Start dev server
bun run dev

The dashboard will be available at http://localhost:5173/

Build for Production

# Type-check & build
bun run build

# Preview production build
bun run preview

πŸ“ Project Structure

src/
β”œβ”€β”€ app/                 # Routing & auth guards
β”œβ”€β”€ assets/icons/        # Vendor SVG icons (Claude, OpenAI, Gemini, etc.)
β”œβ”€β”€ components/ui/       # Inline SVG icon components
β”œβ”€β”€ i18n/                # i18next locales (en, zh-CN)
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ constants/       # App-wide constants
β”‚   └── http/            # Axios client, API layer, WebSocket
β”œβ”€β”€ modules/
β”‚   β”œβ”€β”€ auth/            # Authentication provider & session
β”‚   β”œβ”€β”€ apikey-lookup/   # Public API Key usage lookup
β”‚   β”œβ”€β”€ config/          # Visual config editor (YAML)
β”‚   β”œβ”€β”€ dashboard/       # Dashboard overview + system monitor
β”‚   β”œβ”€β”€ login/           # Login page
β”‚   β”œβ”€β”€ monitor/         # Monitoring center (charts, logs, modals)
β”‚   β”œβ”€β”€ oauth/           # OAuth management
β”‚   β”œβ”€β”€ providers/       # AI provider channel management
β”‚   β”œβ”€β”€ system/          # System info + model listing
β”‚   β”œβ”€β”€ ui/              # Shared UI (AppShell, Button, Table, Tabs, etc.)
β”‚   └── usage/           # Usage statistics & snapshot import/export
└── styles/              # Global styles & theme tokens

πŸ”Œ API Integration

This dashboard communicates with the CliRelay backend via the Management API:

Endpoint Method Description
/v0/management/config GET Verify login & fetch configuration
/v0/management/usage GET Retrieve usage statistics
/v0/management/usage/logs GET Paginated request log history
/v0/management/usage/log-content GET Full message content (input/output)
/v0/management/usage/dashboard-summary GET Dashboard KPI data
/v0/management/usage/model-distribution GET Model usage distribution
/v0/management/usage/daily-trends GET Daily token/request trends
/v0/management/usage/hourly-model GET Hourly per-model request data
/v0/management/openai-compatibility GET/POST/DELETE OpenAI channel CRUD
/v0/management/gemini-api-key GET/POST/DELETE Gemini channel CRUD
/v0/management/claude-api-key GET/POST/DELETE Claude channel CRUD
/v0/management/codex-api-key GET/POST/DELETE Codex channel CRUD
/v0/management/vertex-api-key GET/POST/DELETE Vertex channel CRUD
/v0/management/system-stats WebSocket Real-time system monitoring

Note: The API base is automatically normalized to {apiBase}/v0/management

For full backend API documentation, see the CliRelay Management API.

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ Related Projects

πŸ“ License

This project is open source. See the LICENSE file for details.


Made with ❀️ for the CliRelay community

About

πŸ–₯️ The official frontend management panel for CliRelay (CLI Proxy API)

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages