⚡ proxui

Web UI and REST API for ProxySQL.
Code-generated from the ProxySQL source. Zero build step.
Table browser, SQL console, config sync, live stats.

99ProxySQL tables
0build steps
3config layers
12Klines generated

features

Everything you need to manage ProxySQL — in the browser.

Table Browser

Browse all 99 ProxySQL tables. Full CRUD for config tables. Resizable columns, inline editing, per-column filters, sortable headers. Empty tables greyed out.

SQL Console

CodeMirror editor with syntax highlighting and fuzzy tab completion. Query any target — admin, proxy port, MySQL/PostgreSQL backends. Schema tree sidebar.

Config Sync

Three-layer diff: Memory ↔ Runtime ↔ Disk. Git-style inline diffs with + ~ indicators. Apply, Save, Discard — one click.

📊

Live Dashboard

Real-time charts: connections, QPS, connection pool, memory. Command counters and top query digests. 5-second polling, 10-minute rolling window.

🔑

Authentication

Login with ProxySQL admin credentials. Server-side sessions — no passwords in cookies. Audit logging for queries and config changes.

Code-Generated

The entire API is generated from ProxySQL's C header file. Re-run the generator after a ProxySQL update to stay in sync. 163 Pydantic models, 282 routes.

screenshots

Dark theme, monospace everything, zero build tooling.

proxui dashboard with live stats charts
Live dashboard — connections, QPS, connection pool, memory usage. Polls every 5 seconds.
proxui table browser with mysql_servers
Table browser — categorized sidebar, resizable columns, inline editing, config sync buttons.
proxui SQL query console
SQL console — CodeMirror editor, auto-discovered targets, schema tree, sortable results.
proxui login page
Login — authenticates against ProxySQL admin port. No separate user database.

how it works

Code generation from C headers → FastAPI → Alpine.js SPA.

01

Parse C header

gen_fastapi_models.py reads ProxySQL's ProxySQL_Admin_Tables_Definitions.h — resolves #define alias chains, extracts every CREATE TABLE, parses columns, types, PKs, defaults, CHECK constraints.

02

Generate Python

Produces 5 files: Pydantic models, CRUD router (GET/POST/PUT/DELETE per table), table metadata, connection pool, and the FastAPI app with config sync, query engine, schema browser.

03

Connect via MySQL protocol

Talks to ProxySQL's admin port (6032) using aiomysql. No C++ linkage needed. Auto-discovers proxy ports, backend servers, and credentials from ProxySQL's own state.

04

Serve the UI

Alpine.js + Pico CSS SPA served as static files. No npm, no webpack, no build step. CodeMirror for SQL editing, uPlot for charts. Everything from CDN.

┌──────────────┐       ┌────────────────┐       ┌────────────────┐
│   Browser    │─────▶│  proxui :8080  │─────▶│ ProxySQL :6032 │
│   Alpine.js  │  REST │  FastAPI       │ MySQL │ admin iface    │
└──────────────┘       └────────────────┘       └────────────────┘
                                                       │
                                           ┌───────────┴───────────┐
                                           ▼                       ▼
                                    ┌────────────┐          ┌────────────┐
                                    │   MySQL    │          │ PostgreSQL │
                                    │  backends  │          │  backends  │
                                    └────────────┘          └────────────┘

config sync

ProxySQL's three-layer configuration model, visualized.

  DISK  ←── Save ───  MEMORY  ─── Apply ──→  RUNTIME
                         ↑                       │
                         └─────── Discard ───────┘
MEMORY — the tables you edit in the UI
RUNTIME — what ProxySQL is actively using
DISK — persisted to SQLite, survives restart

Inline diffs

Toggle the Diff view to see memory vs runtime side-by-side. Changed columns are bold. Git-style indicators: + new, ~ changed, deleted.

Smart buttons

Apply pushes memory → runtime. Save persists to disk. Discard reverts memory to match runtime. Buttons light up only when there's a difference.

Bottom bar

Shows "Unapplied changes" or "Unsaved to disk" with clickable pills to jump to the affected table. Disappears when everything is in sync.

security

Designed for internal admin use, not public internet exposure.

🔒 Server-side sessions

Cookie contains only an HMAC-signed session ID. Credentials stored in memory on the server, never sent to the client.

🚫 No CORS

UI served same-origin. No cross-origin access. No CSRF via CORS+credentials vector.

📝 Audit logging

Every login, SQL query, and config action logged with username. Queries truncated to 200 chars in logs.

🧹 Session cleanup

Connection pools destroyed on logout. Sessions invalidated on server restart (secret regenerates).

quick start

# Clone and set up
git clone https://github.com/artw/proxui
cd proxui
just all                # venv + deps + generate from C header

# Test bench (needs podman)
just bench-up           # MySQL 8.4 + PostgreSQL 17 + ProxySQL 3.0
just bench-run          # build + run proxui on same network

# Open in browser
open http://localhost:8080   # login: radmin / radmin
# Point at your own ProxySQL
PROXYSQL_ADMIN_HOST=10.0.0.1 \
PROXYSQL_ADMIN_PORT=6032 \
just run