# mizcausevic-dev/boardroom-sparring-partner architecture

> Architecture diagram of the GitHub repository mizcausevic-dev/boardroom-sparring-partner, 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/boardroom-sparring-partner
- Repository: https://github.com/mizcausevic-dev/boardroom-sparring-partner

## Overview

#### Purpose and principal workflow

Boardroom Sparring Partner turns a bundled synthetic board-prep export into readiness metrics, evidence and downside findings, board-question and memo views, and rehearsal guidance. The primary workflow starts when a web visitor requests a page or JSON endpoint; a separate command-line user can analyze an input file and receive a summary or JSON report. The product is read-only: the sampled application uses in-memory sample data, not live board materials or persistent storage.

#### Components

##### Web application and views
- **Web visitor** — *External actor; repository path: null.* Initiates the main workflow by requesting a dashboard page or API endpoint.
- **Express HTTP application** — `src/app.ts`. Creates the Express app, registers HTML and JSON routes, calls view renderers or data-service functions, and starts a listener when run directly.
- **Board-prep views** — `src/services/render.ts`. Renders the overview and grouped question-lane, pushback, memo-posture, rehearsal, verification, and documentation screens; also serializes the sample payload for its route.
- **Board-prep data service** — `src/services/verticalBriefService.ts`. Builds the report from the sample set and exposes summary, per-view projections, risk findings, verification statements, and the combined payload.

##### Analysis and source data
- **Synthetic board-prep export** — `src/data/sampleVerticalBrief.ts`. Supplies the modeled themes and their questions, readiness, downside, evidence state, memo answers, next moves, tags, and related surfaces.
- **Board-prep analyzer** — `src/analyze.ts`. Evaluates each item against evidence, downside, confidence, and readiness rules, then calculates report-level metrics and findings.
- **Report formatters** — `src/format.ts`. Converts an analyzed report into human-readable summary text or JSON.
- **Domain contracts** — `src/types.ts`. Defines the item, export, finding, and report shapes used by the analysis and interfaces.

##### CLI and library interfaces
- **CLI user** — *External actor; repository path: null.* Starts the file-based workflow by invoking the published command with an export path and output format.
- **Command-line interface** — `src/cli.ts`. Reads and parses the selected JSON file, analyzes its items, and prints summary or JSON output.
- **Package library surface** — `src/index.ts`. Re-exports analysis, export construction, formatters, sample data, and public domain types for package consumers.

#### Relationships

- **Web visitor -> Express HTTP application**: requests a page or JSON endpoint; routes are registered in the app.
- **Express HTTP application -> Board-prep views**: calls render functions for HTML routes and sample serialization.
- **Express HTTP application -> Board-prep data service**: calls data functions for JSON routes.
- **Board-prep views -> Board-prep data service**: reads projections and verification content to construct page output.
- **Board-prep data service -> Synthetic board-prep export**: reads the bundled items to build projections and the payload.
- **Board-prep data service -> Board-prep analyzer**: analyzes the bundled items at module initialization to derive report metrics and findings.
- **Board-prep analyzer -> Domain contracts**: consumes and returns the defined item and report shapes.
- **CLI user -> Command-line interface**: invokes the command with an input file and requested format.
- **Command-line interface -> input JSON file**: reads and parses the selected file; the default path is a repository fixture.
- **Command-line interface -> Board-prep analyzer**: analyzes the parsed items.
- **Command-line interface -> Report formatters**: selects summary or JSON formatting and prints the result.
- **Report formatters -> Domain contracts**: consume the report shape when formatting output.
- **Package library surface -> Board-prep analyzer**: re-exports analysis and export construction.
- **Package library surface -> Report formatters**: re-exports the output formatters.
- **Package library surface -> Synthetic board-prep export**: re-exports the bundled sample data.

#### Coverage limits

The sampled sources establish the web and CLI flows and their in-memory data handling. The README documents static-site prerendering and additional routes, but the prerender script and deployment behavior were not sampled; no claim is made about their runtime wiring. No live-data ingestion, persistence, or external provider integration is evidenced.

