# chompy78/pact_players architecture

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

- Interactive diagram: https://gitdiagram.com/chompy78/pact_players
- Repository: https://github.com/chompy78/pact_players

## Overview

1. **What this repo is**
   - This is a **Quartz-based static site** for the *PACT Campaign 2026* reference. The primary product is a browsable campaign knowledge base, not an app with a runtime backend.
   - The site’s editorial content lives in `content/`, while the Quartz framework code that builds and renders the site lives in `quartz/`.

2. **Main content boundary**
   - `content/` is the authored source of truth: session logs, NPCs, locations, factions, maps, handouts, and rules reference.
   - Pages are mostly Markdown with `index.md` files controlling section landing pages and nested folders for hierarchy.
   - This content layer is separate from the framework layer, which means the site can be updated primarily by editing Markdown rather than application code.

3. **Framework and documentation boundary**
   - `docs/` is the Quartz project’s own documentation and feature reference, including plugin docs and user-facing setup guides.
   - The presence of both `content/` and `docs/` indicates a repository that combines:
     - a live campaign site
     - the underlying site generator/framework documentation

4. **Build entrypoints and configuration**
   - `quartz.ts`, `quartz/build.ts`, `quartz/worker.ts`, and the bootstrap files are the main runtime/build entrypoints.
   - `quartz.config.yaml` and `quartz.config.default.yaml` define site behavior, theme, plugins, and content processing options.
   - `quartz.lock.json` and `package-lock.json` indicate pinned dependency and plugin resolution for reproducible builds.

5. **Content processing pipeline**
   - Quartz uses a staged pipeline under `quartz/processors/`:
     - **parse** content into an internal file representation
     - **filter** which files/pages should be included
     - **emit** rendered output and static artifacts
   - The repo uses a file/vfile-style abstraction (`quartz/plugins/vfile.ts`) to move content through transformers and emitters.

6. **Plugin-based architecture**
   - The site is assembled from modular plugins in `quartz/plugins/`.
   - Major plugin categories:
     - **loaders**: ingest content, config, Git data, frames, components
     - **transformers**: enrich or rewrite page data
     - **filters**: control visibility and inclusion
     - **emitters**: produce final assets/pages
     - **page types**: dispatch specific layouts like 404 pages or specialized content types
   - This plugin system is the main architectural extension point for the site.

7. **Rendering and UI layer**
   - `quartz/components/` contains the page layout system, reusable UI components, and page frames.
   - Key layout pieces include body, header, head metadata, navigation, page lists, and responsive variants.
   - `quartz/components/pages/` and `quartz/components/frames/` indicate the site supports multiple page shells rather than one fixed template.

8. **Client-side behavior**
   - `quartz/components/scripts/` provides browser-side behavior such as:
     - SPA-style navigation
     - popover previews
     - search-related interactions
   - The site is not purely static HTML; it ships small client scripts for interactive reading/navigation features.

9. **Cross-cutting features**
   - `quartz/plugins` and `docs/features/` show the site supports knowledge-base features typical of Quartz:
     - backlinks, breadcrumbs, graph view
     - wikilinks and Obsidian-style compatibility
     - folder/tag listings, search, TOC, dark mode
     - citations, LaTeX, Mermaid, and other content enrichments
   - `quartz/i18n/` shows localization support, so page chrome and feature labels can be translated.

10. **Styling and static assets**
   - Global and feature-specific styles live in `quartz/styles/` and component SCSS files.
   - Static assets, including Giscus theme CSS, live under `quartz/static/`.
   - The visual layer is bundled with the generated site rather than served from a separate frontend app.

11. **Command-line and automation surface**
   - `quartz/cli/` provides commands for build, create, sync, restore, plugin management, TUI interaction, and upgrades.
   - This suggests a workflow where content authors can manage the site from the command line, not only through manual file editing.

12. **Deployment and infrastructure**
   - GitHub Actions workflows cover CI, preview builds, Pages deployment, versioned deployment, and Docker image build/push.
   - `Dockerfile` indicates the site can also be packaged as a container for self-hosting or CI-based publishing.
   - Net effect: source Markdown and config are turned into a deployable static site, then published via GitHub Pages or container-based workflows.

13. **Testing and quality gates**
   - There are tests in components, CLI helpers, and utility modules, indicating the repo validates both build logic and interactive behavior.
   - Tooling files like `.prettierrc`, `.node-version`, and TypeScript config show the project is built and maintained as a typed Node/TypeScript codebase.

14. **Architectural summary for a diagram**
   - The central flow is: **Markdown content + Quartz config → Quartz parsing/plugin pipeline → rendered static site assets → deployment**.
   - The strongest boundary is between **authorable content** (`content/`) and **framework/runtime logic** (`quartz/`), with `docs/` serving as the framework’s own reference and `github/workflows`/`Dockerfile` handling delivery.

