# 2305100-vineet/competition-platform architecture

> Architecture diagram of the GitHub repository 2305100-vineet/competition-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/2305100-vineet/competition-platform
- Repository: https://github.com/2305100-vineet/competition-platform

## Overview

Arenafy is a full-stack tournament platform for cricket, football, and PUBG. Organizers create tournaments, open registration, approve team entries, then generate fixtures or brackets (or PUBG match days); match results are normalized by discipline-specific processors and feed standings or knockout advancement. Players browse tournaments and register teams, while organizers manage lifecycle and results. The graph includes the client, API routing, domain controllers, sport processors, and persistence models. Some subsystem links rely on README descriptions or the source index because their implementation excerpts were not supplied.

Main entry points: [`server/src/app.js`](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/app.js) (HTTP application), [`client/src/pages/TournamentDetail.jsx`](https://github.com/2305100-vineet/competition-platform/blob/main/client/src/pages/TournamentDetail.jsx) (Tournament workspace), [`server/src/controllers/registration.controller.js`](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/controllers/registration.controller.js) (Team registration), [`server/src/controllers/match.controller.js`](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/controllers/match.controller.js) (Fixtures and results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Web application<br/>[App.jsx]"]
  node_authctx["Session context<br/>[AuthContext.jsx]"]
  node_api_client["API client<br/>[client.js]"]
  node_tournament_ui["Tournament workspace"]
  node_result_form["Result form"]
  node_bracket_view["Bracket display<br/>[Bracket.jsx]"]
end

subgraph group_api["API and identity"]
  node_server_app["HTTP application<br/>[app.js]"]
  node_auth_routes["Authentication routes<br/>[auth.routes.js]"]
  node_match_routes["Match routes<br/>[match.routes.js]"]
  node_tournament_routes["Tournament routes"]
  node_registration_routes["Registration routes"]
  node_auth_guard["JWT guard<br/>[auth.middleware.js]"]
end

subgraph group_tournament["Tournament operations"]
  node_auth_controller["Account and reset<br/>[auth.controller.js]"]
  node_tournament_controller["Tournament lifecycle"]
  node_registration_controller["Team registration"]
  node_match_controller["Fixtures and results"]
  node_discipline_registry["Processor registry<br/>[registry.js]"]
  node_cricket_processor["Cricket results"]
  node_football_processor["Football results"]
  node_pubg_processor["PUBG results"]
end

subgraph group_data["Persistence and integrations"]
  node_user_model[("User records<br/>[User.js]")]
  node_tournament_model[("Tournament records<br/>[Tournament.js]")]
  node_registration_model[("Registration records<br/>[Registration.js]")]
  node_team_model[("Team and roster<br/>[Team.js]")]
  node_match_model[("Match records<br/>[Match.js]")]
  node_mailer["Email delivery<br/>[mailer.js]"]
end

node_visitor(("Players and organizers"))

node_visitor -->|"uses"| node_app
node_app -->|"provides session"| node_authctx
node_app -->|"routes to"| node_tournament_ui
node_authctx -->|"requests auth"| node_api_client
node_tournament_ui -->|"loads and updates"| node_api_client
node_tournament_ui -->|"renders"| node_result_form
node_tournament_ui -->|"renders"| node_bracket_view
node_server_app -->|"mounts"| node_auth_routes
node_server_app -->|"mounts"| node_match_routes
node_server_app -->|"mounts"| node_tournament_routes
node_server_app -->|"mounts"| node_registration_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_match_routes -->|"guards mutations"| node_auth_guard
node_match_routes -->|"dispatches"| node_match_controller
node_tournament_routes -->|"guards mutations"| node_auth_guard
node_tournament_routes -->|"dispatches"| node_tournament_controller
node_registration_routes -->|"dispatches"| node_registration_controller
node_auth_controller -->|"reads and writes"| node_user_model
node_auth_controller -->|"sends email"| node_mailer
node_registration_controller -->|"creates and reads"| node_registration_model
node_registration_controller -->|"updates participants"| node_tournament_model
node_registration_controller -->|"checks roster"| node_team_model
node_match_controller -->|"creates and queries"| node_match_model
node_match_controller -->|"reads and updates"| node_tournament_model
node_match_controller -->|"looks up processor"| node_discipline_registry
node_discipline_registry -->|"selects"| node_cricket_processor
node_discipline_registry -->|"selects"| node_football_processor
node_discipline_registry -->|"selects"| node_pubg_processor

click node_app "https://github.com/2305100-vineet/competition-platform/blob/main/client/src/App.jsx"
click node_authctx "https://github.com/2305100-vineet/competition-platform/blob/main/client/src/context/AuthContext.jsx"
click node_api_client "https://github.com/2305100-vineet/competition-platform/blob/main/client/src/api/client.js"
click node_tournament_ui "https://github.com/2305100-vineet/competition-platform/blob/main/client/src/pages/TournamentDetail.jsx"
click node_result_form "https://github.com/2305100-vineet/competition-platform/blob/main/client/src/components/SubmitResultForm.jsx"
click node_bracket_view "https://github.com/2305100-vineet/competition-platform/blob/main/client/src/components/Bracket.jsx"
click node_server_app "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/app.js"
click node_auth_routes "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/routes/auth.routes.js"
click node_match_routes "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/routes/match.routes.js"
click node_tournament_routes "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/routes/tournament.routes.js"
click node_registration_routes "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/routes/registration.routes.js"
click node_auth_guard "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/middleware/auth.middleware.js"
click node_auth_controller "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/controllers/auth.controller.js"
click node_tournament_controller "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/controllers/tournament.controller.js"
click node_registration_controller "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/controllers/registration.controller.js"
click node_match_controller "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/controllers/match.controller.js"
click node_discipline_registry "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/discipline/registry.js"
click node_cricket_processor "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/discipline/cricket/cricket.resultProcessor.js"
click node_football_processor "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/discipline/football/football.resultProcessor.js"
click node_pubg_processor "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/discipline/pubg/pubg.resultProcessor.js"
click node_user_model "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/models/User.js"
click node_tournament_model "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/models/Tournament.js"
click node_registration_model "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/models/Registration.js"
click node_team_model "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/models/Team.js"
click node_match_model "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/models/Match.js"
click node_mailer "https://github.com/2305100-vineet/competition-platform/blob/main/server/src/utils/mailer.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_authctx,node_api_client,node_tournament_ui,node_result_form,node_bracket_view toneBlue
class node_server_app,node_auth_routes,node_match_routes,node_tournament_routes,node_registration_routes,node_auth_guard toneAmber
class node_auth_controller,node_tournament_controller,node_registration_controller,node_match_controller,node_discipline_registry,node_cricket_processor,node_football_processor,node_pubg_processor toneMint
class node_user_model,node_tournament_model,node_registration_model,node_team_model,node_match_model,node_mailer toneRose
class node_visitor toneIndigo
```

## Components

### Web client

- [Web application](https://github.com/2305100-vineet/competition-platform/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Session context](https://github.com/2305100-vineet/competition-platform/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [API client](https://github.com/2305100-vineet/competition-platform/blob/main/client/src/api/client.js): `client/src/api/client.js`
- [Tournament workspace](https://github.com/2305100-vineet/competition-platform/blob/main/client/src/pages/TournamentDetail.jsx): `client/src/pages/TournamentDetail.jsx`
- [Result form](https://github.com/2305100-vineet/competition-platform/blob/main/client/src/components/SubmitResultForm.jsx): `client/src/components/SubmitResultForm.jsx`
- [Bracket display](https://github.com/2305100-vineet/competition-platform/blob/main/client/src/components/Bracket.jsx): `client/src/components/Bracket.jsx`

### API and identity

- [HTTP application](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/app.js): `server/src/app.js`
- [Authentication routes](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/routes/auth.routes.js): `server/src/routes/auth.routes.js`
- [Match routes](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/routes/match.routes.js): `server/src/routes/match.routes.js`
- [Tournament routes](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/routes/tournament.routes.js): `server/src/routes/tournament.routes.js`
- [Registration routes](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/routes/registration.routes.js): `server/src/routes/registration.routes.js`
- [JWT guard](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/middleware/auth.middleware.js): `server/src/middleware/auth.middleware.js`

### Tournament operations

- [Account and reset](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/controllers/auth.controller.js): `server/src/controllers/auth.controller.js`
- [Tournament lifecycle](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/controllers/tournament.controller.js): `server/src/controllers/tournament.controller.js`
- [Team registration](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/controllers/registration.controller.js): `server/src/controllers/registration.controller.js`
- [Fixtures and results](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/controllers/match.controller.js): `server/src/controllers/match.controller.js`
- [Processor registry](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/discipline/registry.js): `server/src/discipline/registry.js`
- [Cricket results](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/discipline/cricket/cricket.resultProcessor.js): `server/src/discipline/cricket/cricket.resultProcessor.js`
- [Football results](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/discipline/football/football.resultProcessor.js): `server/src/discipline/football/football.resultProcessor.js`
- [PUBG results](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/discipline/pubg/pubg.resultProcessor.js): `server/src/discipline/pubg/pubg.resultProcessor.js`

### Persistence and integrations

- [User records](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/models/User.js): `server/src/models/User.js`
- [Tournament records](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/models/Tournament.js): `server/src/models/Tournament.js`
- [Registration records](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/models/Registration.js): `server/src/models/Registration.js`
- [Team and roster](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/models/Team.js): `server/src/models/Team.js`
- [Match records](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/models/Match.js): `server/src/models/Match.js`
- [Email delivery](https://github.com/2305100-vineet/competition-platform/blob/main/server/src/utils/mailer.js): `server/src/utils/mailer.js`

### Other components

- **Players and organizers**

## Connections

- Players and organizers → Web application: uses (evidence: `client/src/App.jsx`)
- Web application → Session context: provides session (evidence: `client/src/App.jsx`)
- Web application → Tournament workspace: routes to (evidence: `client/src/App.jsx`)
- Session context → API client: requests auth (evidence: `client/src/context/AuthContext.jsx`)
- Tournament workspace → API client: loads and updates (evidence: `client/src/pages/TournamentDetail.jsx`)
- Tournament workspace → Result form: renders (evidence: `client/src/pages/TournamentDetail.jsx`)
- Tournament workspace → Bracket display: renders (evidence: `client/src/pages/TournamentDetail.jsx`)
- HTTP application → Authentication routes: mounts (evidence: `server/src/app.js`)
- HTTP application → Match routes: mounts (evidence: `server/src/app.js`)
- HTTP application → Tournament routes: mounts (evidence: `server/src/app.js`)
- HTTP application → Registration routes: mounts (evidence: `server/src/app.js`)
- Authentication routes → Account and reset: dispatches (evidence: `server/src/routes/auth.routes.js`)
- Match routes → JWT guard: guards mutations (evidence: `server/src/routes/match.routes.js`)
- Match routes → Fixtures and results: dispatches (evidence: `server/src/routes/match.routes.js`)
- Tournament routes → JWT guard: guards mutations (evidence: `server/src/routes/tournament.routes.js`)
- Tournament routes → Tournament lifecycle: dispatches (evidence: `server/src/routes/tournament.routes.js`)
- Registration routes → Team registration: dispatches (evidence: `server/src/routes/registration.routes.js`)
- Account and reset → User records: reads and writes (evidence: `server/src/controllers/auth.controller.js`)
- Account and reset → Email delivery: sends email (evidence: `server/src/controllers/auth.controller.js`)
- Team registration → Registration records: creates and reads (evidence: `server/src/controllers/registration.controller.js`)
- Team registration → Tournament records: updates participants (evidence: `server/src/controllers/registration.controller.js`)
- Team registration → Team and roster: checks roster (evidence: `server/src/controllers/registration.controller.js`)
- Fixtures and results → Match records: creates and queries (evidence: `server/src/controllers/match.controller.js`)
- Fixtures and results → Tournament records: reads and updates (evidence: `server/src/controllers/match.controller.js`)
- Fixtures and results → Processor registry: looks up processor (evidence: `server/src/controllers/match.controller.js`)
- Processor registry → Cricket results: selects (evidence: `server/src/discipline/registry.js`)
- Processor registry → Football results: selects (evidence: `server/src/discipline/registry.js`)
- Processor registry → PUBG results: selects (evidence: `server/src/discipline/registry.js`)
