# omikolaj/the-p-league architecture

> Architecture diagram of the GitHub repository omikolaj/the-p-league, 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/omikolaj/the-p-league
- Repository: https://github.com/omikolaj/the-p-league

## Overview

ThePLeague is an Angular frontend for a local basketball league, with public league information and team signup, schedules, a photo gallery, merchandise pre-orders, and URL-hidden administration. The user enters through the application shell and navigates to feature routes; sampled services fetch and mutate gallery and merchandise data through the backend API. The admin routes guard dashboard, schedule administration, and scoreboards. Schedule management, signup, and pre-order internals are represented from the file tree and README, but their call paths were not sampled, so those links are omitted.

Main entry points: [`src/app/app-routing.module.ts`](https://github.com/omikolaj/the-p-league/blob/master/src/app/app-routing.module.ts) (Feature routing), [`src/app/views/admin/admin-routing.module.ts`](https://github.com/omikolaj/the-p-league/blob/master/src/app/views/admin/admin-routing.module.ts) (Admin routes), [`src/app/core/services/gallery/gallery.service.ts`](https://github.com/omikolaj/the-p-league/blob/master/src/app/core/services/gallery/gallery.service.ts) (Gallery service), [`src/app/core/services/merchandise/merchandise.service.ts`](https://github.com/omikolaj/the-p-league/blob/master/src/app/core/services/merchandise/merchandise.service.ts) (Merchandise service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_app["Angular app<br/>[app.component.ts]"]
  node_routing["Feature routing"]
end

subgraph group_public["Public features"]
  node_schedule["Schedules"]
  node_signup["Team signup"]
  node_gallery["Photo gallery"]
  node_merch["Merchandise store"]
  node_preorder["Pre-order flow"]
end

subgraph group_admin["League administration"]
  node_adminroute["Admin routes"]
  node_adminlogin["Admin login"]
  node_adminschedule["Schedule management"]
  node_scoreboards["Scoreboards"]
end

subgraph group_platform["Shared platform"]
  node_gallerydata["Gallery service<br/>[gallery.service.ts]"]
  node_merchdata["Merchandise service"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_tokenrefresh["Token refresh"]
  node_events["Event bus"]
end

node_user(("League user"))
node_backend["ASP.NET API"]

node_user -->|"uses"| node_app
node_app -->|"hosts routes"| node_routing
node_routing -->|"loads feature"| node_schedule
node_routing -->|"loads feature"| node_signup
node_routing -->|"loads feature"| node_gallery
node_routing -->|"loads feature"| node_merch
node_routing -->|"loads feature"| node_adminroute
node_adminroute -->|"routes to"| node_adminlogin
node_adminroute -->|"guards and resolves"| node_adminschedule
node_adminroute -->|"guards and resolves"| node_scoreboards
node_gallerydata -->|"reads and updates"| node_backend
node_merchdata -->|"reads and updates"| node_backend
node_preorder -.->|"submits orders"| node_backend
node_auth -->|"authenticates"| node_backend
node_tokenrefresh -->|"refreshes token"| node_auth
node_gallerydata -->|"emits status"| node_events
node_merchdata -->|"emits status"| node_events

click node_app "https://github.com/omikolaj/the-p-league/blob/master/src/app/app.component.ts"
click node_routing "https://github.com/omikolaj/the-p-league/blob/master/src/app/app-routing.module.ts"
click node_schedule "https://github.com/omikolaj/the-p-league/tree/master/src/app/views/schedule"
click node_signup "https://github.com/omikolaj/the-p-league/tree/master/src/app/views/about/components/team-signup"
click node_gallery "https://github.com/omikolaj/the-p-league/blob/master/src/app/views/gallery/gallery-grid-list.component.ts"
click node_gallerydata "https://github.com/omikolaj/the-p-league/blob/master/src/app/core/services/gallery/gallery.service.ts"
click node_merch "https://github.com/omikolaj/the-p-league/blob/master/src/app/views/merchandise/merchandise-list/merchandise-list.component.ts"
click node_merchdata "https://github.com/omikolaj/the-p-league/blob/master/src/app/core/services/merchandise/merchandise.service.ts"
click node_preorder "https://github.com/omikolaj/the-p-league/blob/master/src/app/core/services/pre-order/pre-order.service.ts"
click node_adminroute "https://github.com/omikolaj/the-p-league/blob/master/src/app/views/admin/admin-routing.module.ts"
click node_adminlogin "https://github.com/omikolaj/the-p-league/blob/master/src/app/views/admin/admin-login/admin-login.component.ts"
click node_adminschedule "https://github.com/omikolaj/the-p-league/blob/master/src/app/views/admin/schedule-administration/schedule-administration.component.ts"
click node_scoreboards "https://github.com/omikolaj/the-p-league/blob/master/src/app/views/admin/scoreboards/scoreboards.component.ts"
click node_auth "https://github.com/omikolaj/the-p-league/blob/master/src/app/core/services/auth/auth.service.ts"
click node_tokenrefresh "https://github.com/omikolaj/the-p-league/blob/master/src/app/core/interceptors/refresh-access-token/refresh-access-token.service.ts"
click node_events "https://github.com/omikolaj/the-p-league/blob/master/src/app/core/services/event-bus/event-bus.service.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_app,node_routing,node_user toneBlue
class node_schedule,node_signup,node_gallery,node_merch,node_preorder toneAmber
class node_adminroute,node_adminlogin,node_adminschedule,node_scoreboards,node_backend toneMint
class node_gallerydata,node_merchdata,node_auth,node_tokenrefresh,node_events toneRose
```

## Components

### Application shell

- [Angular app](https://github.com/omikolaj/the-p-league/blob/master/src/app/app.component.ts): `src/app/app.component.ts`
- [Feature routing](https://github.com/omikolaj/the-p-league/blob/master/src/app/app-routing.module.ts): `src/app/app-routing.module.ts`

### Public features

- [Schedules](https://github.com/omikolaj/the-p-league/tree/master/src/app/views/schedule): `src/app/views/schedule`
- [Team signup](https://github.com/omikolaj/the-p-league/tree/master/src/app/views/about/components/team-signup): `src/app/views/about/components/team-signup`
- [Photo gallery](https://github.com/omikolaj/the-p-league/blob/master/src/app/views/gallery/gallery-grid-list.component.ts): `src/app/views/gallery/gallery-grid-list.component.ts`
- [Merchandise store](https://github.com/omikolaj/the-p-league/blob/master/src/app/views/merchandise/merchandise-list/merchandise-list.component.ts): `src/app/views/merchandise/merchandise-list/merchandise-list.component.ts`
- [Pre-order flow](https://github.com/omikolaj/the-p-league/blob/master/src/app/core/services/pre-order/pre-order.service.ts): `src/app/core/services/pre-order/pre-order.service.ts`

### League administration

- [Admin routes](https://github.com/omikolaj/the-p-league/blob/master/src/app/views/admin/admin-routing.module.ts): `src/app/views/admin/admin-routing.module.ts`
- [Admin login](https://github.com/omikolaj/the-p-league/blob/master/src/app/views/admin/admin-login/admin-login.component.ts): `src/app/views/admin/admin-login/admin-login.component.ts`
- [Schedule management](https://github.com/omikolaj/the-p-league/blob/master/src/app/views/admin/schedule-administration/schedule-administration.component.ts): `src/app/views/admin/schedule-administration/schedule-administration.component.ts`
- [Scoreboards](https://github.com/omikolaj/the-p-league/blob/master/src/app/views/admin/scoreboards/scoreboards.component.ts): `src/app/views/admin/scoreboards/scoreboards.component.ts`

### Shared platform

- [Gallery service](https://github.com/omikolaj/the-p-league/blob/master/src/app/core/services/gallery/gallery.service.ts): `src/app/core/services/gallery/gallery.service.ts`
- [Merchandise service](https://github.com/omikolaj/the-p-league/blob/master/src/app/core/services/merchandise/merchandise.service.ts): `src/app/core/services/merchandise/merchandise.service.ts`
- [Authentication](https://github.com/omikolaj/the-p-league/blob/master/src/app/core/services/auth/auth.service.ts): `src/app/core/services/auth/auth.service.ts`
- [Token refresh](https://github.com/omikolaj/the-p-league/blob/master/src/app/core/interceptors/refresh-access-token/refresh-access-token.service.ts): `src/app/core/interceptors/refresh-access-token/refresh-access-token.service.ts`
- [Event bus](https://github.com/omikolaj/the-p-league/blob/master/src/app/core/services/event-bus/event-bus.service.ts): `src/app/core/services/event-bus/event-bus.service.ts`

### Other components

- **League user**
- **ASP.NET API**

## Connections

- League user → Angular app: uses
- Angular app → Feature routing: hosts routes (evidence: `src/app/app.component.ts`)
- Feature routing → Schedules: loads feature (evidence: `src/app/app-routing.module.ts`)
- Feature routing → Team signup: loads feature (evidence: `src/app/app-routing.module.ts`)
- Feature routing → Photo gallery: loads feature (evidence: `src/app/app-routing.module.ts`)
- Feature routing → Merchandise store: loads feature (evidence: `src/app/app-routing.module.ts`)
- Feature routing → Admin routes: loads feature (evidence: `src/app/app-routing.module.ts`)
- Admin routes → Admin login: routes to (evidence: `src/app/views/admin/admin-routing.module.ts`)
- Admin routes → Schedule management: guards and resolves (evidence: `src/app/views/admin/admin-routing.module.ts`)
- Admin routes → Scoreboards: guards and resolves (evidence: `src/app/views/admin/admin-routing.module.ts`)
- Gallery service → ASP.NET API: reads and updates (evidence: `src/app/core/services/gallery/gallery.service.ts`)
- Merchandise service → ASP.NET API: reads and updates (evidence: `src/app/core/services/merchandise/merchandise.service.ts`)
- Pre-order flow → ASP.NET API: submits orders
- Authentication → ASP.NET API: authenticates (evidence: `src/app/core/services/auth/auth.service.ts`)
- Token refresh → Authentication: refreshes token (evidence: `src/app/core/interceptors/refresh-access-token/refresh-access-token.service.ts`)
- Gallery service → Event bus: emits status (evidence: `src/app/core/services/gallery/gallery.service.ts`)
- Merchandise service → Event bus: emits status (evidence: `src/app/core/services/merchandise/merchandise.service.ts`)
