How code-leafy/v2leafy works
V2Leafy is a single-process FastAPI dashboard and VLESS-over-WebSocket gateway. The main workflow is browser login, client and subscription management, then using generated links to connect through the gateway; the dashboard also receives live usage and status. The backend is concentrated in main.py, so its distinct responsibilities are shown as components sharing that implementation path. README documents several dashboard capabilities whose individual handlers are outside the excerpts; those links are cited to the README. The excerpts do not expose all frontend or handler wiring.
Main entry points: main.py HTTP app · index.html Dashboard UI
Components 16
Dashboard
- Dashboard UI
index.html - HTTP app
main.py
Management
- Password and sessions
main.py - Client profiles
main.py - Subscription builder
main.py - VLESS link generation
main.py
Gateway
- Gateway controls
main.py - WebSocket VLESS tunnel
main.py
Runtime
- State manager
main.py - Runtime state
main.py - Live analytics
main.py - Logs and alerts
main.py
Other components
- Admin browser
- VLESS client
- Railway / Codespaces
- Alert destination
Connections 15
- Admin browser → Dashboard UI: opens
README.md - HTTP app → Dashboard UI: serves
main.py - Dashboard UI → HTTP app: uses dashboard
README.md - HTTP app → Password and sessions: checks sessions
main.py - HTTP app → Client profiles: manages clients
README.md - HTTP app → Subscription builder: builds layouts
README.md - HTTP app → VLESS link generation: generates links
main.py - HTTP app → State manager: uses state
main.py - State manager → Runtime state: loads and saves
main.py - Dashboard UI → Gateway controls: controls gateway
README.md - VLESS client → WebSocket VLESS tunnel: opens tunnel
main.py - Dashboard UI → Live analytics: receives live metrics
README.md - Dashboard UI → Logs and alerts: views logs
README.md - Logs and alerts → Alert destination: posts alerts
main.py - Railway / Codespaces → HTTP app: hosts service
README.md