# chadkim0119/mapstone architecture

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

- Interactive diagram: https://gitdiagram.com/chadkim0119/mapstone
- Repository: https://github.com/chadkim0119/mapstone

## Overview

Mapstone is a browser-based schedule board: users create or import milestone schedules, edit and review them, then save locally or through the service and export or share results. The browser UI handles interaction and persistence-aware collaboration, while MapstoneCore defines schedule data behavior. Image/text analysis is delegated to a Supabase Edge Function and an AI provider; cloud reads and writes also pass through that function. README capability statements establish several product branches, but unsampled implementation details are not inferred.

Main entry points: [`mapstone-ui.js`](https://github.com/chadkim0119/mapstone/blob/main/mapstone-ui.js) (Board UI), [`supabase/functions/mapstone-api/index.ts`](https://github.com/chadkim0119/mapstone/blob/main/supabase/functions/mapstone-api/index.ts) (Edge API), [`index.html`](https://github.com/chadkim0119/mapstone/blob/main/index.html) (Mapstone app), [`mapstone-core.js`](https://github.com/chadkim0119/mapstone/blob/main/mapstone-core.js) (Schedule core)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Schedule workspace"]
  node_app["Mapstone app<br/>[index.html]"]
  node_ui["Board UI<br/>[mapstone-ui.js]"]
  node_core["Schedule core<br/>[mapstone-core.js]"]
  node_local[("Browser storage")]
end

subgraph group_import["Import and analysis"]
  node_ingest["Import inputs<br/>[mapstone-ui.js]"]
  node_analysis["Image/text analysis<br/>[index.ts]"]
end

subgraph group_cloud["Cloud services"]
  node_api["Edge API<br/>[index.ts]"]
  node_db[("Schedule database<br/>[schema.sql]")]
  node_gemini{{"Gemini"}}
  node_openai{{"OpenAI"}}
  node_versions["Cloud versions<br/>[mapstone-ui.js]"]
end

subgraph group_outputs["Sharing and outputs"]
  node_share["Shared schedules<br/>[mapstone-ui.js]"]
  node_exports["File exports<br/>[mapstone-ui.js]"]
  node_formats["PNG/PPTX/PDF/text"]
end

node_user(("Schedule editor"))

node_user -->|"opens"| node_app
node_app -->|"runs"| node_ui
node_ui -->|"uses"| node_core
node_ui -->|"autosaves"| node_local
node_user -->|"provides"| node_ingest
node_ingest -->|"submits for analysis"| node_analysis
node_analysis -->|"handled by"| node_api
node_api -->|"normalizes result"| node_core
node_api -->|"requests analysis"| node_gemini
node_api -->|"requests analysis"| node_openai
node_ui -->|"cloud reads/writes"| node_api
node_api -->|"reads/writes"| node_db
node_ui -->|"manages versions"| node_versions
node_ui -->|"creates share links"| node_share
node_user -->|"exports schedule"| node_exports
node_exports -->|"produces"| node_formats

click node_app "https://github.com/chadkim0119/mapstone/blob/main/index.html"
click node_ui "https://github.com/chadkim0119/mapstone/blob/main/mapstone-ui.js"
click node_core "https://github.com/chadkim0119/mapstone/blob/main/mapstone-core.js"
click node_ingest "https://github.com/chadkim0119/mapstone/blob/main/mapstone-ui.js"
click node_analysis "https://github.com/chadkim0119/mapstone/blob/main/supabase/functions/mapstone-api/index.ts"
click node_api "https://github.com/chadkim0119/mapstone/blob/main/supabase/functions/mapstone-api/index.ts"
click node_db "https://github.com/chadkim0119/mapstone/blob/main/supabase/schema.sql"
click node_versions "https://github.com/chadkim0119/mapstone/blob/main/mapstone-ui.js"
click node_share "https://github.com/chadkim0119/mapstone/blob/main/mapstone-ui.js"
click node_exports "https://github.com/chadkim0119/mapstone/blob/main/mapstone-ui.js"

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_ui,node_core,node_local toneBlue
class node_ingest,node_analysis toneAmber
class node_api,node_db,node_gemini,node_openai,node_versions toneMint
class node_share,node_exports,node_formats toneRose
class node_user toneIndigo
```

## Components

### Schedule workspace

- [Mapstone app](https://github.com/chadkim0119/mapstone/blob/main/index.html): `index.html`
- [Board UI](https://github.com/chadkim0119/mapstone/blob/main/mapstone-ui.js): `mapstone-ui.js`
- [Schedule core](https://github.com/chadkim0119/mapstone/blob/main/mapstone-core.js): `mapstone-core.js`
- **Browser storage**

### Import and analysis

- [Import inputs](https://github.com/chadkim0119/mapstone/blob/main/mapstone-ui.js): `mapstone-ui.js`
- [Image/text analysis](https://github.com/chadkim0119/mapstone/blob/main/supabase/functions/mapstone-api/index.ts): `supabase/functions/mapstone-api/index.ts`

### Cloud services

- [Edge API](https://github.com/chadkim0119/mapstone/blob/main/supabase/functions/mapstone-api/index.ts): `supabase/functions/mapstone-api/index.ts`
- [Schedule database](https://github.com/chadkim0119/mapstone/blob/main/supabase/schema.sql): `supabase/schema.sql`
- **Gemini**
- **OpenAI**
- [Cloud versions](https://github.com/chadkim0119/mapstone/blob/main/mapstone-ui.js): `mapstone-ui.js`

### Sharing and outputs

- [Shared schedules](https://github.com/chadkim0119/mapstone/blob/main/mapstone-ui.js): `mapstone-ui.js`
- [File exports](https://github.com/chadkim0119/mapstone/blob/main/mapstone-ui.js): `mapstone-ui.js`
- **PNG/PPTX/PDF/text**

### Other components

- **Schedule editor**

## Connections

- Schedule editor → Mapstone app: opens (evidence: `README.md`)
- Mapstone app → Board UI: runs (evidence: `README.md`)
- Board UI → Schedule core: uses (evidence: `mapstone-ui.js`)
- Board UI → Browser storage: autosaves (evidence: `README.md`)
- Schedule editor → Import inputs: provides (evidence: `README.md`)
- Import inputs → Image/text analysis: submits for analysis (evidence: `README.md`)
- Image/text analysis → Edge API: handled by (evidence: `README.md`)
- Edge API → Schedule core: normalizes result (evidence: `supabase/functions/mapstone-api/index.ts`)
- Edge API → Gemini: requests analysis (evidence: `supabase/functions/mapstone-api/index.ts`)
- Edge API → OpenAI: requests analysis (evidence: `supabase/functions/mapstone-api/index.ts`)
- Board UI → Edge API: cloud reads/writes (evidence: `README.md`)
- Edge API → Schedule database: reads/writes (evidence: `README.md`)
- Board UI → Cloud versions: manages versions (evidence: `README.md`)
- Board UI → Shared schedules: creates share links (evidence: `README.md`)
- Schedule editor → File exports: exports schedule (evidence: `README.md`)
- File exports → PNG/PPTX/PDF/text: produces (evidence: `README.md`)
