# robocup-junior/rcj-rescue-cms architecture

> Architecture diagram of the GitHub repository robocup-junior/rcj-rescue-cms, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/robocup-junior/rcj-rescue-cms
- Repository: https://github.com/robocup-junior/rcj-rescue-cms

## Overview

RoboCupJunior CMS is a web-based rescue competition management and scoring system. Organizers configure competitions, teams, rounds and maps; judges record line, maze and simulation runs; the system applies rule-specific scoring and exposes results and rankings. The repository also includes registration, document review, reservations, signage and technical-challenge capabilities. The tree and README establish these product areas; sampled source confirms HTTP routing, authentication, run notifications and document-review API usage, but not every route-to-model call.

Main entry points: [`app.js`](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/app.js) (HTTP application), [`models`](https://github.com/robocup-junior/rcj-rescue-cms/tree/master/models) (MongoDB records), [`routes/api/lineRuns.js`](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/lineRuns.js) (Run records), [`routes/api/mazeRuns.js`](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/mazeRuns.js) (Maze runs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_app["HTTP application<br/>[app.js]"]
  node_auth["Login and access<br/>[auth.js]"]
end

subgraph group_competition["Competition setup"]
  node_competition_api["Competition setup<br/>[competitions.js]"]
  node_team_api["Teams and rounds<br/>[teams.js]"]
  node_map_api["Line and maze maps<br/>[lineMaps.js]"]
  node_editor["Map editors"]
end

subgraph group_scoring["Runs and scoring"]
  node_run_api["Run records<br/>[lineRuns.js]"]
  node_maze_api["Maze runs<br/>[mazeRuns.js]"]
  node_sim_api["Simulation runs<br/>[simRuns.js]"]
  node_judge_ui["Judge interfaces"]
  node_score["Rule-based scoring<br/>[scoreCalculator.js]"]
  node_ranking["Rankings<br/>[ranking.js]"]
end

subgraph group_operations["Competition operations"]
  node_registration["Registration<br/>[registration.js]"]
  node_documents["Document review<br/>[document.js]"]
  node_reservation["Reservations<br/>[reservation.js]"]
  node_signage["Signage<br/>[signage.js]"]
  node_survey["Surveys and challenge<br/>[survey.js]"]
end

subgraph group_platform["Persistence and services"]
  node_mongo[("MongoDB records")]
  node_mail_queue["Mail queue<br/>[mailQueue.js]"]
  node_mail_sender["Mail delivery<br/>[mailSender.js]"]
  node_redis[("Redis")]
end

node_organizers(("Organizers"))
node_judges(("Judges"))
node_participants(("Participants"))

node_organizers -->|"use admin pages"| node_app
node_judges -->|"submit scores"| node_app
node_participants -->|"use competition site"| node_app
node_app -->|"routes requests"| node_auth
node_app -->|"mounts API"| node_competition_api
node_app -->|"mounts API"| node_team_api
node_app -->|"mounts API"| node_map_api
node_app -->|"mounts API"| node_run_api
node_app -->|"mounts API"| node_maze_api
node_app -->|"mounts API"| node_sim_api
node_app -->|"mounts API"| node_ranking
node_app -->|"mounts API"| node_registration
node_app -->|"mounts API"| node_documents
node_app -->|"mounts API"| node_reservation
node_app -->|"mounts API"| node_signage
node_app -->|"mounts API"| node_survey
node_organizers -->|"configure maps"| node_editor
node_editor -->|"edit maps"| node_map_api
node_judges -->|"record runs"| node_judge_ui
node_judge_ui -->|"submit line runs"| node_run_api
node_judge_ui -->|"submit maze runs"| node_maze_api
node_judge_ui -->|"submit simulation runs"| node_sim_api
node_run_api -->|"calculate points"| node_score
node_maze_api -->|"calculate points"| node_score
node_sim_api -->|"calculate points"| node_score
node_ranking -->|"read results"| node_mongo
node_competition_api -->|"store setup"| node_mongo
node_team_api -->|"store teams"| node_mongo
node_map_api -->|"store maps"| node_mongo
node_run_api -->|"store runs"| node_mongo
node_maze_api -->|"store runs"| node_mongo
node_sim_api -->|"store runs"| node_mongo
node_registration -->|"store registrations"| node_mongo
node_documents -->|"store review data"| node_mongo
node_reservation -->|"store reservations"| node_mongo
node_survey -->|"store responses"| node_mongo
node_app -.->|"queues mail"| node_mail_queue
node_mail_queue -.->|"dispatches mail"| node_mail_sender
node_app -.->|"coordinates workers"| node_redis
node_run_api -.->|"publishes run events"| node_redis
node_maze_api -.->|"publishes run events"| node_redis
node_signage -.->|"publishes updates"| node_redis

click node_app "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/app.js"
click node_auth "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/auth.js"
click node_competition_api "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/competitions.js"
click node_team_api "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/teams.js"
click node_map_api "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/lineMaps.js"
click node_editor "https://github.com/robocup-junior/rcj-rescue-cms/tree/master/public/javascripts/admin/mapEditor"
click node_run_api "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/lineRuns.js"
click node_maze_api "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/mazeRuns.js"
click node_sim_api "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/simRuns.js"
click node_judge_ui "https://github.com/robocup-junior/rcj-rescue-cms/tree/master/public/javascripts/judge"
click node_score "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/helper/scoreCalculator.js"
click node_ranking "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/ranking.js"
click node_registration "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/registration.js"
click node_documents "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/document.js"
click node_reservation "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/reservation.js"
click node_signage "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/signage.js"
click node_survey "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/survey.js"
click node_mongo "https://github.com/robocup-junior/rcj-rescue-cms/tree/master/models"
click node_mail_queue "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/queue/mailQueue.js"
click node_mail_sender "https://github.com/robocup-junior/rcj-rescue-cms/blob/master/helper/mailSender.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_auth toneBlue
class node_competition_api,node_team_api,node_map_api,node_editor toneAmber
class node_run_api,node_maze_api,node_sim_api,node_judge_ui,node_score,node_ranking toneMint
class node_registration,node_documents,node_reservation,node_signage,node_survey toneRose
class node_mongo,node_mail_queue,node_mail_sender,node_redis,node_organizers,node_judges,node_participants toneIndigo
```

## Components

### Web entry

- [HTTP application](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/app.js): `app.js`
- [Login and access](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/auth.js): `routes/api/auth.js`

### Competition setup

- [Competition setup](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/competitions.js): `routes/api/competitions.js`
- [Teams and rounds](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/teams.js): `routes/api/teams.js`
- [Line and maze maps](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/lineMaps.js): `routes/api/lineMaps.js`
- [Map editors](https://github.com/robocup-junior/rcj-rescue-cms/tree/master/public/javascripts/admin/mapEditor): `public/javascripts/admin/mapEditor`

### Runs and scoring

- [Run records](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/lineRuns.js): `routes/api/lineRuns.js`
- [Maze runs](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/mazeRuns.js): `routes/api/mazeRuns.js`
- [Simulation runs](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/simRuns.js): `routes/api/simRuns.js`
- [Judge interfaces](https://github.com/robocup-junior/rcj-rescue-cms/tree/master/public/javascripts/judge): `public/javascripts/judge`
- [Rule-based scoring](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/helper/scoreCalculator.js): `helper/scoreCalculator.js`
- [Rankings](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/ranking.js): `routes/api/ranking.js`

### Competition operations

- [Registration](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/registration.js): `routes/api/registration.js`
- [Document review](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/document.js): `routes/api/document.js`
- [Reservations](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/reservation.js): `routes/api/reservation.js`
- [Signage](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/signage.js): `routes/api/signage.js`
- [Surveys and challenge](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/routes/api/survey.js): `routes/api/survey.js`

### Persistence and services

- [MongoDB records](https://github.com/robocup-junior/rcj-rescue-cms/tree/master/models): `models`
- [Mail queue](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/queue/mailQueue.js): `queue/mailQueue.js`
- [Mail delivery](https://github.com/robocup-junior/rcj-rescue-cms/blob/master/helper/mailSender.js): `helper/mailSender.js`
- **Redis**

### Other components

- **Organizers**
- **Judges**
- **Participants**

## Connections

- Organizers → HTTP application: use admin pages
- Judges → HTTP application: submit scores
- Participants → HTTP application: use competition site
- HTTP application → Login and access: routes requests
- HTTP application → Competition setup: mounts API
- HTTP application → Teams and rounds: mounts API
- HTTP application → Line and maze maps: mounts API
- HTTP application → Run records: mounts API
- HTTP application → Maze runs: mounts API
- HTTP application → Simulation runs: mounts API
- HTTP application → Rankings: mounts API
- HTTP application → Registration: mounts API
- HTTP application → Document review: mounts API
- HTTP application → Reservations: mounts API
- HTTP application → Signage: mounts API
- HTTP application → Surveys and challenge: mounts API
- Organizers → Map editors: configure maps
- Map editors → Line and maze maps: edit maps
- Judges → Judge interfaces: record runs
- Judge interfaces → Run records: submit line runs
- Judge interfaces → Maze runs: submit maze runs
- Judge interfaces → Simulation runs: submit simulation runs
- Run records → Rule-based scoring: calculate points
- Maze runs → Rule-based scoring: calculate points
- Simulation runs → Rule-based scoring: calculate points
- Rankings → MongoDB records: read results
- Competition setup → MongoDB records: store setup
- Teams and rounds → MongoDB records: store teams
- Line and maze maps → MongoDB records: store maps
- Run records → MongoDB records: store runs
- Maze runs → MongoDB records: store runs
- Simulation runs → MongoDB records: store runs
- Registration → MongoDB records: store registrations
- Document review → MongoDB records: store review data
- Reservations → MongoDB records: store reservations
- Surveys and challenge → MongoDB records: store responses
- HTTP application → Mail queue: queues mail
- Mail queue → Mail delivery: dispatches mail
- HTTP application → Redis: coordinates workers
- Run records → Redis: publishes run events
- Maze runs → Redis: publishes run events
- Signage → Redis: publishes updates
