How tfcis/ntoj works
NTOJ is a web-based online judge. Users submit code against problems, and the application records challenges and judging results; administrators manage problems and their files, while contest and scoreboard features support organized competitions. The sampled server code confirms Tornado routing and PostgreSQL/Redis initialization, and the sampled handlers confirm problem-type dispatch and file management. The README provides no capability details, and judging, contest, and persistence internals were not fully sampled, so uncertain runtime links are omitted.
Main entry points: server.py HTTP server · url.py URL routing · filemanager.py Problem file handlers · submit.py Submission handlers
Components 25
Web application
- HTTP server
src/server.py - URL routing
src/url.py - Web entry
src/handlers/index.py
Problems and judging
- Submission handlers
src/handlers/submit.py - Problem management
src/handlers/manage/pro - File-manager dispatch
src/handlers/manage/pro/filemanager.py - Problem file handlers
src/handlers/prospec/common/filemanager.py - Problem files
src/services/filemanager.py - Problem service
src/services/pro.py - Challenge service
src/services/chal.py - Problem-type handlers
src/handlers/prospec - Problem-type services
src/services/prospec - Judging workflow
src/services/prospec/program.py - Judge cluster service
src/services/judge.py
Contests and community
- Contest handlers
src/handlers/contests - Contest service
src/services/contests.py - Contest scoreboard
src/services/contest_scoreboard.py - Boards and questions
src/services/board.py
State and integrations
- Service initialization
src/services/service.py - PostgreSQL
- Redis
- Upload packs
src/services/pack.py
Other components
- Participant
- Administrator
- Judge servers
Connections 27
- Participant → HTTP server: sends requests
- Administrator → HTTP server: sends requests
- HTTP server → URL routing: registers routes
- URL routing → Web entry: dispatches pages
- URL routing → Submission handlers: dispatches requests
- URL routing → Problem management: dispatches requests
- URL routing → Contest handlers: dispatches requests
- Submission handlers → Challenge service: records challenges
- Submission handlers → Problem-type handlers: dispatches by problem
- Problem-type handlers → Problem-type services: uses problem type
- Challenge service → Judging workflow: prepares judging
- Judging workflow → Judge cluster service: requests judging
- Judge cluster service → Judge servers: connects to
- Problem management → Problem service: loads problems
- Problem management → File-manager dispatch: handles file requests
- File-manager dispatch → Problem file handlers: dispatches by type
- Problem file handlers → Problem service: loads problem
- Problem file handlers → Problem files: manages files
- Problem file handlers → Upload packs: copies uploaded files
- Contest handlers → Contest service: uses contest data
- Contest service → Contest scoreboard: uses scoreboard
- HTTP server → Service initialization: initializes services
- Service initialization → PostgreSQL: provides database
- Service initialization → Redis: provides cache
- HTTP server → PostgreSQL: opens connection pool
- HTTP server → Redis: opens connection
- Problem files → Upload packs: copies pack files