# critsource/critsource architecture

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

- Interactive diagram: https://gitdiagram.com/critsource/critsource
- Repository: https://github.com/critsource/critsource

## Overview

D&D Mapp is an early-development Angular web app; the README explicitly says its advertised rules, character, world, and play features do not yet exist. The tree supports a thin web/core shell and a shared UI package, but no implemented domain workflow for those planned features. The graph therefore shows current runtime behavior where evidenced, plus the substantial design-token and release packages documented as workspace projects. Source excerpts and the index are limited, so unsupported wiring is omitted.

Main entry points: [`packages/design-tokens/src/main.ts`](https://github.com/critsource/critsource/blob/main/packages/design-tokens/src/main.ts) (Token generator), [`packages/release/src/cli.ts`](https://github.com/critsource/critsource/blob/main/packages/release/src/cli.ts) (CLI dispatcher), [`packages/release/src/commands/bump.ts`](https://github.com/critsource/critsource/blob/main/packages/release/src/commands/bump.ts) (Version bump), [`packages/release/src/main.ts`](https://github.com/critsource/critsource/blob/main/packages/release/src/main.ts) (Release entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_web_entry["Web entry<br/>[main.ts]"]
  node_core_config["App config<br/>[app.config.ts]"]
  node_routes["App routes<br/>[app.routes.ts]"]
  node_root["Root component<br/>[root.component.ts]"]
end

subgraph group_ui["Shared UI"]
  node_components["UI components"]
  node_theme["Theme service<br/>[theme.service.ts]"]
  node_storage["Storage service<br/>[storage.service.ts]"]
  node_storage_token["Browser storage token<br/>[storage.token.ts]"]
end

subgraph group_design["Design tokens"]
  node_token_cli["Token generator<br/>[main.ts]"]
  node_css_builder["CSS builder<br/>[build.ts]"]
  node_font_builder["Font builder<br/>[font-faces.ts]"]
  node_breakpoints["Breakpoint builder<br/>[breakpoints.ts]"]
  node_token_check["Output checker<br/>[check.ts]"]
end

subgraph group_release["Release CLI"]
  node_release_entry["Release entry<br/>[main.ts]"]
  node_release_cli["CLI dispatcher<br/>[cli.ts]"]
  node_bump["Version bump<br/>[bump.ts]"]
  node_changelog["Changelog logic<br/>[changelog.ts]"]
  node_project["Project files<br/>[project.ts]"]
  node_git_adapter["Git tag adapter<br/>[git.ts]"]
end

node_user(("DM or player"))

node_core_config -->|"configures routes"| node_routes
node_theme -->|"uses storage"| node_storage
node_storage -->|"injects token"| node_storage_token
node_token_cli -->|"builds CSS"| node_css_builder
node_token_cli -->|"builds fonts"| node_font_builder
node_token_cli -->|"builds breakpoints"| node_breakpoints
node_token_cli -->|"checks outputs"| node_token_check
node_release_entry -->|"runs CLI"| node_release_cli
node_release_entry -->|"lists tags"| node_git_adapter
node_release_cli -->|"dispatches bump"| node_bump
node_release_cli -->|"resolves project"| node_project
node_bump -->|"reads and updates"| node_changelog
node_bump -->|"reads and writes"| node_project

click node_web_entry "https://github.com/critsource/critsource/blob/main/apps/web/src/main.ts"
click node_core_config "https://github.com/critsource/critsource/blob/main/packages/core/web/src/config/app.config.ts"
click node_routes "https://github.com/critsource/critsource/blob/main/packages/core/web/src/config/app.routes.ts"
click node_root "https://github.com/critsource/critsource/blob/main/packages/core/web/src/root/root.component.ts"
click node_components "https://github.com/critsource/critsource/tree/main/packages/ui/web/src/components"
click node_theme "https://github.com/critsource/critsource/blob/main/packages/ui/web/src/theme/theme.service.ts"
click node_storage "https://github.com/critsource/critsource/blob/main/packages/ui/web/src/storage/storage.service.ts"
click node_storage_token "https://github.com/critsource/critsource/blob/main/packages/ui/web/src/storage/storage.token.ts"
click node_token_cli "https://github.com/critsource/critsource/blob/main/packages/design-tokens/src/main.ts"
click node_css_builder "https://github.com/critsource/critsource/blob/main/packages/design-tokens/src/build.ts"
click node_font_builder "https://github.com/critsource/critsource/blob/main/packages/design-tokens/src/font-faces.ts"
click node_breakpoints "https://github.com/critsource/critsource/blob/main/packages/design-tokens/src/breakpoints.ts"
click node_token_check "https://github.com/critsource/critsource/blob/main/packages/design-tokens/src/check.ts"
click node_release_entry "https://github.com/critsource/critsource/blob/main/packages/release/src/main.ts"
click node_release_cli "https://github.com/critsource/critsource/blob/main/packages/release/src/cli.ts"
click node_bump "https://github.com/critsource/critsource/blob/main/packages/release/src/commands/bump.ts"
click node_changelog "https://github.com/critsource/critsource/blob/main/packages/release/src/changelog.ts"
click node_project "https://github.com/critsource/critsource/blob/main/packages/release/src/project.ts"
click node_git_adapter "https://github.com/critsource/critsource/blob/main/packages/release/src/adapters/git.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_web_entry,node_core_config,node_routes,node_root toneBlue
class node_components,node_theme,node_storage,node_storage_token toneAmber
class node_token_cli,node_css_builder,node_font_builder,node_breakpoints,node_token_check toneMint
class node_release_entry,node_release_cli,node_bump,node_changelog,node_project,node_git_adapter toneRose
class node_user toneIndigo
```

## Components

### Web application

- [Web entry](https://github.com/critsource/critsource/blob/main/apps/web/src/main.ts): `apps/web/src/main.ts`
- [App config](https://github.com/critsource/critsource/blob/main/packages/core/web/src/config/app.config.ts): `packages/core/web/src/config/app.config.ts`
- [App routes](https://github.com/critsource/critsource/blob/main/packages/core/web/src/config/app.routes.ts): `packages/core/web/src/config/app.routes.ts`
- [Root component](https://github.com/critsource/critsource/blob/main/packages/core/web/src/root/root.component.ts): `packages/core/web/src/root/root.component.ts`

### Shared UI

- [UI components](https://github.com/critsource/critsource/tree/main/packages/ui/web/src/components): `packages/ui/web/src/components`
- [Theme service](https://github.com/critsource/critsource/blob/main/packages/ui/web/src/theme/theme.service.ts): `packages/ui/web/src/theme/theme.service.ts`
- [Storage service](https://github.com/critsource/critsource/blob/main/packages/ui/web/src/storage/storage.service.ts): `packages/ui/web/src/storage/storage.service.ts`
- [Browser storage token](https://github.com/critsource/critsource/blob/main/packages/ui/web/src/storage/storage.token.ts): `packages/ui/web/src/storage/storage.token.ts`

### Design tokens

- [Token generator](https://github.com/critsource/critsource/blob/main/packages/design-tokens/src/main.ts): `packages/design-tokens/src/main.ts`
- [CSS builder](https://github.com/critsource/critsource/blob/main/packages/design-tokens/src/build.ts): `packages/design-tokens/src/build.ts`
- [Font builder](https://github.com/critsource/critsource/blob/main/packages/design-tokens/src/font-faces.ts): `packages/design-tokens/src/font-faces.ts`
- [Breakpoint builder](https://github.com/critsource/critsource/blob/main/packages/design-tokens/src/breakpoints.ts): `packages/design-tokens/src/breakpoints.ts`
- [Output checker](https://github.com/critsource/critsource/blob/main/packages/design-tokens/src/check.ts): `packages/design-tokens/src/check.ts`

### Release CLI

- [Release entry](https://github.com/critsource/critsource/blob/main/packages/release/src/main.ts): `packages/release/src/main.ts`
- [CLI dispatcher](https://github.com/critsource/critsource/blob/main/packages/release/src/cli.ts): `packages/release/src/cli.ts`
- [Version bump](https://github.com/critsource/critsource/blob/main/packages/release/src/commands/bump.ts): `packages/release/src/commands/bump.ts`
- [Changelog logic](https://github.com/critsource/critsource/blob/main/packages/release/src/changelog.ts): `packages/release/src/changelog.ts`
- [Project files](https://github.com/critsource/critsource/blob/main/packages/release/src/project.ts): `packages/release/src/project.ts`
- [Git tag adapter](https://github.com/critsource/critsource/blob/main/packages/release/src/adapters/git.ts): `packages/release/src/adapters/git.ts`

### Other components

- **DM or player**

## Connections

- App config → App routes: configures routes (evidence: `packages/core/web/src/config/app.config.ts`)
- Theme service → Storage service: uses storage (evidence: `packages/ui/web/src/theme/theme.service.ts`)
- Storage service → Browser storage token: injects token (evidence: `packages/ui/web/src/storage/storage.service.ts`)
- Token generator → CSS builder: builds CSS (evidence: `packages/design-tokens/src/main.ts`)
- Token generator → Font builder: builds fonts (evidence: `packages/design-tokens/src/main.ts`)
- Token generator → Breakpoint builder: builds breakpoints (evidence: `packages/design-tokens/src/main.ts`)
- Token generator → Output checker: checks outputs (evidence: `packages/design-tokens/src/main.ts`)
- Release entry → CLI dispatcher: runs CLI (evidence: `packages/release/src/main.ts`)
- Release entry → Git tag adapter: lists tags (evidence: `packages/release/src/main.ts`)
- CLI dispatcher → Version bump: dispatches bump (evidence: `packages/release/src/cli.ts`)
- CLI dispatcher → Project files: resolves project (evidence: `packages/release/src/cli.ts`)
- Version bump → Changelog logic: reads and updates (evidence: `packages/release/src/commands/bump.ts`)
- Version bump → Project files: reads and writes (evidence: `packages/release/src/commands/bump.ts`)
