How kazeyukiro/3m-ui works
3m-ui is a self-hosted Mihomo server management panel. An administrator signs in through the browser, then manages listeners, users, routing, subscriptions, traffic, cluster peers, and operations; the backend exposes REST APIs and configures the Mihomo core. The graph preserves these documented product branches, plus persistence and certificate handling. Source excerpts show application startup, frontend routing, and selected UI/API interactions; several backend service links and unsampled feature implementations are represented only at the level documented in the README.
Main entry points: router.go Gin REST API · App.tsx Admin pages · client.ts API client · database.go SQLite database
Components 25
Admin interface
- Admin pages
frontend/src/App.tsx - Auth state
frontend/src/stores/authStore.ts - API client
frontend/src/api/client.ts - Listener management
frontend/src/pages/Listeners.tsx - User management
frontend/src/pages/Users.tsx - Routing editor
frontend/src/pages/Routing.tsx - Cluster management
frontend/src/pages/Cluster.tsx - Operations pages
frontend/src/pages/Settings.tsx
Panel services
- Gin REST API
backend/internal/router/router.go - Authentication
backend/internal/auth/api.go - Listener service
backend/internal/listener/service.go - User service
backend/internal/user/service.go - Subscription conversion
backend/internal/converter/client.go - Traffic accounting
backend/internal/traffic/service.go - Cluster service
backend/internal/cluster/service.go - System operations
backend/internal/system/service.go - Telegram management
backend/internal/telegram/bot.go - Panel server
backend/internal/app/app.go
Mihomo runtime
- Routing config
backend/internal/mihomo/config/server_routing.go - Mihomo manager
backend/internal/mihomo/manager.go
Persistent state
- SQLite database
backend/internal/database/database.go - Certificate store
backend/internal/certstore/store.go
Other components
- Administrator
- Mihomo core
- Telegram service
Connections 36
- Administrator → Admin pages: uses
- Admin pages → Auth state: tracks session
frontend/src/App.tsx - Admin pages → Listener management: routes to
frontend/src/App.tsx - Admin pages → User management: routes to
frontend/src/App.tsx - Admin pages → Routing editor: routes to
frontend/src/App.tsx - Admin pages → Cluster management: routes to
frontend/src/App.tsx - Admin pages → Operations pages: routes to
frontend/src/App.tsx - Listener management → API client: requests through
frontend/src/pages/Listeners.tsx - User management → API client: requests through
- Routing editor → API client: requests through
frontend/src/pages/Routing.tsx - Cluster management → API client: requests through
frontend/src/pages/Cluster.tsx - Operations pages → API client: requests through
- API client → Gin REST API: calls REST
- Panel server → Gin REST API: mounts routes
backend/internal/app/app.go - Gin REST API → Authentication: serves authentication
- Gin REST API → Listener service: serves listener APIs
- Gin REST API → User service: serves user APIs
- Gin REST API → Subscription conversion: serves subscriptions
- Gin REST API → Traffic accounting: serves traffic APIs
- Gin REST API → Cluster service: serves cluster APIs
- Gin REST API → Routing config: serves routing APIs
- Gin REST API → System operations: serves operations
- Telegram service → Telegram management: provides bot
- Listener service → SQLite database: reads and writes
backend/internal/listener/service.go - User service → SQLite database: reads and writes
backend/internal/user/service.go - Traffic accounting → SQLite database: persists usage
- Cluster service → SQLite database: stores peers
backend/internal/cluster/service.go - Subscription conversion → SQLite database: loads user data
backend/internal/converter/client.go - Listener service → Certificate store: uses certificates
- Panel server → Certificate store: hydrates certificates
backend/internal/app/app.go - Panel server → Mihomo manager: starts panel runtime
- Mihomo manager → Mihomo core: manages core
- Routing config → SQLite database: loads routing data
backend/internal/mihomo/config/server_routing.go - Mihomo manager → Routing config: applies config
- System operations → Mihomo manager: controls core
- Panel server → Telegram service: integrates optionally