# lebauzagit/react-email-starter architecture

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

- Interactive diagram: https://gitdiagram.com/lebauzagit/react-email-starter
- Repository: https://github.com/lebauzagit/react-email-starter

## Overview

This is a React Email starter centered on a weekly KPI report. A developer opens the live preview, which renders the report using supplied or default KPI data; the report composes a layout, KPI grid, and dashboard link. The grid renders individual KPI cards. The graph preserves the core data and type modules. Preview behavior is documented in the README; source excerpts show the report composition and component calls, but not the preview server’s internal rendering path.

Main entry points: [`emails/KpiReport.tsx`](https://github.com/lebauzagit/react-email-starter/blob/main/emails/KpiReport.tsx) (KPI Report), [`components/KpiGrid.tsx`](https://github.com/lebauzagit/react-email-starter/blob/main/components/KpiGrid.tsx) (KPI Grid), [`types/kpi.types.ts`](https://github.com/lebauzagit/react-email-starter/blob/main/types/kpi.types.ts) (KPI Contract), [`package.json`](https://github.com/lebauzagit/react-email-starter/blob/main/package.json) (Email Preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_preview["Live Preview"]
  node_preview_server["Email Preview<br/>[package.json]"]
end

subgraph group_report["Report Composition"]
  node_report_email["KPI Report<br/>[KpiReport.tsx]"]
  node_email_layout["Email Layout<br/>[EmailLayout.tsx]"]
  node_primary_button["Dashboard Button<br/>[PrimaryButton.tsx]"]
end

subgraph group_kpi["KPI Data and Display"]
  node_kpi_grid["KPI Grid<br/>[KpiGrid.tsx]"]
  node_kpi_card["KPI Card<br/>[KpiCard.tsx]"]
  node_mock_kpis["Sample KPIs<br/>[mock-kpis.ts]"]
  node_kpi_type["KPI Contract<br/>[kpi.types.ts]"]
end

node_developer(("Developer"))

node_developer -->|"opens preview"| node_preview_server
node_preview_server -.->|"previews"| node_report_email
node_report_email -->|"renders within"| node_email_layout
node_report_email -->|"renders"| node_primary_button
node_report_email -->|"renders"| node_kpi_grid
node_report_email -->|"defaults to"| node_mock_kpis
node_kpi_grid -->|"renders"| node_kpi_card
node_mock_kpis -->|"uses type"| node_kpi_type
node_report_email -->|"accepts type"| node_kpi_type
node_kpi_grid -->|"accepts type"| node_kpi_type

click node_preview_server "https://github.com/lebauzagit/react-email-starter/blob/main/package.json"
click node_report_email "https://github.com/lebauzagit/react-email-starter/blob/main/emails/KpiReport.tsx"
click node_email_layout "https://github.com/lebauzagit/react-email-starter/blob/main/components/EmailLayout.tsx"
click node_primary_button "https://github.com/lebauzagit/react-email-starter/blob/main/components/PrimaryButton.tsx"
click node_kpi_grid "https://github.com/lebauzagit/react-email-starter/blob/main/components/KpiGrid.tsx"
click node_kpi_card "https://github.com/lebauzagit/react-email-starter/blob/main/components/KpiCard.tsx"
click node_mock_kpis "https://github.com/lebauzagit/react-email-starter/blob/main/data/mock-kpis.ts"
click node_kpi_type "https://github.com/lebauzagit/react-email-starter/blob/main/types/kpi.types.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_preview_server toneBlue
class node_report_email,node_email_layout,node_primary_button toneAmber
class node_kpi_grid,node_kpi_card,node_mock_kpis,node_kpi_type toneMint
class node_developer toneIndigo
```

## Components

### Live Preview

- [Email Preview](https://github.com/lebauzagit/react-email-starter/blob/main/package.json): `package.json`

### Report Composition

- [KPI Report](https://github.com/lebauzagit/react-email-starter/blob/main/emails/KpiReport.tsx): `emails/KpiReport.tsx`
- [Email Layout](https://github.com/lebauzagit/react-email-starter/blob/main/components/EmailLayout.tsx): `components/EmailLayout.tsx`
- [Dashboard Button](https://github.com/lebauzagit/react-email-starter/blob/main/components/PrimaryButton.tsx): `components/PrimaryButton.tsx`

### KPI Data and Display

- [KPI Grid](https://github.com/lebauzagit/react-email-starter/blob/main/components/KpiGrid.tsx): `components/KpiGrid.tsx`
- [KPI Card](https://github.com/lebauzagit/react-email-starter/blob/main/components/KpiCard.tsx): `components/KpiCard.tsx`
- [Sample KPIs](https://github.com/lebauzagit/react-email-starter/blob/main/data/mock-kpis.ts): `data/mock-kpis.ts`
- [KPI Contract](https://github.com/lebauzagit/react-email-starter/blob/main/types/kpi.types.ts): `types/kpi.types.ts`

### Other components

- **Developer**

## Connections

- Developer → Email Preview: opens preview (evidence: `readme.md`)
- Email Preview → KPI Report: previews
- KPI Report → Email Layout: renders within (evidence: `emails/KpiReport.tsx`)
- KPI Report → Dashboard Button: renders (evidence: `emails/KpiReport.tsx`)
- KPI Report → KPI Grid: renders (evidence: `emails/KpiReport.tsx`)
- KPI Report → Sample KPIs: defaults to (evidence: `emails/KpiReport.tsx`)
- KPI Grid → KPI Card: renders (evidence: `components/KpiGrid.tsx`)
- Sample KPIs → KPI Contract: uses type (evidence: `data/mock-kpis.ts`)
- KPI Report → KPI Contract: accepts type (evidence: `emails/KpiReport.tsx`)
- KPI Grid → KPI Contract: accepts type (evidence: `components/KpiGrid.tsx`)
