How namanyakeren/replicator works
Replicator runs a Windows agent at each site to copy MySQL data from master to backup, record replication health, and optionally reverse-sync during failback. A PHP dashboard polls site backups for agent status and database sizes. The installer configures the agent and MySQL access. The agent workflow and installer links are supported by sampled source; dashboard behavior and several agent capabilities are documented in the README, but dashboard source excerpts were not provided.
Main entry points: main.rs Agent runner · sync.rs Table synchronization · api.php Site status API · status.rs Cycle and status records
Components 19
Replication agent
- Agent runner
agent/src/main.rs - Config validation
agent/src/config.rs - MySQL connections
agent/src/db.rs - Table synchronization
agent/src/sync.rs - Shared utilities
agent/src/util.rs
Status and operations
- Failback state
agent/src/failback.rs - Cycle and status records
agent/src/status.rs - Rotating logs
agent/src/logger.rs - Tray and monitor
agent/src/tray.rs
Monitoring dashboard
- Dashboard page
dashboard/index.php - Site status API
dashboard/api.php - Site configuration
config/config.php
Agent installation
- Installer entry
installer/src/main.rs - Installer form
installer/src/ui.rs - Installation tasks
installer/src/install.rs
Other components
- Site operator
- Site master MySQL
- Site backup MySQL
- Dashboard user
Connections 26
- Site operator → Agent runner: starts agent
README.md - Agent runner → Config validation: loads settings
agent/src/main.rs - Agent runner → MySQL connections: checks connections
agent/src/main.rs - Agent runner → Table synchronization: runs cycles
agent/src/main.rs - Agent runner → Cycle and status records: publishes status
agent/src/main.rs - Agent runner → Failback state: checks failback
agent/src/main.rs - Agent runner → Rotating logs: logs events
agent/src/main.rs - Agent runner → Tray and monitor: runs tray
agent/src/main.rs - Config validation → Shared utilities: validates identifiers
agent/src/config.rs - Table synchronization → MySQL connections: reads and writes
agent/src/sync.rs - Table synchronization → Cycle and status records: reports progress
agent/src/sync.rs - Table synchronization → Site master MySQL: reads tables
README.md - Table synchronization → Site backup MySQL: writes replica
README.md - Cycle and status records → MySQL connections: writes records
agent/src/status.rs - Cycle and status records → Site backup MySQL: stores status
README.md - Tray and monitor → Failback state: requests mode
agent/src/tray.rs - Dashboard user → Dashboard page: opens dashboard
README.md - Dashboard page → Site status API: polls status
README.md - Site status API → Site configuration: loads sites
- Site status API → Site backup MySQL: reads agent status
README.md - Site status API → Site master MySQL: measures database
README.md - Site operator → Installer entry: runs installer
README.md - Installer entry → Installer form: opens form
installer/src/main.rs - Installer entry → Installation tasks: performs setup
installer/src/main.rs - Installer form → Installation tasks: submits settings
installer/src/ui.rs - Installation tasks → Site backup MySQL: prepares database
installer/src/install.rs