Main entry points: [`src/cli.ts`](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/cli.ts) (Command-line interface), [`src/services/verticalBriefService.ts`](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/services/verticalBriefService.ts) (Board-prep data service), [`src/analyze.ts`](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/analyze.ts) (Board-prep analyzer), [`src/index.ts`](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/index.ts) (Package library surface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_express_app["Express application<br/>HTTP app"]
  node_board_prep_views["Board-prep views<br/>View renderer"]
  node_board_prep_service["Board-prep data service"]
end

subgraph group_analysis["Analysis and source data"]
  node_synthetic_export["Synthetic board-prep export<br/>Sample data"]
  node_analyzer["Board-prep analyzer<br/>[analyze.ts]"]
  node_formatters["Report formatters<br/>[format.ts]"]
  node_contracts["Domain contracts<br/>Types"]
end

subgraph group_interfaces["CLI and library interfaces"]
  node_cli["Command-line interface<br/>CLI"]
  node_input_json["Input JSON file<br/>Input file"]
  node_library_surface["Package library surface<br/>Library exports"]
end

node_web_visitor["Web visitor<br/>External actor"]
node_cli_user["CLI user<br/>External actor"]

node_web_visitor -->|"requests"| node_express_app
node_express_app -->|"calls"| node_board_prep_views
node_express_app -->|"calls"| node_board_prep_service
node_board_prep_views -->|"reads"| node_board_prep_service
node_board_prep_service -->|"reads"| node_synthetic_export
node_board_prep_service -->|"analyzes"| node_analyzer
node_analyzer -->|"uses"| node_contracts
node_cli_user -->|"invokes"| node_cli
node_cli -->|"reads"| node_input_json
node_cli -->|"analyzes"| node_analyzer
node_cli -->|"formats"| node_formatters
node_formatters -->|"uses"| node_contracts
node_library_surface -->|"re-exports"| node_analyzer
node_library_surface -->|"re-exports"| node_formatters
node_library_surface -->|"re-exports"| node_synthetic_export

click node_express_app "https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/app.ts"
click node_board_prep_views "https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/services/render.ts"
click node_board_prep_service "https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/services/verticalBriefService.ts"
click node_synthetic_export "https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/data/sampleVerticalBrief.ts"
click node_analyzer "https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/analyze.ts"
click node_formatters "https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/format.ts"
click node_contracts "https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/types.ts"
click node_cli "https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/cli.ts"
click node_library_surface "https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/index.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_express_app,node_board_prep_views,node_board_prep_service,node_cli_user toneBlue
class node_synthetic_export,node_analyzer,node_formatters,node_contracts toneAmber
class node_cli,node_input_json,node_library_surface toneMint
class node_web_visitor toneIndigo
```

## Components

### Web application

- [Express application](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/app.ts): HTTP app · `src/app.ts`
- [Board-prep views](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/services/render.ts): View renderer · `src/services/render.ts`
- [Board-prep data service](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/services/verticalBriefService.ts): Data service · `src/services/verticalBriefService.ts`

### Analysis and source data

- [Synthetic board-prep export](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/data/sampleVerticalBrief.ts): Sample data · `src/data/sampleVerticalBrief.ts`
- [Board-prep analyzer](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/analyze.ts): Analyzer · `src/analyze.ts`
- [Report formatters](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/format.ts): Formatters · `src/format.ts`
- [Domain contracts](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/types.ts): Types · `src/types.ts`

### CLI and library interfaces

- [Command-line interface](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/cli.ts): CLI · `src/cli.ts`
- **Input JSON file**: Input file · Selected export file; default is a repository fixture.
- [Package library surface](https://github.com/mizcausevic-dev/boardroom-sparring-partner/blob/main/src/index.ts): Library exports · `src/index.ts`

### Other components

- **Web visitor**: External actor
- **CLI user**: External actor

## Connections

- Web visitor → Express application: requests · Requests a page or JSON endpoint.
- Express application → Board-prep views: calls · Renders HTML routes and sample serialization.
- Express application → Board-prep data service: calls · Serves JSON routes.
- Board-prep views → Board-prep data service: reads · Uses projections and verification content.
- Board-prep data service → Synthetic board-prep export: reads · Uses bundled items to build projections and payload.
- Board-prep data service → Board-prep analyzer: analyzes · Derives report metrics and findings at module initialization.
- Board-prep analyzer → Domain contracts: uses · Consumes and returns item and report shapes.
- CLI user → Command-line interface: invokes · Provides an export path and output format.
- Command-line interface → Input JSON file: reads · Reads and parses the selected file.
- Command-line interface → Board-prep analyzer: analyzes · Analyzes the parsed items.
- Command-line interface → Report formatters: formats · Selects summary or JSON output.
- Report formatters → Domain contracts: uses · Consumes the report shape.
- Package library surface → Board-prep analyzer: re-exports · Exposes analysis and export construction.
- Package library surface → Report formatters: re-exports · Exposes output formatters.
- Package library surface → Synthetic board-prep export: re-exports · Exposes bundled sample data.
