How uxiaohan/douyinspark works
DouyinSpark is a local Douyin direct-message automation engine with a web admin console. The main workflow is account configuration → randomized daily scheduling or manual start → per-account browser login → target friend matching and message send/confirmation → persisted run results and optional notification. The console also manages credentials, accounts, friends, message pools, settings, logs, and runtime status. Edges reflect only README statements or shown references/calls; unsampled frontend/API details are represented conservatively.
Main entry points: index.ts Admin API · runner.ts Run Coordinator · scheduler.ts Daily Scheduler · api.ts Console API Client
Components 23
Admin Console
- Web Console
web/src/app/routes.ts - Admin API
src/web/index.ts - Session Auth
src/web/auth.ts - Console API Client
web/src/api.ts - Accounts, Friends, Messages
web/src/pages/AccountsPage.vue - Settings & Dashboard
web/src/pages/SettingsPage.vue - Run History & Logs
web/src/pages/LogsPage.vue
Run Orchestration
- Runtime Entrypoints
index.ts - Web Service Startup
web-server.ts - Daily Scheduler
src/scheduler.ts - Isolated Run Process
src/run-child.ts - Run Coordinator
src/runner.ts
Douyin Automation
- Browser Session
src/browser.ts - Chat & Message Actions
src/douyin.ts - DOM Selectors
src/selectors.ts - Memory Cache Eviction
src/cache-evict.ts
Local Data
- Runtime Configuration
src/config.ts - Data Access
src/repo.ts - SQLite Store
src/db.ts - Run Notifications
src/notify.ts
Other components
- Operator
- Douyin Web
- PushDeer
Connections 31
- Operator → Web Console: uses
README.md - Web Console → Console API Client: requests
- Console API Client → Admin API: calls API
- Admin API → Session Auth: authenticates
src/web/index.ts - Admin API → Data Access: manages records
src/web/index.ts - Admin API → Runtime Configuration: reads settings
src/web/index.ts - Admin API → Daily Scheduler: wakes scheduler
src/web/index.ts - Admin API → Run Notifications: tests notification
src/web/index.ts - Web Service Startup → Admin API: serves API
web-server.ts - Runtime Entrypoints → Daily Scheduler: starts loop
index.ts - Runtime Entrypoints → Run Coordinator: runs batch
README.md - Web Service Startup → Daily Scheduler: starts loop
README.md - Daily Scheduler → Runtime Configuration: loads schedule
src/scheduler.ts - Daily Scheduler → Isolated Run Process: dispatches run
src/scheduler.ts - Isolated Run Process → Run Coordinator: runs isolated
src/run-child.ts - Isolated Run Process → Memory Cache Eviction: evicts memory
src/run-child.ts - Run Coordinator → Runtime Configuration: loads run config
src/runner.ts - Run Coordinator → Data Access: records results
src/runner.ts - Run Coordinator → Browser Session: opens accounts
src/runner.ts - Run Coordinator → Chat & Message Actions: drives messaging
src/runner.ts - Run Coordinator → Run Notifications: notifies run
src/runner.ts - Browser Session → Douyin Web: logs in
README.md - Chat & Message Actions → DOM Selectors: uses selectors
src/douyin.ts - Chat & Message Actions → Douyin Web: sends messages
README.md - Run Notifications → PushDeer: sends push
README.md - Runtime Configuration → Data Access: loads and saves
src/config.ts - Data Access → SQLite Store: queries
src/repo.ts - Session Auth → Data Access: stores sessions
src/web/auth.ts - Accounts, Friends, Messages → Console API Client: manages data
- Settings & Dashboard → Console API Client: updates settings
- Run History & Logs → Console API Client: views history