How ithtelab/workbuddy-manager works
WorkBuddy Manager is a web console and OpenAI-compatible gateway for operating workbuddy2api account pools. The main workflow is: an administrator enrolls and monitors accounts, configures keys and policies, then downstream clients send compatible requests through the gateway; the manager routes them to the selected upstream and records usage for logs and statistics. The README documents additional task automation, model discovery, settings, and update capabilities. Sampled source confirms the application entry point, authentication, account/upstream behavior, and UI state; several subsystem connections below follow documented responsibilities rather than inspected route implementations.
Main entry points: wb2api.py Upstream adapter · layout.tsx Management UI · db.py Manager database · page.tsx Tasks and logs
Components 25
Management console
- Management UI
web/app/(main)/layout.tsx - Login page
web/app/(auth)/login/page.tsx - Accounts
web/app/(main)/accounts/page.tsx - Keys
web/app/(main)/keys/page.tsx - Tasks and logs
web/app/(main)/tasks/page.tsx - Settings
web/app/(main)/settings/layout.tsx - Dashboard and stats
web/app/(main)/stats/page.tsx
Account operations
- Account API
server/routers/accounts.py - Task services
server/services/taskrun.py - Upstream adapter
server/services/wb2api.py
Gateway and policy
- Compatibility gateway
server/routers/gateway.py - Responses API
server/routers/responses.py - Anthropic API
server/routers/anthropic.py - Key management
server/routers/keys.py
Services and state
- Authentication API
server/routers/auth.py - Security services
server/security.py - Logs and statistics
server/routers/logs.py - Statistics API
server/routers/stats.py - Settings and upstreams
server/routers/settings.py - Model catalog API
server/routers/models.py - Update service
server/services/updater.py - Manager database
server/db.py
Other components
- Administrator
- API client
- workbuddy2api
Connections 33
- Administrator → Login page: signs in
- Administrator → Management UI: manages
- API client → Compatibility gateway: sends requests
- Management UI → Accounts: navigates
- Management UI → Keys: navigates
- Management UI → Tasks and logs: navigates
- Management UI → Settings: navigates
- Management UI → Dashboard and stats: navigates
- Login page → Authentication API: authenticates
- Accounts → Account API: manages accounts
- Keys → Key management: manages keys
- Tasks and logs → Logs and statistics: fetches records
- Tasks and logs → Task services: views tasks
- Settings → Settings and upstreams: reads and saves
- Dashboard and stats → Statistics API: fetches usage
- Authentication API → Security services: checks sessions
- Account API → Upstream adapter: manages pool
- Account API → Manager database: stores account data
- Task services → Manager database: records results
- Task services → Upstream adapter: runs account tasks
- Compatibility gateway → Key management: validates keys
- Compatibility gateway → Upstream adapter: forwards requests
- Responses API → Upstream adapter: forwards requests
- Anthropic API → Upstream adapter: forwards requests
- Key management → Manager database: stores key records
- Logs and statistics → Manager database: reads audit records
- Statistics API → Manager database: reads usage data
- Settings and upstreams → Manager database: stores settings
- Settings and upstreams → Upstream adapter: probes upstream
- Model catalog API → Upstream adapter: loads models
- Upstream adapter → workbuddy2api: calls upstream
- workbuddy2api → Upstream adapter: returns status
- Update service → Manager database: preserves manager data