How eedcd/hoj-tool works
HOJ Tool is a Windows-oriented assistant for HOJ-like online judges, with a WebView-hosted web interface and a legacy command-line mode. The main workflow is to configure OJ/browser/AI settings, start an auto-solving mode, let the solver obtain problem data and code through the AI/browser workflow, then submit and verify results. Separate capabilities include account bans and submission analytics. The graph follows the sampled server/API call sites and README-described features; browser-to-API wiring and unsampled implementation details are not asserted.
Main entry points: api.py Web API · main.py CLI entry · server.py Web server · auto_solver.py Problem solver
Components 21
Web application
- Desktop WebView
main.py - Web server
server.py - Page routes
routers/pages.py - Settings UI
static/settings/index.js - Solver UI
static/auto_solver/index.js - Ban UI
static/ban_account/index.js - Statistics UI
static/statistics/index.js - Web API
routers/api.py - Port selection
lib/port_utils.py
Auto solving
- Problem solver
module/auto_solver.py - HOJ judge
- 360bot AI
Account and analytics
- Account banning
module/ban_account.py - Submission statistics
module/statistics.py
Legacy CLI
- CLI entry
cli/main.py - CLI configuration
cli/lib/config.py - CLI interaction
cli/lib/interaction.py - HOJ client API
cli/lib/api.py - Rank browser
cli/module/rank.py - CLI toolbox
cli/module/tools.py
Other components
- User
Connections 28
- User → Desktop WebView: launches
README.md - Desktop WebView → Web server: opens server URL
main.py - Web server → Port selection: selects port
server.py - Web server → Page routes: registers routes
server.py - Web server → Web API: registers API
server.py - User → Settings UI: configures
README.md - Settings UI → Web API: uses configuration API
- User → Solver UI: chooses solve mode
README.md - Solver UI → Web API: starts solver
- Web API → Problem solver: starts training task
routers/api.py - Problem solver → HOJ judge: fetches problems and submits
module/auto_solver.py - Problem solver → 360bot AI: requests solutions
README.md - User → Ban UI: requests account ban
README.md - Ban UI → Web API: uses ban API
- Web API → Account banning: dispatches ban work
routers/api.py - User → Statistics UI: views analytics
- Statistics UI → Web API: requests statistics
- Web API → Submission statistics: gets statistics
routers/api.py - Submission statistics → HOJ judge: fetches submissions
module/statistics.py - User → CLI entry: runs legacy mode
README.md - CLI entry → CLI configuration: loads settings
cli/main.py - CLI entry → CLI interaction: prompts user
cli/main.py - CLI entry → HOJ client API: creates client
cli/main.py - CLI entry → Rank browser: dispatches ranking
cli/main.py - Rank browser → HOJ client API: fetches rankings
cli/module/rank.py - Rank browser → CLI interaction: renders ranking
cli/module/rank.py - CLI entry → CLI toolbox: dispatches toolbox
cli/main.py - CLI toolbox → HOJ client API: uses HOJ client
cli/module/tools.py