# moldytaint/cinephage-docs architecture

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

- Interactive diagram: https://gitdiagram.com/moldytaint/cinephage-docs
- Repository: https://github.com/moldytaint/cinephage-docs

## Overview

1. **Repository role**
   - This repo is the documentation site for Cinephage, not the Cinephage application itself.
   - It is a Docusaurus 3 site written in TypeScript/React, built as a static documentation frontend and deployed to Cloudflare Workers.

2. **Primary content architecture**
   - The docs are organized with the Diataxis model: **Getting Started**, **Guides**, **Reference**, **Explanation**, plus **Support/FAQ**.
   - The `docs/` tree is the main knowledge base, with separate areas for installation/onboarding, operational how-tos, technical reference, and architecture/design writeups.

3. **Documentation as technical interface**
   - The `docs/reference/` section is the most “contract-like” part of the site: API endpoints, database schema, configuration variables, YAML definitions, and rate limiting.
   - This section acts as the boundary between the docs and the Cinephage product surface it describes.

4. **Custom site pages**
   - `src/pages/index.tsx` and `src/pages/deploy.tsx` define custom entry points outside the markdown docs.
   - The deploy page is a special interactive experience rather than a static article, and is backed by custom React components under `src/components/docker-configurator`.

5. **Interactive deployment/configuration subsystem**
   - `src/components/docker-configurator/` and `src/components/compose/` implement a client-side wizard that assembles Docker deployment artifacts.
   - The component set includes phase-based UI, time zone selection, network/VPN choices, and review/validation logic.
   - The compose utilities generate and validate outputs such as Docker Compose files, environment templates, proxy/Traefik configs, and WireGuard parsing.

6. **Shared utility layer**
   - `src/utils/` contains support code used by the interactive tooling, including time zone handling and secrets-related helpers.
   - These utilities feed the configurator rather than acting as a general application backend.

7. **Source synchronization boundary**
   - `repos/cinephage` and `repos/cinephage-dev` are git submodules tracking the upstream Cinephage codebases.
   - This repo uses them to keep documentation aligned with the current application source and development variant.
   - The `.github/workflows/update-submodules.yml` workflow automates this refresh on a schedule.

8. **Build and deployment flow**
   - The site is built with Node 20+ using the standard Docusaurus build pipeline into static assets.
   - `wrangler.jsonc` indicates the deployment target is Cloudflare Workers, so the output is packaged for edge hosting rather than a traditional server.

9. **CI/CD**
   - GitHub Actions provides two main automation paths:
     - `build.yml` validates the site on pushes and pull requests.
     - `update-submodules.yml` keeps the upstream Cinephage references current.
   - This means content changes and source-sync changes are both continuously checked before deployment.

10. **Architecture of the rendered site**
   - At runtime, the site is mostly static documentation served from Cloudflare, with a small amount of interactive client-side React for configuration/deployment tooling.
   - There is no evident backend application in this repo; all “logic” is either build-time documentation generation or browser-side configurator behavior.

11. **Practical diagram boundaries**
   - A useful architecture diagram would show:
     - **Authoring/content**: markdown docs, React pages, shared UI components
     - **Upstream source inputs**: git submodules to Cinephage repos
     - **Build system**: Docusaurus + Node + GitHub Actions
     - **Deployment target**: Cloudflare Workers via Wrangler
     - **Interactive tools**: deploy/configurator and compose generation on the client side