Main entry points: [`quartz/plugins`](https://github.com/chompy78/pact_players/tree/main/quartz/plugins) (Plugin system), [`quartz/components`](https://github.com/chompy78/pact_players/tree/main/quartz/components) (UI components), [`quartz.ts`](https://github.com/chompy78/pact_players/blob/main/quartz.ts) (Build entrypoints), [`quartz/processors`](https://github.com/chompy78/pact_players/tree/main/quartz/processors) (Content pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Authoring content"]
  node_content["Campaign notes<br/>markdown source"]
  node_docs["Framework docs<br/>documentation"]
end

subgraph group_framework["Quartz framework"]
  node_config["Site config<br/>yaml config<br/>[quartz.config.yaml]"]
  node_defaults["Default config<br/>baseline config"]
  node_processors{{"Content pipeline<br/>parse-filter-emit"}}
  node_plugins{{"Plugin system<br/>extension core"}}
  node_loaders["Loaders<br/>plugin loading"]
  node_transformers["Transformers<br/>plugin transforms"]
  node_filters["Filters<br/>plugin gating"]
  node_emitters["Emitters<br/>asset output"]
  node_page_types["Page types<br/>page dispatch"]
  node_components["UI components<br/>layout system"]
  node_scripts["Client scripts<br/>browser behavior"]
  node_styles["Styling<br/>scss theme"]
  node_i18n["Localization<br/>translations"]
  node_util["Utilities<br/>shared helpers"]
end

subgraph group_delivery["Build and deploy"]
  node_entrypoints["Build entrypoints<br/>runtime entrypoints<br/>[quartz.ts]"]
  node_cli["CLI tools<br/>command surface"]
  node_workflows["GitHub Actions<br/>ci deployment<br/>[workflows]"]
  node_dockerfile["Docker image<br/>container build"]
end

node_content -->|"source pages"| node_processors
node_docs -.->|"authoring guide"| node_content
node_config -->|"runtime settings"| node_entrypoints
node_defaults -.->|"fallbacks"| node_config
node_entrypoints -->|"drives build"| node_processors
node_processors -->|"invokes plugins"| node_plugins
node_plugins -->|"load stage"| node_loaders
node_plugins -->|"transform stage"| node_transformers
node_plugins -->|"filter stage"| node_filters
node_plugins -->|"emit stage"| node_emitters
node_plugins -->|"page dispatch"| node_page_types
node_processors -->|"render pages"| node_components
node_components -->|"interactive chrome"| node_scripts
node_components -->|"visual theme"| node_styles
node_components -->|"localized labels"| node_i18n
node_components -.->|"shared helpers"| node_util
node_cli -->|"commands"| node_entrypoints
node_workflows -->|"ci build"| node_entrypoints
node_dockerfile -->|"container run"| node_entrypoints
node_emitters -.->|"publish artifacts"| node_workflows

click node_content "https://github.com/chompy78/pact_players/tree/main/content"
click node_docs "https://github.com/chompy78/pact_players/tree/main/docs"
click node_config "https://github.com/chompy78/pact_players/blob/main/quartz.config.yaml"
click node_defaults "https://github.com/chompy78/pact_players/blob/main/quartz.config.default.yaml"
click node_entrypoints "https://github.com/chompy78/pact_players/blob/main/quartz.ts"
click node_processors "https://github.com/chompy78/pact_players/tree/main/quartz/processors"
click node_plugins "https://github.com/chompy78/pact_players/tree/main/quartz/plugins"
click node_loaders "https://github.com/chompy78/pact_players/tree/main/quartz/plugins/loader"
click node_transformers "https://github.com/chompy78/pact_players/tree/main/quartz/plugins/transformers"
click node_filters "https://github.com/chompy78/pact_players/tree/main/quartz/plugins/filters"
click node_emitters "https://github.com/chompy78/pact_players/tree/main/quartz/plugins/emitters"
click node_page_types "https://github.com/chompy78/pact_players/tree/main/quartz/plugins/pageTypes"
click node_components "https://github.com/chompy78/pact_players/tree/main/quartz/components"
click node_scripts "https://github.com/chompy78/pact_players/tree/main/quartz/components/scripts"
click node_styles "https://github.com/chompy78/pact_players/tree/main/quartz/styles"
click node_i18n "https://github.com/chompy78/pact_players/tree/main/quartz/i18n"
click node_cli "https://github.com/chompy78/pact_players/tree/main/quartz/cli"
click node_util "https://github.com/chompy78/pact_players/tree/main/quartz/util"
click node_workflows "https://github.com/chompy78/pact_players/blob/main/.github/workflows"
click node_dockerfile "https://github.com/chompy78/pact_players/tree/main/Dockerfile"

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_content,node_docs toneBlue
class node_config,node_defaults,node_processors,node_plugins,node_loaders,node_transformers,node_filters,node_emitters,node_page_types,node_components,node_scripts,node_styles,node_i18n,node_util toneAmber
class node_entrypoints,node_cli,node_workflows,node_dockerfile toneMint
```

## Components

### Authoring content

Campaign notes and docs edited as Markdown hierarchy

- [Campaign notes](https://github.com/chompy78/pact_players/tree/main/content): markdown source · PACT Campaign 2026 authored pages: sessions, NPCs, locations, factions, maps, and handouts · `content`
- [Framework docs](https://github.com/chompy78/pact_players/tree/main/docs): documentation · Quartz feature, plugin, CLI, and setup reference · `docs`

### Quartz framework

Site generator, rendering, plugins, and shared runtime code

- [Site config](https://github.com/chompy78/pact_players/blob/main/quartz.config.yaml): yaml config · Quartz site behavior, theme, plugins, and processing options · `quartz.config.yaml`
- [Default config](https://github.com/chompy78/pact_players/blob/main/quartz.config.default.yaml): baseline config · Fallback Quartz configuration shipped with the repo · `quartz.config.default.yaml`
- [Content pipeline](https://github.com/chompy78/pact_players/tree/main/quartz/processors): parse-filter-emit · Staged processing of files into rendered outputs · `quartz/processors`
- [Plugin system](https://github.com/chompy78/pact_players/tree/main/quartz/plugins): extension core · Modular loaders, transformers, filters, emitters, and page types · `quartz/plugins`
- [Loaders](https://github.com/chompy78/pact_players/tree/main/quartz/plugins/loader): plugin loading · Ingest content, config, git data, frames, and components · `quartz/plugins/loader`
- [Transformers](https://github.com/chompy78/pact_players/tree/main/quartz/plugins/transformers): plugin transforms · Rewrite and enrich page and file data · `quartz/plugins/transformers`
- [Filters](https://github.com/chompy78/pact_players/tree/main/quartz/plugins/filters): plugin gating · Control which files and pages are included · `quartz/plugins/filters`
- [Emitters](https://github.com/chompy78/pact_players/tree/main/quartz/plugins/emitters): asset output · Produce static pages and other build artifacts · `quartz/plugins/emitters`
- [Page types](https://github.com/chompy78/pact_players/tree/main/quartz/plugins/pageTypes): page dispatch · Match specialized layouts such as 404 and other page classes · `quartz/plugins/pageTypes`
- [UI components](https://github.com/chompy78/pact_players/tree/main/quartz/components): layout system · Shared page shells, chrome, and reusable rendering components · `quartz/components`
- [Client scripts](https://github.com/chompy78/pact_players/tree/main/quartz/components/scripts): browser behavior · SPA navigation, popovers, and search interactions · `quartz/components/scripts`
- [Styling](https://github.com/chompy78/pact_players/tree/main/quartz/styles): scss theme · Global styles, component styles, and syntax/theme variables · `quartz/styles`
- [Localization](https://github.com/chompy78/pact_players/tree/main/quartz/i18n): translations · Localized UI labels and feature text · `quartz/i18n`
- [Utilities](https://github.com/chompy78/pact_players/tree/main/quartz/util): shared helpers · Path, file, theme, logging, and rendering helpers used across the framework · `quartz/util`

### Build and deploy

Entry points, packaging, CI, and publishing

- [Build entrypoints](https://github.com/chompy78/pact_players/blob/main/quartz.ts): runtime entrypoints · Main bootstrap and build/worker entry files · `quartz.ts`
- [CLI tools](https://github.com/chompy78/pact_players/tree/main/quartz/cli): command surface · Build, create, sync, restore, plugin, TUI, and upgrade commands · `quartz/cli`
- [GitHub Actions](https://github.com/chompy78/pact_players/blob/main/.github/workflows): ci deployment · Preview, CI, Pages deployment, versioned deployment, and Docker publish workflows · `.github/workflows`
- [Docker image](https://github.com/chompy78/pact_players/tree/main/Dockerfile): container build · Container packaging for self-hosting or CI publishing · `Dockerfile`

## Connections

- Campaign notes → Content pipeline: source pages · Markdown content is parsed into the build pipeline
- Framework docs → Campaign notes: authoring guide · Documentation explains the content model and site features
- Site config → Build entrypoints: runtime settings · Configuration is loaded by the build/runtime bootstrap
- Default config → Site config: fallbacks · Default settings are overridden by repo config
- Build entrypoints → Content pipeline: drives build · Entry points orchestrate parse, filter, and emit stages
- Content pipeline → Plugin system: invokes plugins · Processing stages are extended by the plugin system
- Plugin system → Loaders: load stage · Plugins ingest external and repository data
- Plugin system → Transformers: transform stage · Plugins enrich or rewrite content models
- Plugin system → Filters: filter stage · Plugins decide inclusion and visibility
- Plugin system → Emitters: emit stage · Plugins produce final static assets
- Plugin system → Page types: page dispatch · Plugins select specialized page layouts
- Content pipeline → UI components: render pages · Processed page data is rendered through UI shells
- UI components → Client scripts: interactive chrome · Layouts include client-side navigation and previews
- UI components → Styling: visual theme · Component and global styles shape the generated site
- UI components → Localization: localized labels · UI text and feature labels are translated through locales
- UI components → Utilities: shared helpers · Rendering and layout code uses common utilities
- CLI tools → Build entrypoints: commands · CLI commands wrap build and site maintenance entrypoints
- GitHub Actions → Build entrypoints: ci build · GitHub Actions run the site build and deployment flow
- Docker image → Build entrypoints: container run · Container image packages the same build/runtime path
- Emitters → GitHub Actions: publish artifacts · Static output is handed to deployment workflows
