# jeremiasreinoso/puntajenewcom2026 architecture

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

- Interactive diagram: https://gitdiagram.com/jeremiasreinoso/puntajenewcom2026
- Repository: https://github.com/jeremiasreinoso/puntajenewcom2026

## Overview

PuntajeNewcom is a browser-based tournament scoring and management application. Its domain supports category setup, team and zone management, match-result entry, standings and tie handling, qualification into a final zone, and final rankings; +60/+68 categories use a single round-robin zone. The sampled app.js is a substantial UI implementation, while the modular service and domain layers are also present. The excerpts do not establish that app.js invokes that service, so they are shown separately. Storage wiring from the service is documented as a repository port but not shown as a direct call.

Main entry points: [`src/application/tournament-service.js`](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/application/tournament-service.js) (Tournament Service), [`src/domain/tournament.js`](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/tournament.js) (Tournament Rules), [`src/infrastructure/state-schema.js`](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/infrastructure/state-schema.js) (State Schema), [`src/domain/standings.js`](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/standings.js) (Standings and Ties)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Tournament UI"]
  node_app_ui["Tournament Interface<br/>[app.js]"]
end

subgraph group_application["Use Cases"]
  node_service["Tournament Service"]
  node_team_zone["Teams and Zones"]
  node_match_results["Match Results"]
end

subgraph group_domain["Tournament Rules"]
  node_qualification["Qualification Flow<br/>[tournament.js]"]
  node_final_rankings["Final Rankings<br/>[tournament.js]"]
  node_tournament_rules["Tournament Rules<br/>[tournament.js]"]
  node_standings["Standings and Ties<br/>[standings.js]"]
  node_scoring["Scoring Rules<br/>[scoring.js]"]
  node_domain_errors["Domain Errors<br/>[errors.js]"]
  node_constants["Tournament Constants<br/>[constants.js]"]
end

subgraph group_persistence["State Persistence"]
  node_repository[("Local Storage Repository")]
  node_state_schema["State Schema<br/>[state-schema.js]"]
end

node_organizer(("Organizer"))

node_organizer -->|"manages tournament"| node_app_ui
node_service -->|"uses rules"| node_tournament_rules
node_service -->|"computes standings"| node_standings
node_service -->|"uses scoring"| node_scoring
node_service -->|"raises errors"| node_domain_errors
node_service -->|"uses constants"| node_constants
node_service -.->|"loads and saves"| node_repository
node_repository -->|"normalizes state"| node_state_schema
node_repository -->|"reads settings"| node_constants
node_state_schema -->|"validates values"| node_constants
node_state_schema -->|"validates results"| node_scoring
node_state_schema -->|"checks migration"| node_tournament_rules
node_tournament_rules -->|"ranks zones"| node_standings
node_tournament_rules -->|"uses formats"| node_constants
node_standings -->|"derives points"| node_scoring
node_standings -->|"uses errors"| node_domain_errors
node_scoring -->|"throws rule errors"| node_domain_errors
node_team_zone -.->|"handled by"| node_service
node_match_results -.->|"handled by"| node_service
node_qualification -->|"implemented by"| node_tournament_rules
node_final_rankings -->|"implemented by"| node_tournament_rules

click node_app_ui "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/app.js"
click node_service "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/application/tournament-service.js"
click node_team_zone "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/application/tournament-service.js"
click node_match_results "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/application/tournament-service.js"
click node_qualification "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/tournament.js"
click node_final_rankings "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/tournament.js"
click node_tournament_rules "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/tournament.js"
click node_standings "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/standings.js"
click node_scoring "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/scoring.js"
click node_domain_errors "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/errors.js"
click node_constants "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/constants.js"
click node_repository "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/infrastructure/local-storage-repository.js"
click node_state_schema "https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/infrastructure/state-schema.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_ui toneBlue
class node_service,node_team_zone,node_match_results toneAmber
class node_qualification,node_final_rankings,node_tournament_rules,node_standings,node_scoring,node_domain_errors,node_constants toneMint
class node_repository,node_state_schema toneRose
class node_organizer toneIndigo
```

## Components

### Tournament UI

- [Tournament Interface](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/app.js): `app.js`

### Use Cases

- [Tournament Service](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/application/tournament-service.js): `src/application/tournament-service.js`
- [Teams and Zones](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/application/tournament-service.js): `src/application/tournament-service.js`
- [Match Results](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/application/tournament-service.js): `src/application/tournament-service.js`

### Tournament Rules

- [Qualification Flow](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/tournament.js): `src/domain/tournament.js`
- [Final Rankings](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/tournament.js): `src/domain/tournament.js`
- [Tournament Rules](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/tournament.js): `src/domain/tournament.js`
- [Standings and Ties](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/standings.js): `src/domain/standings.js`
- [Scoring Rules](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/scoring.js): `src/domain/scoring.js`
- [Domain Errors](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/errors.js): `src/domain/errors.js`
- [Tournament Constants](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/domain/constants.js): `src/domain/constants.js`

### State Persistence

- [Local Storage Repository](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/infrastructure/local-storage-repository.js): `src/infrastructure/local-storage-repository.js`
- [State Schema](https://github.com/jeremiasreinoso/puntajenewcom2026/blob/main/src/infrastructure/state-schema.js): `src/infrastructure/state-schema.js`

### Other components

- **Organizer**

## Connections

- Organizer → Tournament Interface: manages tournament (evidence: `app.js`)
- Tournament Service → Tournament Rules: uses rules (evidence: `src/application/tournament-service.js`)
- Tournament Service → Standings and Ties: computes standings (evidence: `src/application/tournament-service.js`)
- Tournament Service → Scoring Rules: uses scoring (evidence: `src/application/tournament-service.js`)
- Tournament Service → Domain Errors: raises errors (evidence: `src/application/tournament-service.js`)
- Tournament Service → Tournament Constants: uses constants (evidence: `src/application/tournament-service.js`)
- Tournament Service → Local Storage Repository: loads and saves
- Local Storage Repository → State Schema: normalizes state (evidence: `src/infrastructure/local-storage-repository.js`)
- Local Storage Repository → Tournament Constants: reads settings (evidence: `src/infrastructure/local-storage-repository.js`)
- State Schema → Tournament Constants: validates values (evidence: `src/infrastructure/state-schema.js`)
- State Schema → Scoring Rules: validates results (evidence: `src/infrastructure/state-schema.js`)
- State Schema → Tournament Rules: checks migration (evidence: `src/infrastructure/state-schema.js`)
- Tournament Rules → Standings and Ties: ranks zones (evidence: `src/domain/tournament.js`)
- Tournament Rules → Tournament Constants: uses formats (evidence: `src/domain/tournament.js`)
- Standings and Ties → Scoring Rules: derives points (evidence: `src/domain/standings.js`)
- Standings and Ties → Domain Errors: uses errors
- Scoring Rules → Domain Errors: throws rule errors (evidence: `src/domain/scoring.js`)
- Teams and Zones → Tournament Service: handled by (evidence: `src/application/tournament-service.js`)
- Match Results → Tournament Service: handled by (evidence: `src/application/tournament-service.js`)
- Qualification Flow → Tournament Rules: implemented by (evidence: `src/domain/tournament.js`)
- Final Rankings → Tournament Rules: implemented by (evidence: `src/domain/tournament.js`)
