feat: scaffold operator-first 3proxy panel ui

This commit is contained in:
2026-04-01 22:52:38 +03:00
commit 0d035f3278
26 changed files with 3674 additions and 0 deletions

20
docs/PLAN.md Normal file
View File

@@ -0,0 +1,20 @@
# Plan
Updated: 2026-04-01
## Active
1. Present the UI-first slice for approval, then replace mocks with runtime-backed 3proxy control flows.
## Next
1. Replace mocks with a backend control plane for config generation, process management, counters, and health checks.
2. Add Docker runtime with 3proxy, panel server, health checks, and reload/start/restart operations.
3. Extend tests to cover config rendering, unsafe input handling, and runtime failure scenarios.
## Done
1. Researched official 3proxy documentation for config scripting, services, counters, reports, auth, and reload hooks.
2. Initialized the repository and established autonomous agent workflow rules.
3. Implemented the first UI slice with hardcoded panel auth, operator-focused dashboard, users table, and system config preview.
4. Added paranoia-oriented tests for login gating, proxy link encoding, quota edge cases, and traffic share formatting.

31
docs/PROJECT_INDEX.md Normal file
View File

@@ -0,0 +1,31 @@
# Project Index
Updated: 2026-04-01
## Root
- `AGENTS.md`: repository workflow rules for autonomous contributors
- `README.md`: quick start and current project scope
- `package.json`: frontend scripts and dependencies
- `vite.config.ts`: Vite + Vitest configuration
## Documentation
- `docs/PLAN.md`: living implementation plan
- `docs/PROJECT_INDEX.md`: this index
- `docs/RESEARCH_3PROXY.md`: notes from official 3proxy documentation
## Frontend
- `src/main.tsx`: application bootstrap
- `src/App.tsx`: authenticated panel shell and tab composition
- `src/App.test.tsx`: login-gate component tests
- `src/app.css`: full panel styling
- `src/data/mockDashboard.ts`: realistic mock state shaped for future API responses
- `src/lib/3proxy.ts`: formatting and status helpers
- `src/lib/3proxy.test.ts`: paranoia-oriented tests for core domain rules
- `src/test/setup.ts`: Testing Library matchers
## Static
- `public/favicon.svg`: Vite default icon placeholder, to replace later

20
docs/RESEARCH_3PROXY.md Normal file
View File

@@ -0,0 +1,20 @@
# 3proxy Official Notes
Updated: 2026-04-01
Sources:
- [3proxy configuration reference](https://github.com/3proxy/3proxy/wiki/3proxy.cfg)
- [3proxy how-to documentation](https://3proxy.org/doc/howtoe.html)
- [3proxy man page](https://3proxy.org/doc/man8/3proxy.8.html)
## Relevant findings
1. `3proxy.cfg` is an executable-style script where command order matters, so the panel should generate config deterministically and preserve service ordering.
2. Services such as `socks`, `proxy`, `admin`, `dnspr`, `tcppm`, and `udppm` are started directly from config lines, making a structured config editor practical.
3. User auth is officially handled through `auth strong` and `users username:pwtype:password`; this maps cleanly to a user-management UI.
4. ACLs are reset with `flush`, which means a visual config builder should make service-level ACL boundaries explicit.
5. Traffic limits are handled through `counter`, `countin`, `countout`, and `countall`, with optional text reports generated from the counter file. This is the right base for quota support and usage reporting.
6. Built-in logging supports custom `logformat`, including `%U`, `%I`, `%O`, `%n`, `%E`, and timestamps. That provides a future path for richer analytics if counters are not enough.
7. `monitor <filename>` can trigger config reload on file changes, and the man page documents signal-based reload behavior, so the runtime layer should favor graceful reload over brute-force restarts where possible.
8. The `admin` service exists, but it should not be the primary control surface for this project. The panel should own config generation and use admin endpoints only when they provide safe, official visibility.