# kelvin1586/portfolioforge- architecture

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

- Interactive diagram: https://gitdiagram.com/kelvin1586/portfolioforge-
- Repository: https://github.com/kelvin1586/portfolioforge-

## Overview

PortfolioForge is a client-side portfolio builder: users edit portfolio content and presentation, see a live preview, and export a static site or JSON. The app also saves locally, supports import and snapshot history, and gates premium capabilities through license verification. The graph preserves the documented template, theme, SEO, and premium-feature branches; unsampled implementation details are represented only where the README or source index supports them.

Main entry points: [`src/App.tsx`](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/App.tsx) (App shell), [`src/components/Editors.tsx`](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/components/Editors.tsx) (Content editors), [`src/components/Modals.tsx`](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/components/Modals.tsx) (Upgrade and activation), [`src/lib/export.ts`](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/export.ts) (HTML renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_builder["Builder experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_editors["Content editors<br/>[Editors.tsx]"]
  node_ui["Shared UI<br/>[ui.tsx]"]
  node_preview["Live preview<br/>[Preview.tsx]"]
end

subgraph group_portfolio["Portfolio output"]
  node_types["Portfolio model<br/>[types.ts]"]
  node_sample["Portfolio factory<br/>[sample.ts]"]
  node_renderer["HTML renderer<br/>[export.ts]"]
  node_html["Static HTML site"]
  node_json["JSON portfolio file"]
end

subgraph group_persistence["Local portfolio data"]
  node_localdata[("Local save and load<br/>[storage.ts]")]
  node_history[("Snapshot history<br/>[storage.ts]")]
end

subgraph group_premium["Premium access"]
  node_entitlements["Feature entitlements<br/>[entitlements.ts]"]
  node_premium["Premium state<br/>[premium.ts]"]
  node_license["License verifier<br/>[license.ts]"]
  node_modal["Upgrade and activation<br/>[Modals.tsx]"]
  node_config["Checkout config<br/>[config.ts]"]
end

node_user(("Portfolio author"))
node_checkout["Hosted checkout"]
node_license_api["Lemon Squeezy API"]

node_user -->|"edits portfolio"| node_app
node_app -->|"renders editors"| node_editors
node_editors -->|"uses controls"| node_ui
node_app -->|"renders preview"| node_preview
node_preview -->|"renders HTML"| node_renderer
node_app -->|"creates starter"| node_sample
node_editors -->|"creates item IDs"| node_sample
node_app -->|"exports portfolio"| node_renderer
node_app -->|"saves and loads"| node_localdata
node_app -->|"downloads JSON"| node_json
node_app -->|"downloads HTML"| node_html
node_renderer -->|"generates document"| node_html
node_app -->|"manages snapshots"| node_history
node_app -->|"checks access"| node_entitlements
node_editors -->|"checks feature access"| node_entitlements
node_app -->|"revalidates license"| node_premium
node_app -->|"shows upgrade dialog"| node_modal
node_modal -->|"validates key"| node_license
node_premium -->|"uses license data"| node_license
node_license -->|"validates key"| node_license_api
node_modal -->|"reads checkout details"| node_config
node_config -->|"provides purchase link"| node_checkout

click node_app "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/App.tsx"
click node_editors "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/components/Editors.tsx"
click node_ui "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/components/ui.tsx"
click node_preview "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/components/Preview.tsx"
click node_types "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/types.ts"
click node_sample "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/sample.ts"
click node_renderer "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/export.ts"
click node_localdata "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/storage.ts"
click node_history "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/storage.ts"
click node_entitlements "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/entitlements.ts"
click node_premium "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/premium.ts"
click node_license "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/license.ts"
click node_modal "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/components/Modals.tsx"
click node_config "https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/config.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_app,node_editors,node_ui,node_preview toneBlue
class node_types,node_sample,node_renderer,node_html,node_json toneAmber
class node_localdata,node_history,node_license_api toneMint
class node_entitlements,node_premium,node_license,node_modal,node_config toneRose
class node_user,node_checkout toneIndigo
```

## Components

### Builder experience

- [App shell](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/App.tsx): `src/App.tsx`
- [Content editors](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/components/Editors.tsx): `src/components/Editors.tsx`
- [Shared UI](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/components/ui.tsx): `src/components/ui.tsx`
- [Live preview](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/components/Preview.tsx): `src/components/Preview.tsx`

### Portfolio output

- [Portfolio model](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/types.ts): `src/types.ts`
- [Portfolio factory](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/sample.ts): `src/lib/sample.ts`
- [HTML renderer](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/export.ts): `src/lib/export.ts`
- **Static HTML site**
- **JSON portfolio file**

### Local portfolio data

- [Local save and load](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/storage.ts): `src/lib/storage.ts`
- [Snapshot history](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/storage.ts): `src/lib/storage.ts`

### Premium access

- [Feature entitlements](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/entitlements.ts): `src/lib/entitlements.ts`
- [Premium state](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/premium.ts): `src/lib/premium.ts`
- [License verifier](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/lib/license.ts): `src/lib/license.ts`
- [Upgrade and activation](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/components/Modals.tsx): `src/components/Modals.tsx`
- [Checkout config](https://github.com/kelvin1586/portfolioforge-/blob/portfolioforge-app/src/config.ts): `src/config.ts`

### Other components

- **Portfolio author**
- **Hosted checkout**
- **Lemon Squeezy API**

## Connections

- Portfolio author → App shell: edits portfolio (evidence: `README.md`)
- App shell → Content editors: renders editors (evidence: `src/App.tsx`)
- Content editors → Shared UI: uses controls (evidence: `src/components/Editors.tsx`)
- App shell → Live preview: renders preview (evidence: `src/App.tsx`)
- Live preview → HTML renderer: renders HTML (evidence: `src/components/Preview.tsx`)
- App shell → Portfolio factory: creates starter (evidence: `src/App.tsx`)
- Content editors → Portfolio factory: creates item IDs (evidence: `src/components/Editors.tsx`)
- App shell → HTML renderer: exports portfolio (evidence: `src/App.tsx`)
- App shell → Local save and load: saves and loads (evidence: `src/App.tsx`)
- App shell → JSON portfolio file: downloads JSON (evidence: `src/App.tsx`)
- App shell → Static HTML site: downloads HTML (evidence: `src/App.tsx`)
- HTML renderer → Static HTML site: generates document (evidence: `README.md`)
- App shell → Snapshot history: manages snapshots (evidence: `src/App.tsx`)
- App shell → Feature entitlements: checks access (evidence: `src/App.tsx`)
- Content editors → Feature entitlements: checks feature access (evidence: `src/components/Editors.tsx`)
- App shell → Premium state: revalidates license (evidence: `src/App.tsx`)
- App shell → Upgrade and activation: shows upgrade dialog (evidence: `src/App.tsx`)
- Upgrade and activation → License verifier: validates key (evidence: `src/components/Modals.tsx`)
- Premium state → License verifier: uses license data (evidence: `src/lib/premium.ts`)
- License verifier → Lemon Squeezy API: validates key (evidence: `src/lib/license.ts`)
- Upgrade and activation → Checkout config: reads checkout details (evidence: `src/components/Modals.tsx`)
- Checkout config → Hosted checkout: provides purchase link (evidence: `src/config.ts`)
