How git-agni/prod-farm-ios-core works
Phone Farm iOS is a dashboard/API and worker application for registering physical iPhones and running versioned, scheduled TikTok workflows. Operators register devices and create schedules; the scheduler persists and queues due executions, workers run plugin tasks against devices, and the dashboard exposes execution history and controls. The README also documents live video/input, uploads, recurring jobs, and pluggable authentication and task plugins. Source excerpts confirm the server, worker, queue, and device-supervision links; some dashboard and automation details are documented capabilities whose internal wiring was not sampled.
Main entry points: app.ts HTTP API · server.ts Server runtime · connection-manager.ts Connection manager · repository.ts Schedule repository
Components 24
Dashboard and API
- Dashboard
static/dashboard/ts/tasks.ts - HTTP API
src/api/app.ts - Server runtime
src/api/server.ts
Device management
- Device registration
src/devices/registration.ts - Device registry
src/devices/registry.ts - WDA supervisor
src/devices/wda-service.ts - Connection manager
src/devices/connection-manager.ts - WDA service API
src/devices/wda-service-http.ts - WDA service client
src/devices/wda-service-client.ts
Scheduling and execution
- Scheduler runtime
src/scheduler/runtime.ts - Schedule repository
src/scheduler/repository.ts - Per-device job queue
src/scheduler/queue.ts - Worker
src/scheduler/worker.ts - Automation executor
src/scheduler/executor.ts
Plugins and persistence
- PostgreSQL
src/database/schema.ts - Plugin registry
src/registry.ts - TikTok plugin
src/tiktok-plugin.ts - TikTok actions
src/tiktok/actions.ts
Other components
- Operator
- Physical iPhones
- WebDriverAgent
- Appium
- Auth provider
- TikTok
Connections 32
- Operator → Dashboard: uses
- Dashboard → HTTP API: requests
- Server runtime → HTTP API: creates
- Server runtime → Scheduler runtime: starts
- Server runtime → Device registration: starts
- Server runtime → Plugin registry: loads plugins
- Server runtime → Auth provider: loads optionally
- HTTP API → Device registration: manages registration
- HTTP API → Device registry: reads and updates
- HTTP API → WDA service client: requests status
- HTTP API → Schedule repository: manages schedules
- HTTP API → Plugin registry: uses plugin routes
- HTTP API → Physical iPhones: streams and controls
- Device registration → Device registry: stores devices
- WDA supervisor → Connection manager: starts and stops
- WDA supervisor → WDA service API: serves
- Connection manager → Device registry: loads devices
- Connection manager → Physical iPhones: discovers devices
- Connection manager → WebDriverAgent: probes status
- Connection manager → Appium: checks readiness
- WDA service client → WDA service API: requests status
- Scheduler runtime → Schedule repository: creates
- Schedule repository → PostgreSQL: persists schedules and executions
- Schedule repository → Per-device job queue: enqueues due work
- Worker → Schedule repository: records attempts
- Worker → Per-device job queue: consumes jobs
- Worker → Automation executor: runs automation
- Worker → Plugin registry: resolves tasks
- Automation executor → Physical iPhones: executes on device
- Plugin registry → TikTok plugin: registers
- TikTok plugin → TikTok actions: provides actions
- TikTok actions → TikTok: automates