moj.naquadah.com.br · a competitive-programming judge where everything is bash + files — no database, no broker, no ORM.
MOJ runs contests, training, and problem authoring on a stack of bash scripts, jq, and
plain files. This organization holds its independent repositories.
- Bash + files, all the way down — no DB and no message broker; async work flows through
a file spool with
inotifywait+flock. - API-first — a single
router.shfront-controller maps/a/b/ctohandlers/a/b/c.sh, with a consistent JSON envelope and the right HTTP status every time. Access is enforced in the API, never only in the UI. - Pull-based judging — judge machines heartbeat the API, claim a job, download the problem
package on demand, run it in a
bubblewrapsandbox, calibrate the time limit on first sight, and report back. No master, no push. - No-build frontend — vanilla ES modules served static (CodeMirror 6 vendored, assets offline) so a contest can run on an isolated LAN.
- Per-user store — every account lives in
contests/<id>/users/<login>/; there is no globalpasswd, and renaming a user is justmv.
| Repo | Role |
|---|---|
| cdmoj | The web platform: bash API under nginx + fcgiwrap (server/) + no-build ESM frontend (web/) + docs. The web host. |
| mojtools | Judging + statements: sandbox, time-limit calibration, statement renderer/validator, per-language runners. |
| cdjudge | The pull agent that runs on judge machines — heartbeats the API and pulls jobs. |
| moj-cli | The moj CLI for problem authoring — keyless (login only), mirrors the web editor. |
Start with cdmoj/docs/OVERVIEW.md
for the architecture and
FLOW.md for the path of a
submission.
Stack: bash · jq · nginx · fcgiwrap · systemd · inotifywait · flock · vanilla ESM · bubblewrap