# yashashwini-mv/creator-lab architecture

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

- Interactive diagram: https://gitdiagram.com/yashashwini-mv/creator-lab
- Repository: https://github.com/yashashwini-mv/creator-lab

## Overview

Creator Lab is a browser-based creator experimentation and growth prototype. A creator works with experiment and performance tools; the page stores state locally and computes learnings, proof, and reports. For wired AI features, the browser calls the same-origin server, which delegates to Gemini and validates task-specific JSON. If AI is unavailable, the page offers demo insights. The README documents report and collaboration-idea API endpoints, but says the page does not yet call them. The frontend is a single file; its internal capabilities are represented as separate nodes sharing that path. Unsampled frontend details are based on README documentation.

Main entry points: [`creator-lab.html`](https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html) (Creator Lab UI), [`server/index.js`](https://github.com/yashashwini-mv/creator-lab/blob/main/server/index.js) (HTTP API server), [`server/services/ai.js`](https://github.com/yashashwini-mv/creator-lab/blob/main/server/services/ai.js) (AI task service), [`server/env.js`](https://github.com/yashashwini-mv/creator-lab/blob/main/server/env.js) (Environment config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Creator workspace"]
  node_workspace["Creator Lab UI<br/>[creator-lab.html]"]
  node_experiments["Experiment tools<br/>[creator-lab.html]"]
  node_performance["Performance analysis<br/>[creator-lab.html]"]
  node_coach["Growth Coach<br/>[creator-lab.html]"]
  node_demo["Demo insights<br/>[creator-lab.html]"]
  node_state[("Browser state<br/>[creator-lab.html]")]
end

subgraph group_server["Server and AI"]
  node_server["HTTP API server<br/>[index.js]"]
  node_environment["Environment config<br/>[env.js]"]
  node_ai["AI task service<br/>[ai.js]"]
  node_validation["JSON validation<br/>[ai.js]"]
end

subgraph group_outcomes["Evidence and opportunities"]
  node_learning["Learnings and proof<br/>[creator-lab.html]"]
  node_reports["Reports<br/>[creator-lab.html]"]
  node_opportunities["Collaborations and brands<br/>[creator-lab.html]"]
end

node_creator(("Creator"))
node_gemini{{"Google Gemini"}}

node_creator -->|"uses"| node_workspace
node_workspace -->|"calls AI API"| node_server
node_server -->|"serves page"| node_workspace
node_workspace -->|"runs tests"| node_experiments
node_workspace -->|"requests analysis"| node_performance
node_workspace -->|"requests coaching"| node_coach
node_workspace -->|"persists state"| node_state
node_workspace -->|"offers fallback"| node_demo
node_server -->|"loads config"| node_environment
node_server -->|"calls task"| node_ai
node_ai -->|"generates content"| node_gemini
node_ai -->|"validates response"| node_validation
node_state -->|"computes learnings"| node_learning
node_state -->|"computes reports"| node_reports
node_workspace -->|"supports pitches"| node_opportunities
node_server -.->|"offers report endpoint"| node_reports
node_server -.->|"offers idea endpoint"| node_opportunities

click node_workspace "https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html"
click node_experiments "https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html"
click node_performance "https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html"
click node_coach "https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html"
click node_demo "https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html"
click node_state "https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html"
click node_server "https://github.com/yashashwini-mv/creator-lab/blob/main/server/index.js"
click node_environment "https://github.com/yashashwini-mv/creator-lab/blob/main/server/env.js"
click node_ai "https://github.com/yashashwini-mv/creator-lab/blob/main/server/services/ai.js"
click node_validation "https://github.com/yashashwini-mv/creator-lab/blob/main/server/services/ai.js"
click node_learning "https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html"
click node_reports "https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html"
click node_opportunities "https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html"

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_workspace,node_experiments,node_performance,node_coach,node_demo,node_state toneBlue
class node_server,node_environment,node_ai,node_validation toneAmber
class node_learning,node_reports,node_opportunities toneMint
class node_creator,node_gemini toneIndigo
```

## Components

### Creator workspace

- [Creator Lab UI](https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html): `creator-lab.html`
- [Experiment tools](https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html): `creator-lab.html`
- [Performance analysis](https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html): `creator-lab.html`
- [Growth Coach](https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html): `creator-lab.html`
- [Demo insights](https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html): `creator-lab.html`
- [Browser state](https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html): `creator-lab.html`

### Server and AI

- [HTTP API server](https://github.com/yashashwini-mv/creator-lab/blob/main/server/index.js): `server/index.js`
- [Environment config](https://github.com/yashashwini-mv/creator-lab/blob/main/server/env.js): `server/env.js`
- [AI task service](https://github.com/yashashwini-mv/creator-lab/blob/main/server/services/ai.js): `server/services/ai.js`
- [JSON validation](https://github.com/yashashwini-mv/creator-lab/blob/main/server/services/ai.js): `server/services/ai.js`

### Evidence and opportunities

- [Learnings and proof](https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html): `creator-lab.html`
- [Reports](https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html): `creator-lab.html`
- [Collaborations and brands](https://github.com/yashashwini-mv/creator-lab/blob/main/creator-lab.html): `creator-lab.html`

### Other components

- **Creator**
- **Google Gemini**

## Connections

- Creator → Creator Lab UI: uses (evidence: `README.md`)
- Creator Lab UI → HTTP API server: calls AI API (evidence: `README.md`)
- HTTP API server → Creator Lab UI: serves page (evidence: `server/index.js`)
- Creator Lab UI → Experiment tools: runs tests (evidence: `README.md`)
- Creator Lab UI → Performance analysis: requests analysis (evidence: `README.md`)
- Creator Lab UI → Growth Coach: requests coaching (evidence: `README.md`)
- Creator Lab UI → Browser state: persists state (evidence: `README.md`)
- Creator Lab UI → Demo insights: offers fallback (evidence: `README.md`)
- HTTP API server → Environment config: loads config (evidence: `server/index.js`)
- HTTP API server → AI task service: calls task (evidence: `server/index.js`)
- AI task service → Google Gemini: generates content (evidence: `README.md`)
- AI task service → JSON validation: validates response (evidence: `server/services/ai.js`)
- Browser state → Learnings and proof: computes learnings (evidence: `README.md`)
- Browser state → Reports: computes reports (evidence: `README.md`)
- Creator Lab UI → Collaborations and brands: supports pitches (evidence: `README.md`)
- HTTP API server → Reports: offers report endpoint (evidence: `README.md`)
- HTTP API server → Collaborations and brands: offers idea endpoint (evidence: `README.md`)
