# mizcausevic-dev/campaign-taxonomy-governor architecture

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

- Interactive diagram: https://gitdiagram.com/mizcausevic-dev/campaign-taxonomy-governor
- Repository: https://github.com/mizcausevic-dev/campaign-taxonomy-governor

## Overview

#### Purpose and principal workflow

Campaign Taxonomy Governor is a synthetic-data operator surface for reviewing campaign naming changes, audience and attribution blockers, and launch readiness. An external HTTP client—typically an operator’s browser—initiates the main workflow by requesting a page or API route; the Express application serves rendered HTML or JSON derived from the sample campaign data. The repository also has a separate prerender path that writes static pages and JSON for the documented GitHub Pages deployment.

#### Components

##### HTTP application
- **HTTP client** — **Path: null (external).** Requests the operator pages or JSON endpoints; the README documents both route sets.
- **Express route application** — `src/app.ts`. Defines the page and API routes, invokes render or data-service functions, and sends HTML or JSON responses.

##### Governance data and presentation
- **Campaign governance data** — `src/data/sampleCampaigns.ts`. Defines typed synthetic taxonomy changes, audience risks, and launch packets; these are the source records used by the service.
- **Governance views and payloads** — `src/services/campaignTaxonomyGovernorService.ts`. Computes summary counts and recommendations, exposes the three record collections and verification statements, and combines them into a sample payload.
- **Operator page rendering** — `src/services/render.ts`. Builds HTML for the overview and governance lanes using service results; the sampled excerpt shows page renderers calling the service functions directly.

##### Static publishing
- **Static site prerenderer** — `scripts/prerender.ts`. Calls the same service and rendering functions, writes page HTML and JSON files under `site`, and copies the `CNAME` for static hosting.

#### Relationships

- **HTTP client -> Express route application:** sends page or API requests; the route definitions establish the endpoints.
- **Express route application -> Operator page rendering:** calls the relevant renderer for HTML page requests.
- **Operator page rendering -> Governance views and payloads:** reads summary and governance records to populate rendered pages.
- **Express route application -> Governance views and payloads:** calls service functions for JSON API responses.
- **Governance views and payloads -> Campaign governance data:** imports and reads the synthetic collections to compute summaries and return records.
- **Static site prerenderer -> Governance views and payloads:** calls service functions to produce static JSON payloads.
- **Static site prerenderer -> Operator page rendering:** calls page renderers to produce static HTML.
- **Static site prerenderer -> Static output files:** writes rendered pages and JSON under `site` and copies the domain file; static output is the prerenderer’s filesystem result, not a repository component.

#### Coverage limits

Source excerpts do not include the full renderer, deployment workflow, or runtime hosting configuration. The README documents GitHub Pages deployment, but the sampled inputs do not establish the precise deployment steps or whether the Express server is used in production. No external campaign, CRM, ad-platform, or analytics integrations are evidenced; the service uses synthetic local data.

Main entry points: [`src/services/campaignTaxonomyGovernorService.ts`](https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/src/services/campaignTaxonomyGovernorService.ts) (Governance views and payloads), [`scripts/prerender.ts`](https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/scripts/prerender.ts) (Static site prerenderer), [`src/app.ts`](https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/src/app.ts) (Express route application), [`src/services/render.ts`](https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/src/services/render.ts) (Operator page rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP application"]
  node_http_client(("HTTP client<br/>External client"))
  node_express_app["Express route application<br/>HTTP application"]
end

subgraph group_governance["Governance data and presentation"]
  node_campaign_data["Campaign governance data<br/>Synthetic records"]
  node_governance_service["Governance views and payloads<br/>Data service"]
  node_operator_rendering["Operator page rendering<br/>HTML rendering"]
end

subgraph group_publishing["Static publishing"]
  node_prerenderer["Static site prerenderer<br/>Build script"]
  node_static_output["Static output files<br/>Generated files"]
end

node_http_client -->|"sends requests"| node_express_app
node_express_app -->|"calls renderers"| node_operator_rendering
node_operator_rendering -->|"reads views"| node_governance_service
node_express_app -->|"calls services"| node_governance_service
node_governance_service -->|"reads records"| node_campaign_data
node_prerenderer -->|"calls services"| node_governance_service
node_prerenderer -->|"calls renderers"| node_operator_rendering
node_prerenderer -->|"writes files"| node_static_output

click node_express_app "https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/src/app.ts"
click node_campaign_data "https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/src/data/sampleCampaigns.ts"
click node_governance_service "https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/src/services/campaignTaxonomyGovernorService.ts"
click node_operator_rendering "https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/src/services/render.ts"
click node_prerenderer "https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/scripts/prerender.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_http_client,node_express_app toneBlue
class node_campaign_data,node_governance_service,node_operator_rendering toneAmber
class node_prerenderer,node_static_output toneMint
```

## Components

### HTTP application

- **HTTP client**: External client
- [Express route application](https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/src/app.ts): HTTP application · `src/app.ts`

### Governance data and presentation

- [Campaign governance data](https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/src/data/sampleCampaigns.ts): Synthetic records · `src/data/sampleCampaigns.ts`
- [Governance views and payloads](https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/src/services/campaignTaxonomyGovernorService.ts): Data service · `src/services/campaignTaxonomyGovernorService.ts`
- [Operator page rendering](https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/src/services/render.ts): HTML rendering · `src/services/render.ts`

### Static publishing

- [Static site prerenderer](https://github.com/mizcausevic-dev/campaign-taxonomy-governor/blob/main/scripts/prerender.ts): Build script · `scripts/prerender.ts`
- **Static output files**: Generated files

## Connections

- HTTP client → Express route application: sends requests
- Express route application → Operator page rendering: calls renderers
- Operator page rendering → Governance views and payloads: reads views
- Express route application → Governance views and payloads: calls services
- Governance views and payloads → Campaign governance data: reads records
- Static site prerenderer → Governance views and payloads: calls services
- Static site prerenderer → Operator page rendering: calls renderers
- Static site prerenderer → Static output files: writes files
