# premoved/premovedprep architecture

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

- Interactive diagram: https://gitdiagram.com/premoved/premovedprep
- Repository: https://github.com/premoved/premovedprep

## Overview

PremovedPrep is a chess tournament-preparation frontend. Its principal workflow is to find an opponent and inspect their archived games, then analyze positions and build a repertoire or save study material in collections. The graph also preserves authentication, encrypted-vault handling, cloud storage, and engine analysis as distinct product capabilities. The README and route excerpt establish the product flow; source excerpts show engine, session, vault, and storage responsibilities. Several feature implementations were not sampled, so uncertain internal links are omitted.

Main entry points: [`src/app/features/analysis-board/analysis-board.component.ts`](https://github.com/premoved/premovedprep/blob/main/src/app/features/analysis-board/analysis-board.component.ts) (Analysis board), [`src/app/features/analysis-board/state/engine.store.ts`](https://github.com/premoved/premovedprep/blob/main/src/app/features/analysis-board/state/engine.store.ts) (Engine state), [`src/app/core/services/cloud-storage.service.ts`](https://github.com/premoved/premovedprep/blob/main/src/app/core/services/cloud-storage.service.ts) (Cloud storage), [`src/app/features/home/home.component.ts`](https://github.com/premoved/premovedprep/blob/main/src/app/features/home/home.component.ts) (Preparation home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Opponent discovery"]
  node_home["Preparation home<br/>[home.component.ts]"]
  node_search["Game search"]
  node_opponent["Opponent explorer"]
  node_searchapi["Search API"]
end

subgraph group_analysis["Chess analysis"]
  node_analysisboard["Analysis board"]
  node_movetree["Move tree state<br/>[move-tree.store.ts]"]
  node_chessformat["Chess notation"]
  node_enginestore["Engine state<br/>[engine.store.ts]"]
  node_enginebar["Engine controls"]
  node_enginecatalogue["Engine catalogue"]
  node_enginecapabilities["Device capabilities"]
  node_engineworker["WASM engine transport"]
end

subgraph group_study["Study organization"]
  node_collections["Collections"]
  node_collectionview["Collection studies"]
end

subgraph group_account["Account and storage"]
  node_cloud["Cloud storage"]
  node_collectionapi["Collection API"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_session["Session management<br/>[session.service.ts]"]
  node_vault["Encrypted vault<br/>[vault.service.ts]"]
  node_vaultkeys[("Remembered vault key<br/>[vault-storage.ts]")]
end

node_player(("Chess preparer"))

node_player -->|"starts preparation"| node_home
node_home -->|"searches opponent"| node_search
node_search -->|"explores games"| node_opponent
node_opponent -.->|"analyzes positions"| node_analysisboard
node_analysisboard -.->|"tracks moves"| node_movetree
node_analysisboard -.->|"imports PGN"| node_chessformat
node_analysisboard -->|"offers engine controls"| node_enginebar
node_enginebar -->|"toggles analysis"| node_enginestore
node_enginestore -->|"selects engine"| node_enginecatalogue
node_enginestore -->|"checks device"| node_enginecapabilities
node_enginestore -->|"creates transport"| node_engineworker
node_player -->|"organizes studies"| node_collections
node_collections -->|"opens collection"| node_collectionview
node_collectionview -.->|"builds repertoire"| node_analysisboard
node_cloud -->|"reads storage usage"| node_collectionapi
node_cloud -->|"checks sign-in"| node_auth
node_auth -->|"applies session"| node_session
node_session -->|"restores vault"| node_vault
node_vault -->|"remembers key"| node_vaultkeys

click node_home "https://github.com/premoved/premovedprep/blob/main/src/app/features/home/home.component.ts"
click node_search "https://github.com/premoved/premovedprep/blob/main/src/app/features/search/search-page.component.ts"
click node_opponent "https://github.com/premoved/premovedprep/blob/main/src/app/features/search/opponent-explorer/opponent-explorer.component.ts"
click node_searchapi "https://github.com/premoved/premovedprep/blob/main/src/app/core/services/search-api.service.ts"
click node_analysisboard "https://github.com/premoved/premovedprep/blob/main/src/app/features/analysis-board/analysis-board.component.ts"
click node_movetree "https://github.com/premoved/premovedprep/blob/main/src/app/features/analysis-board/state/move-tree.store.ts"
click node_chessformat "https://github.com/premoved/premovedprep/blob/main/src/app/core/chess/pgn-parser.service.ts"
click node_enginestore "https://github.com/premoved/premovedprep/blob/main/src/app/features/analysis-board/state/engine.store.ts"
click node_enginebar "https://github.com/premoved/premovedprep/blob/main/src/app/features/analysis-board/notation-panel/engine-bar/engine-bar.component.ts"
click node_enginecatalogue "https://github.com/premoved/premovedprep/blob/main/src/app/core/engine/engine-catalogue.ts"
click node_enginecapabilities "https://github.com/premoved/premovedprep/blob/main/src/app/core/engine/engine-capabilities.ts"
click node_engineworker "https://github.com/premoved/premovedprep/blob/main/src/app/core/engine/engine-transport.ts"
click node_collections "https://github.com/premoved/premovedprep/blob/main/src/app/features/collections/collections-page.component.ts"
click node_collectionview "https://github.com/premoved/premovedprep/blob/main/src/app/features/collections/collection-view.component.ts"
click node_cloud "https://github.com/premoved/premovedprep/blob/main/src/app/core/services/cloud-storage.service.ts"
click node_collectionapi "https://github.com/premoved/premovedprep/blob/main/src/app/core/services/collection-api.service.ts"
click node_auth "https://github.com/premoved/premovedprep/blob/main/src/app/core/services/auth.service.ts"
click node_session "https://github.com/premoved/premovedprep/blob/main/src/app/core/auth/session.service.ts"
click node_vault "https://github.com/premoved/premovedprep/blob/main/src/app/core/crypto/vault.service.ts"
click node_vaultkeys "https://github.com/premoved/premovedprep/blob/main/src/app/core/crypto/vault-storage.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_home,node_search,node_opponent,node_searchapi toneBlue
class node_analysisboard,node_movetree,node_chessformat,node_enginestore,node_enginebar,node_enginecatalogue,node_enginecapabilities,node_engineworker toneAmber
class node_collections,node_collectionview toneMint
class node_cloud,node_collectionapi,node_auth,node_session,node_vault,node_vaultkeys toneRose
class node_player toneIndigo
```

## Components

### Opponent discovery

- [Preparation home](https://github.com/premoved/premovedprep/blob/main/src/app/features/home/home.component.ts): `src/app/features/home/home.component.ts`
- [Game search](https://github.com/premoved/premovedprep/blob/main/src/app/features/search/search-page.component.ts): `src/app/features/search/search-page.component.ts`
- [Opponent explorer](https://github.com/premoved/premovedprep/blob/main/src/app/features/search/opponent-explorer/opponent-explorer.component.ts): `src/app/features/search/opponent-explorer/opponent-explorer.component.ts`
- [Search API](https://github.com/premoved/premovedprep/blob/main/src/app/core/services/search-api.service.ts): `src/app/core/services/search-api.service.ts`

### Chess analysis

- [Analysis board](https://github.com/premoved/premovedprep/blob/main/src/app/features/analysis-board/analysis-board.component.ts): `src/app/features/analysis-board/analysis-board.component.ts`
- [Move tree state](https://github.com/premoved/premovedprep/blob/main/src/app/features/analysis-board/state/move-tree.store.ts): `src/app/features/analysis-board/state/move-tree.store.ts`
- [Chess notation](https://github.com/premoved/premovedprep/blob/main/src/app/core/chess/pgn-parser.service.ts): `src/app/core/chess/pgn-parser.service.ts`
- [Engine state](https://github.com/premoved/premovedprep/blob/main/src/app/features/analysis-board/state/engine.store.ts): `src/app/features/analysis-board/state/engine.store.ts`
- [Engine controls](https://github.com/premoved/premovedprep/blob/main/src/app/features/analysis-board/notation-panel/engine-bar/engine-bar.component.ts): `src/app/features/analysis-board/notation-panel/engine-bar/engine-bar.component.ts`
- [Engine catalogue](https://github.com/premoved/premovedprep/blob/main/src/app/core/engine/engine-catalogue.ts): `src/app/core/engine/engine-catalogue.ts`
- [Device capabilities](https://github.com/premoved/premovedprep/blob/main/src/app/core/engine/engine-capabilities.ts): `src/app/core/engine/engine-capabilities.ts`
- [WASM engine transport](https://github.com/premoved/premovedprep/blob/main/src/app/core/engine/engine-transport.ts): `src/app/core/engine/engine-transport.ts`

### Study organization

- [Collections](https://github.com/premoved/premovedprep/blob/main/src/app/features/collections/collections-page.component.ts): `src/app/features/collections/collections-page.component.ts`
- [Collection studies](https://github.com/premoved/premovedprep/blob/main/src/app/features/collections/collection-view.component.ts): `src/app/features/collections/collection-view.component.ts`

### Account and storage

- [Cloud storage](https://github.com/premoved/premovedprep/blob/main/src/app/core/services/cloud-storage.service.ts): `src/app/core/services/cloud-storage.service.ts`
- [Collection API](https://github.com/premoved/premovedprep/blob/main/src/app/core/services/collection-api.service.ts): `src/app/core/services/collection-api.service.ts`
- [Authentication](https://github.com/premoved/premovedprep/blob/main/src/app/core/services/auth.service.ts): `src/app/core/services/auth.service.ts`
- [Session management](https://github.com/premoved/premovedprep/blob/main/src/app/core/auth/session.service.ts): `src/app/core/auth/session.service.ts`
- [Encrypted vault](https://github.com/premoved/premovedprep/blob/main/src/app/core/crypto/vault.service.ts): `src/app/core/crypto/vault.service.ts`
- [Remembered vault key](https://github.com/premoved/premovedprep/blob/main/src/app/core/crypto/vault-storage.ts): `src/app/core/crypto/vault-storage.ts`

### Other components

- **Chess preparer**

## Connections

- Chess preparer → Preparation home: starts preparation
- Preparation home → Game search: searches opponent
- Game search → Opponent explorer: explores games
- Opponent explorer → Analysis board: analyzes positions
- Analysis board → Move tree state: tracks moves
- Analysis board → Chess notation: imports PGN
- Analysis board → Engine controls: offers engine controls (evidence: `src/app/features/analysis-board/notation-panel/engine-bar/engine-bar.component.ts`)
- Engine controls → Engine state: toggles analysis (evidence: `src/app/features/analysis-board/notation-panel/engine-bar/engine-bar.component.ts`)
- Engine state → Engine catalogue: selects engine (evidence: `src/app/features/analysis-board/state/engine.store.ts`)
- Engine state → Device capabilities: checks device (evidence: `src/app/features/analysis-board/state/engine.store.ts`)
- Engine state → WASM engine transport: creates transport (evidence: `src/app/features/analysis-board/state/engine.store.ts`)
- Chess preparer → Collections: organizes studies
- Collections → Collection studies: opens collection (evidence: `src/app/app.routes.ts`)
- Collection studies → Analysis board: builds repertoire
- Cloud storage → Collection API: reads storage usage (evidence: `src/app/core/services/cloud-storage.service.ts`)
- Cloud storage → Authentication: checks sign-in (evidence: `src/app/core/services/cloud-storage.service.ts`)
- Authentication → Session management: applies session (evidence: `src/app/core/services/auth.service.ts`)
- Session management → Encrypted vault: restores vault (evidence: `src/app/core/auth/session.service.ts`)
- Encrypted vault → Remembered vault key: remembers key (evidence: `src/app/core/crypto/vault.service.ts`)
