This guide equips contributors to extend AnyRouter responsibly and consistently.
main.pylaunches the floating desktop client and wires configuration loading.config.json.exampleandcredentials.txt.exampledocument runtime settings; copy them locally and keep secrets out of Git.src/hosts modular services: browser orchestration (browser_manager.py,browser_pool.py), authentication and balance extraction (auth_manager.py), scheduling (monitor_service.py), and UI (ui_floating.py).- Packaged artifacts live in
dist/main/alongside runtime logs; snapshots such asARLoginer_1.0.0.exeserve local smoke validation only.
- Install dependencies:
pip install -r requirements.txt. - Launch the floating client:
python main.py; add--headlessfor background polling or--debugfor verbose logging. - Point to alternate configs with
python main.py --config path/to/config.json. - Exercise modules independently:
python src/browser_manager.py,python src/auth_manager.py,python src/monitor_service.py.
- Target Python 3.8+, four-space indentation, and
snake_casefor functions and variables. - Prefer
PascalCasefor classes and exceptions, uppercase with underscores for constants. - Reuse existing helpers in
src/instead of introducing bespoke frameworks; keep inline comments brief and intentional.
- The repository has no pytest or unittest suite; rely on the smoke commands above before every PR.
- Validate login and balance changes with sample credentials in
credentials.txt, and reviewanyrouter_monitor.logfor anomalies. - For UI adjustments, run
python main.pyin headed mode and confirm expand, collapse, and refresh flows.
- Follow the existing history: short imperative messages, usually Chinese verbs plus context, for example
优化登录流程. - Scope each commit narrowly; document notable file touches when the diff spans multiple modules.
- PR descriptions must include: purpose, major changes, verification commands, linked issues, and screenshots or GIFs for UI work.
- 与仓库维护者及代理互动时默认使用中文,确保讨论与记录口径一致。
- 共享运行命令、日志或截图时保持敏感信息脱敏,并同步记录到 PR 描述。
- Never commit generated
config.json,credentials.txt, or log files; they already live in.gitignore. - When repackaging, rebuild in a clean virtual environment with PyInstaller to mirror
dist/main/main.exe, and record version bumps or installer notes in the PR summary.