# svenson95/reelscore architecture

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

- Interactive diagram: https://gitdiagram.com/svenson95/reelscore
- Repository: https://github.com/svenson95/reelscore

## Overview

ReelScore is a football livescore web application centered on browsing fixtures and match details, with predictions and team-form analysis. A visitor enters the Angular client, navigates to the dated overview, competition tables, or a fixture page, and receives data from the Express API backed by MongoDB. The API also exposes search, fixture analyses and evaluations, and livestream functionality. The README documents the data source and product capabilities; unsampled client data-access and livestream internals are represented at subsystem level, without inferring their internal call chains.

Main entry points: [`apps/api/src/app.ts`](https://github.com/svenson95/reelscore/blob/main/apps/api/src/app.ts) (API application), [`apps/api/src/database/mongodb.helper.ts`](https://github.com/svenson95/reelscore/blob/main/apps/api/src/database/mongodb.helper.ts) (MongoDB access), [`apps/client/src/app/app.routes.ts`](https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/app.routes.ts) (App routes), [`apps/client/src/app/features`](https://github.com/svenson95/reelscore/tree/main/apps/client/src/app/features) (Client data access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_router["App routes<br/>[app.routes.ts]"]
  node_overview["Fixture overview"]
  node_competition["Competition view"]
  node_match["Match details<br/>[match.page.ts]"]
  node_clientdata["Client data access"]
end

subgraph group_api["Express API"]
  node_apiapp["API application<br/>[app.ts]"]
  node_dbapi["Football data endpoints"]
  node_search["Search"]
  node_analysis["Fixture analyses"]
  node_evaluation["Fixture evaluations"]
  node_livestream["Livestream"]
end

subgraph group_data["Football data"]
  node_mongodb[("MongoDB access<br/>[mongodb.helper.ts]")]
  node_fixturedata[("Fixture records")]
  node_standings[("Standings records<br/>[standings.model.ts]")]
  node_topscorers[("Top scorer records")]
end

subgraph group_realtime["Live updates"]
  node_clientrealtime["Realtime handling"]
  node_refresh["Live refresh"]
  node_realtimeapi["Realtime service"]
end

node_visitor(("Football fan"))

node_visitor -->|"navigates"| node_router
node_router -->|"routes to"| node_overview
node_router -->|"routes to"| node_competition
node_router -->|"routes to"| node_match
node_overview -.->|"loads data"| node_clientdata
node_competition -.->|"loads data"| node_clientdata
node_match -.->|"loads data"| node_clientdata
node_clientdata -.->|"requests data"| node_apiapp
node_apiapp -->|"mounts routes"| node_dbapi
node_apiapp -->|"mounts route"| node_search
node_apiapp -->|"mounts route"| node_analysis
node_apiapp -->|"mounts route"| node_evaluation
node_apiapp -->|"mounts route"| node_livestream
node_search -->|"queries"| node_mongodb
node_analysis -->|"reads fixtures/events"| node_dbapi
node_evaluation -->|"loads fixture history"| node_dbapi
node_dbapi -.->|"accesses database"| node_mongodb
node_mongodb -.->|"reads and writes"| node_fixturedata
node_mongodb -.->|"reads and writes"| node_standings
node_mongodb -.->|"reads and writes"| node_topscorers
node_realtimeapi -->|"drives refresh"| node_refresh
node_clientrealtime -->|"receives updates"| node_realtimeapi

click node_router "https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/app.routes.ts"
click node_overview "https://github.com/svenson95/reelscore/tree/main/apps/client/src/app/features/overview"
click node_competition "https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/features/competition/competition.page.ts"
click node_match "https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/features/match/match.page.ts"
click node_clientdata "https://github.com/svenson95/reelscore/tree/main/apps/client/src/app/features"
click node_clientrealtime "https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/core/realtime/realtime-update.service.ts"
click node_refresh "https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/shared/services/live-refresh/live-refresh.service.ts"
click node_realtimeapi "https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/shared/services/realtime/realtime.service.ts"
click node_apiapp "https://github.com/svenson95/reelscore/blob/main/apps/api/src/app.ts"
click node_dbapi "https://github.com/svenson95/reelscore/tree/main/apps/api/src/database"
click node_search "https://github.com/svenson95/reelscore/blob/main/apps/api/src/search/search.controller.ts"
click node_analysis "https://github.com/svenson95/reelscore/blob/main/apps/api/src/fixture-analyses/fixture-analyses.controller.ts"
click node_evaluation "https://github.com/svenson95/reelscore/blob/main/apps/api/src/fixture-evaluations/fixture-evaluations.controller.ts"
click node_livestream "https://github.com/svenson95/reelscore/tree/main/apps/api/src/livestream"
click node_mongodb "https://github.com/svenson95/reelscore/blob/main/apps/api/src/database/mongodb.helper.ts"
click node_fixturedata "https://github.com/svenson95/reelscore/blob/main/apps/api/src/database/fixture-events/fixture-events.model.ts"
click node_standings "https://github.com/svenson95/reelscore/blob/main/apps/api/src/database/standings/standings.model.ts"
click node_topscorers "https://github.com/svenson95/reelscore/blob/main/apps/api/src/database/top-scorers/top-scorers.model.ts"

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_router,node_overview,node_competition,node_match,node_clientdata toneBlue
class node_apiapp,node_dbapi,node_search,node_analysis,node_evaluation,node_livestream toneAmber
class node_mongodb,node_fixturedata,node_standings,node_topscorers toneMint
class node_clientrealtime,node_refresh,node_realtimeapi toneRose
class node_visitor toneIndigo
```

## Components

### Angular client

- [App routes](https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/app.routes.ts): `apps/client/src/app/app.routes.ts`
- [Fixture overview](https://github.com/svenson95/reelscore/tree/main/apps/client/src/app/features/overview): `apps/client/src/app/features/overview`
- [Competition view](https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/features/competition/competition.page.ts): `apps/client/src/app/features/competition/competition.page.ts`
- [Match details](https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/features/match/match.page.ts): `apps/client/src/app/features/match/match.page.ts`
- [Client data access](https://github.com/svenson95/reelscore/tree/main/apps/client/src/app/features): `apps/client/src/app/features`

### Express API

- [API application](https://github.com/svenson95/reelscore/blob/main/apps/api/src/app.ts): `apps/api/src/app.ts`
- [Football data endpoints](https://github.com/svenson95/reelscore/tree/main/apps/api/src/database): `apps/api/src/database`
- [Search](https://github.com/svenson95/reelscore/blob/main/apps/api/src/search/search.controller.ts): `apps/api/src/search/search.controller.ts`
- [Fixture analyses](https://github.com/svenson95/reelscore/blob/main/apps/api/src/fixture-analyses/fixture-analyses.controller.ts): `apps/api/src/fixture-analyses/fixture-analyses.controller.ts`
- [Fixture evaluations](https://github.com/svenson95/reelscore/blob/main/apps/api/src/fixture-evaluations/fixture-evaluations.controller.ts): `apps/api/src/fixture-evaluations/fixture-evaluations.controller.ts`
- [Livestream](https://github.com/svenson95/reelscore/tree/main/apps/api/src/livestream): `apps/api/src/livestream`

### Football data

- [MongoDB access](https://github.com/svenson95/reelscore/blob/main/apps/api/src/database/mongodb.helper.ts): `apps/api/src/database/mongodb.helper.ts`
- [Fixture records](https://github.com/svenson95/reelscore/blob/main/apps/api/src/database/fixture-events/fixture-events.model.ts): `apps/api/src/database/fixture-events/fixture-events.model.ts`
- [Standings records](https://github.com/svenson95/reelscore/blob/main/apps/api/src/database/standings/standings.model.ts): `apps/api/src/database/standings/standings.model.ts`
- [Top scorer records](https://github.com/svenson95/reelscore/blob/main/apps/api/src/database/top-scorers/top-scorers.model.ts): `apps/api/src/database/top-scorers/top-scorers.model.ts`

### Live updates

- [Realtime handling](https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/core/realtime/realtime-update.service.ts): `apps/client/src/app/core/realtime/realtime-update.service.ts`
- [Live refresh](https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/shared/services/live-refresh/live-refresh.service.ts): `apps/client/src/app/shared/services/live-refresh/live-refresh.service.ts`
- [Realtime service](https://github.com/svenson95/reelscore/blob/main/apps/client/src/app/shared/services/realtime/realtime.service.ts): `apps/client/src/app/shared/services/realtime/realtime.service.ts`

### Other components

- **Football fan**

## Connections

- Football fan → App routes: navigates (evidence: `apps/client/src/app/app.routes.ts`)
- App routes → Fixture overview: routes to (evidence: `apps/client/src/app/app.routes.ts`)
- App routes → Competition view: routes to (evidence: `apps/client/src/app/app.routes.ts`)
- App routes → Match details: routes to (evidence: `apps/client/src/app/app.routes.ts`)
- Fixture overview → Client data access: loads data (evidence: `apps/client/src/app/features/overview/services/overview-refresh.service.ts`)
- Competition view → Client data access: loads data
- Match details → Client data access: loads data
- Client data access → API application: requests data (evidence: `README.md`)
- API application → Football data endpoints: mounts routes (evidence: `apps/api/src/app.ts`)
- API application → Search: mounts route (evidence: `apps/api/src/app.ts`)
- API application → Fixture analyses: mounts route (evidence: `apps/api/src/app.ts`)
- API application → Fixture evaluations: mounts route (evidence: `apps/api/src/app.ts`)
- API application → Livestream: mounts route (evidence: `apps/api/src/app.ts`)
- Search → MongoDB access: queries (evidence: `apps/api/src/search/search.controller.ts`)
- Fixture analyses → Football data endpoints: reads fixtures/events (evidence: `apps/api/src/fixture-analyses/fixture-analyses.controller.ts`)
- Fixture evaluations → Football data endpoints: loads fixture history (evidence: `apps/api/src/fixture-evaluations/fixture-evaluations.controller.ts`)
- Football data endpoints → MongoDB access: accesses database (evidence: `apps/api/src/database/fixture-statistics/fixture-statistics.controller.ts`)
- MongoDB access → Fixture records: reads and writes
- MongoDB access → Standings records: reads and writes
- MongoDB access → Top scorer records: reads and writes
- Realtime service → Live refresh: drives refresh (evidence: `apps/client/src/app/shared/services/realtime/realtime.service.ts`)
- Realtime handling → Realtime service: receives updates (evidence: `apps/client/src/app/core/realtime/realtime-update.service.ts`)