Main entry points: [`docs/index.md`](https://github.com/moldytaint/cinephage-docs/blob/main/docs/index.md) (Docs home), [`docs/reference/index.md`](https://github.com/moldytaint/cinephage-docs/blob/main/docs/reference/index.md) (Reference), [`repos/cinephage`](https://github.com/moldytaint/cinephage-docs/tree/main/repos/cinephage) (Cinephage), [`src/components/docker-configurator`](https://github.com/moldytaint/cinephage-docs/tree/main/src/components/docker-configurator) (Configurator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Authoring & docs"]
  node_docs_home["Docs home<br/>entry page<br/>[index.md]"]
  node_getting_started["Getting Started<br/>doc section<br/>[index.md]"]
  node_guides["Guides<br/>doc section<br/>[index.md]"]
  node_reference["Reference<br/>doc contract<br/>[index.md]"]
  node_explanation["Explanation<br/>design docs<br/>[index.md]"]
  node_support["Support<br/>help docs<br/>[index.md]"]
  node_docs_reference_api["API docs<br/>reference area"]
  node_docs_reference_config["Config docs<br/>reference area"]
  node_docs_reference_db["DB docs<br/>reference area<br/>[schema-overview.md]"]
  node_docs_reference_yaml["YAML docs<br/>reference area"]
end

subgraph group_interactive["Interactive tools"]
  node_deploy_page["Deploy page<br/>react page<br/>[deploy.tsx]"]
  node_home_page["Home page<br/>react page<br/>[index.tsx]"]
  node_configurator["Configurator<br/>wizard UI"]
  node_compose_tools["Compose tools<br/>generation utils"]
  node_timezone_utils["Utility layer<br/>support utils"]
end

subgraph group_build["Build & deploy"]
  node_build_pipeline["Docusaurus build<br/>static site build<br/>[package.json]"]
  node_ci_validate["Build CI<br/>github action<br/>[build.yml]"]
  node_ci_submodules["Submodule sync<br/>github action"]
  node_worker_deploy["Cloudflare Workers<br/>edge deploy target<br/>[wrangler.jsonc]"]
end

subgraph group_upstream["Upstream inputs"]
  node_cinephage_repo["Cinephage<br/>upstream submodule"]
  node_cinephage_dev["Cinephage dev<br/>upstream submodule"]
end

node_docs_home -->|"navigates to"| node_getting_started
node_docs_home -->|"navigates to"| node_guides
node_docs_home -->|"navigates to"| node_reference
node_docs_home -->|"navigates to"| node_explanation
node_docs_home -->|"navigates to"| node_support
node_reference -->|"includes"| node_docs_reference_api
node_reference -->|"includes"| node_docs_reference_config
node_reference -->|"includes"| node_docs_reference_db
node_reference -->|"includes"| node_docs_reference_yaml
node_deploy_page -->|"uses"| node_configurator
node_configurator -->|"generates"| node_compose_tools
node_configurator -->|"depends on"| node_timezone_utils
node_compose_tools -->|"uses"| node_timezone_utils
node_home_page -->|"links to"| node_docs_home
node_build_pipeline -->|"checked by"| node_ci_validate
node_build_pipeline -->|"packages for"| node_worker_deploy
node_ci_validate -->|"guards"| node_worker_deploy
node_ci_submodules -->|"syncs"| node_cinephage_repo
node_ci_submodules -->|"syncs"| node_cinephage_dev
node_cinephage_repo -.->|"informs"| node_docs_reference_api
node_cinephage_repo -.->|"informs"| node_docs_reference_config
node_cinephage_repo -.->|"informs"| node_docs_reference_db
node_cinephage_dev -.->|"informs"| node_docs_reference_yaml

click node_docs_home "https://github.com/moldytaint/cinephage-docs/blob/main/docs/index.md"
click node_getting_started "https://github.com/moldytaint/cinephage-docs/blob/main/docs/getting-started/index.md"
click node_guides "https://github.com/moldytaint/cinephage-docs/blob/main/docs/guides/index.md"
click node_reference "https://github.com/moldytaint/cinephage-docs/blob/main/docs/reference/index.md"
click node_explanation "https://github.com/moldytaint/cinephage-docs/blob/main/docs/explanation/index.md"
click node_support "https://github.com/moldytaint/cinephage-docs/blob/main/docs/support/faq/index.md"
click node_deploy_page "https://github.com/moldytaint/cinephage-docs/blob/main/src/pages/deploy.tsx"
click node_home_page "https://github.com/moldytaint/cinephage-docs/blob/main/src/pages/index.tsx"
click node_configurator "https://github.com/moldytaint/cinephage-docs/tree/main/src/components/docker-configurator"
click node_compose_tools "https://github.com/moldytaint/cinephage-docs/tree/main/src/components/compose"
click node_timezone_utils "https://github.com/moldytaint/cinephage-docs/tree/main/src/utils"
click node_build_pipeline "https://github.com/moldytaint/cinephage-docs/blob/main/package.json"
click node_ci_validate "https://github.com/moldytaint/cinephage-docs/blob/main/.github/workflows/build.yml"
click node_ci_submodules "https://github.com/moldytaint/cinephage-docs/blob/main/.github/workflows/update-submodules.yml"
click node_worker_deploy "https://github.com/moldytaint/cinephage-docs/blob/main/wrangler.jsonc"
click node_cinephage_repo "https://github.com/moldytaint/cinephage-docs/tree/main/repos/cinephage"
click node_cinephage_dev "https://github.com/moldytaint/cinephage-docs/tree/main/repos/cinephage-dev"
click node_docs_reference_api "https://github.com/moldytaint/cinephage-docs/blob/main/docs/reference/api/endpoints-overview.md"
click node_docs_reference_config "https://github.com/moldytaint/cinephage-docs/blob/main/docs/reference/configuration/settings-explained.md"
click node_docs_reference_db "https://github.com/moldytaint/cinephage-docs/blob/main/docs/reference/database/schema-overview.md"
click node_docs_reference_yaml "https://github.com/moldytaint/cinephage-docs/blob/main/docs/reference/yaml/indexer-definitions.md"

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_docs_home,node_getting_started,node_guides,node_reference,node_explanation,node_support,node_docs_reference_api,node_docs_reference_config,node_docs_reference_db,node_docs_reference_yaml toneBlue
class node_deploy_page,node_home_page,node_configurator,node_compose_tools,node_timezone_utils toneAmber
class node_build_pipeline,node_ci_validate,node_ci_submodules,node_worker_deploy toneMint
class node_cinephage_repo,node_cinephage_dev toneRose
```

## Components

### Authoring & docs

Markdown knowledge base and custom site pages

- [Docs home](https://github.com/moldytaint/cinephage-docs/blob/main/docs/index.md): entry page · Landing pages and doc navigation hub · `docs/index.md`
- [Getting Started](https://github.com/moldytaint/cinephage-docs/blob/main/docs/getting-started/index.md): doc section · Installation and onboarding path · `docs/getting-started/index.md`
- [Guides](https://github.com/moldytaint/cinephage-docs/blob/main/docs/guides/index.md): doc section · Operational how-tos for using and configuring Cinephage · `docs/guides/index.md`
- [Reference](https://github.com/moldytaint/cinephage-docs/blob/main/docs/reference/index.md): doc contract · API, configuration, database, and YAML reference material · `docs/reference/index.md`
- [Explanation](https://github.com/moldytaint/cinephage-docs/blob/main/docs/explanation/index.md): design docs · Architecture and design rationale · `docs/explanation/index.md`
- [Support](https://github.com/moldytaint/cinephage-docs/blob/main/docs/support/faq/index.md): help docs · FAQ, releases, and roadmap · `docs/support/faq/index.md`
- [API docs](https://github.com/moldytaint/cinephage-docs/blob/main/docs/reference/api/endpoints-overview.md): reference area · Authentication, endpoints, and rate limits · `docs/reference/api/endpoints-overview.md`
- [Config docs](https://github.com/moldytaint/cinephage-docs/blob/main/docs/reference/configuration/settings-explained.md): reference area · Environment variables and settings explanations · `docs/reference/configuration/settings-explained.md`
- [DB docs](https://github.com/moldytaint/cinephage-docs/blob/main/docs/reference/database/schema-overview.md): reference area · Database schema and table reference · `docs/reference/database/schema-overview.md`
- [YAML docs](https://github.com/moldytaint/cinephage-docs/blob/main/docs/reference/yaml/indexer-definitions.md): reference area · Indexer definitions and naming tokens · `docs/reference/yaml/indexer-definitions.md`

### Interactive tools

Client-side deployment and compose configurator

- [Deploy page](https://github.com/moldytaint/cinephage-docs/blob/main/src/pages/deploy.tsx): react page · Interactive deployment entry point · `src/pages/deploy.tsx`
- [Home page](https://github.com/moldytaint/cinephage-docs/blob/main/src/pages/index.tsx): react page · Custom landing page for the documentation site · `src/pages/index.tsx`
- [Configurator](https://github.com/moldytaint/cinephage-docs/tree/main/src/components/docker-configurator): wizard UI · Client-side deployment and configuration flow · `src/components/docker-configurator`
- [Compose tools](https://github.com/moldytaint/cinephage-docs/tree/main/src/components/compose): generation utils · Docker Compose, env, proxy, and validation helpers · `src/components/compose`
- [Utility layer](https://github.com/moldytaint/cinephage-docs/tree/main/src/utils): support utils · Shared helpers for timezone and secrets handling · `src/utils`

### Build & deploy

Site generation, validation, and Cloudflare delivery

- [Docusaurus build](https://github.com/moldytaint/cinephage-docs/blob/main/package.json): static site build · TypeScript/React documentation site generation · `package.json`
- [Build CI](https://github.com/moldytaint/cinephage-docs/blob/main/.github/workflows/build.yml): github action · Validates pushes and pull requests · `.github/workflows/build.yml`
- [Submodule sync](https://github.com/moldytaint/cinephage-docs/blob/main/.github/workflows/update-submodules.yml): github action · Refreshes upstream Cinephage references on a schedule · `.github/workflows/update-submodules.yml`
- [Cloudflare Workers](https://github.com/moldytaint/cinephage-docs/blob/main/wrangler.jsonc): edge deploy target · Static site deployment via Wrangler · `wrangler.jsonc`

### Upstream inputs

Synced Cinephage source repositories

- [Cinephage](https://github.com/moldytaint/cinephage-docs/tree/main/repos/cinephage): upstream submodule · Upstream application source tracked for documentation alignment · `repos/cinephage`
- [Cinephage dev](https://github.com/moldytaint/cinephage-docs/tree/main/repos/cinephage-dev): upstream submodule · Development variant tracked alongside the main source · `repos/cinephage-dev`

## Connections

- Docs home → Getting Started: navigates to · Primary docs entry routes into onboarding
- Docs home → Guides: navigates to · Primary docs entry routes into usage guides
- Docs home → Reference: navigates to · Primary docs entry routes into technical reference
- Docs home → Explanation: navigates to · Primary docs entry routes into architecture explanations
- Docs home → Support: navigates to · Primary docs entry routes into support content
- Reference → API docs: includes · API contracts and endpoint boundaries
- Reference → Config docs: includes · Configuration and environment reference
- Reference → DB docs: includes · Schema and table reference
- Reference → YAML docs: includes · YAML definitions and naming rules
- Deploy page → Configurator: uses · Deploy page hosts the interactive wizard
- Configurator → Compose tools: generates · Wizard assembles deployment artifacts through compose utilities
- Configurator → Utility layer: depends on · Wizard uses shared utility helpers
- Compose tools → Utility layer: uses · Compose helpers share support code
- Home page → Docs home: links to · Landing page routes into the documentation experience
- Docusaurus build → Build CI: checked by · CI validates the site build
- Docusaurus build → Cloudflare Workers: packages for · Static output is prepared for Cloudflare deployment
- Build CI → Cloudflare Workers: guards · Successful validation precedes deployment
- Submodule sync → Cinephage: syncs · Scheduled workflow refreshes upstream source reference
- Submodule sync → Cinephage dev: syncs · Scheduled workflow refreshes development source reference
- Cinephage → API docs: informs · Upstream product surface informs reference docs
- Cinephage → Config docs: informs · Upstream settings shape documentation
- Cinephage → DB docs: informs · Upstream data model shapes schema docs
- Cinephage dev → YAML docs: informs · Development variant informs configuration examples
