# rippy1911/anatome architecture

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

- Interactive diagram: https://gitdiagram.com/rippy1911/anatome
- Repository: https://github.com/rippy1911/anatome

## Overview

Anatome has two independent products: a public React site/playground and a Cloudflare Worker API. Users explore anatomy and exercises through the site or call the API directly; assistants can use its MCP interface. Signed-in users additionally authenticate and record personal activity, while share links expose dashboards. The graph preserves these distinct paths and the documented guides capability. Some route implementations were not sampled, so their internal relationships are omitted where the evidence does not establish them.

Main entry points: [`api/src/index.ts`](https://github.com/rippy1911/anatome/blob/main/api/src/index.ts) (HTTP API), [`api/src/routes/personal.ts`](https://github.com/rippy1911/anatome/blob/main/api/src/routes/personal.ts) (Personal logging), [`src/App.jsx`](https://github.com/rippy1911/anatome/blob/main/src/App.jsx) (Site routes), [`src/lib/guides.js`](https://github.com/rippy1911/anatome/blob/main/src/lib/guides.js) (Guide catalog client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Public site"]
  node_site_app["Site routes<br/>[App.jsx]"]
  node_playground["API playground<br/>[Playground.jsx]"]
  node_exercise_search_ui["Exercise search UI<br/>[ExerciseSearch.jsx]"]
  node_guide_pages["Guide pages<br/>[GuideTree.jsx]"]
  node_guide_client["Guide catalog client<br/>[guides.js]"]
  node_api_client["API URL client<br/>[apiBase.js]"]
end

subgraph group_catalog["Anatomy and catalog"]
  node_diagram_renderer["SVG renderer<br/>[muscleEngine.ts]"]
  node_body_paths["Body path data<br/>[bodyData.ts]"]
  node_muscle_catalog["Muscle catalog<br/>[muscleCatalog.ts]"]
  node_exercise_search["Exercise search logic<br/>[exercises.ts]"]
  node_guide_catalog["Guide catalog data<br/>[guideCatalog.ts]"]
end

subgraph group_api["Worker API"]
  node_api_entry["HTTP API<br/>[index.ts]"]
  node_mcp_handler["MCP tools<br/>[mcp.ts]"]
end

subgraph group_personal["Personal data"]
  node_oauth_routes["OAuth flows<br/>[oauth.ts]"]
  node_personal_routes["Personal logging<br/>[personal.ts]"]
  node_share_routes["Share dashboards<br/>[view.ts]"]
  node_auth["Identity and auth<br/>[auth.ts]"]
  node_database[("Account and activity store<br/>[db.ts]")]
end

node_visitor(("Visitor"))
node_assistant(("Assistant client"))

node_visitor -->|"opens"| node_site_app
node_site_app -->|"routes to"| node_playground
node_site_app -->|"routes to"| node_guide_pages
node_playground -->|"renders"| node_exercise_search_ui
node_exercise_search_ui -->|"uses API URL"| node_api_client
node_guide_pages -->|"loads guide data"| node_guide_client
node_guide_client -->|"requests catalog"| node_api_client
node_guide_client -.->|"falls back to snapshot"| node_guide_catalog
node_assistant -->|"calls MCP"| node_mcp_handler
node_api_entry -->|"renders diagrams"| node_diagram_renderer
node_api_entry -->|"loads paths"| node_body_paths
node_diagram_renderer -->|"uses paths"| node_body_paths
node_diagram_renderer -->|"normalizes muscles"| node_muscle_catalog
node_api_entry -->|"searches exercises"| node_exercise_search
node_api_entry -->|"dispatches MCP"| node_mcp_handler
node_oauth_routes -->|"uses identity"| node_auth
node_oauth_routes -->|"reads and writes"| node_database
node_personal_routes -->|"uses identity"| node_auth
node_personal_routes -->|"reads and writes"| node_database
node_personal_routes -->|"references share views"| node_share_routes

click node_site_app "https://github.com/rippy1911/anatome/blob/main/src/App.jsx"
click node_playground "https://github.com/rippy1911/anatome/blob/main/src/pages/Playground.jsx"
click node_exercise_search_ui "https://github.com/rippy1911/anatome/blob/main/src/components/playground/ExerciseSearch.jsx"
click node_guide_pages "https://github.com/rippy1911/anatome/blob/main/src/pages/GuideTree.jsx"
click node_guide_client "https://github.com/rippy1911/anatome/blob/main/src/lib/guides.js"
click node_api_client "https://github.com/rippy1911/anatome/blob/main/src/lib/apiBase.js"
click node_api_entry "https://github.com/rippy1911/anatome/blob/main/api/src/index.ts"
click node_diagram_renderer "https://github.com/rippy1911/anatome/blob/main/api/src/lib/muscleEngine.ts"
click node_body_paths "https://github.com/rippy1911/anatome/blob/main/api/src/lib/bodyData.ts"
click node_muscle_catalog "https://github.com/rippy1911/anatome/blob/main/api/src/data/muscleCatalog.ts"
click node_exercise_search "https://github.com/rippy1911/anatome/blob/main/api/src/lib/exercises.ts"
click node_guide_catalog "https://github.com/rippy1911/anatome/blob/main/api/src/data/guideCatalog.ts"
click node_mcp_handler "https://github.com/rippy1911/anatome/blob/main/api/src/routes/mcp.ts"
click node_oauth_routes "https://github.com/rippy1911/anatome/blob/main/api/src/routes/oauth.ts"
click node_personal_routes "https://github.com/rippy1911/anatome/blob/main/api/src/routes/personal.ts"
click node_share_routes "https://github.com/rippy1911/anatome/blob/main/api/src/routes/view.ts"
click node_auth "https://github.com/rippy1911/anatome/blob/main/api/src/lib/auth.ts"
click node_database "https://github.com/rippy1911/anatome/blob/main/api/src/lib/db.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_site_app,node_playground,node_exercise_search_ui,node_guide_pages,node_guide_client,node_api_client,node_assistant toneBlue
class node_diagram_renderer,node_body_paths,node_muscle_catalog,node_exercise_search,node_guide_catalog toneAmber
class node_api_entry,node_mcp_handler toneMint
class node_oauth_routes,node_personal_routes,node_share_routes,node_auth,node_database toneRose
class node_visitor toneIndigo
```

## Components

### Public site

- [Site routes](https://github.com/rippy1911/anatome/blob/main/src/App.jsx): `src/App.jsx`
- [API playground](https://github.com/rippy1911/anatome/blob/main/src/pages/Playground.jsx): `src/pages/Playground.jsx`
- [Exercise search UI](https://github.com/rippy1911/anatome/blob/main/src/components/playground/ExerciseSearch.jsx): `src/components/playground/ExerciseSearch.jsx`
- [Guide pages](https://github.com/rippy1911/anatome/blob/main/src/pages/GuideTree.jsx): `src/pages/GuideTree.jsx`
- [Guide catalog client](https://github.com/rippy1911/anatome/blob/main/src/lib/guides.js): `src/lib/guides.js`
- [API URL client](https://github.com/rippy1911/anatome/blob/main/src/lib/apiBase.js): `src/lib/apiBase.js`

### Anatomy and catalog

- [SVG renderer](https://github.com/rippy1911/anatome/blob/main/api/src/lib/muscleEngine.ts): `api/src/lib/muscleEngine.ts`
- [Body path data](https://github.com/rippy1911/anatome/blob/main/api/src/lib/bodyData.ts): `api/src/lib/bodyData.ts`
- [Muscle catalog](https://github.com/rippy1911/anatome/blob/main/api/src/data/muscleCatalog.ts): `api/src/data/muscleCatalog.ts`
- [Exercise search logic](https://github.com/rippy1911/anatome/blob/main/api/src/lib/exercises.ts): `api/src/lib/exercises.ts`
- [Guide catalog data](https://github.com/rippy1911/anatome/blob/main/api/src/data/guideCatalog.ts): `api/src/data/guideCatalog.ts`

### Worker API

- [HTTP API](https://github.com/rippy1911/anatome/blob/main/api/src/index.ts): `api/src/index.ts`
- [MCP tools](https://github.com/rippy1911/anatome/blob/main/api/src/routes/mcp.ts): `api/src/routes/mcp.ts`

### Personal data

- [OAuth flows](https://github.com/rippy1911/anatome/blob/main/api/src/routes/oauth.ts): `api/src/routes/oauth.ts`
- [Personal logging](https://github.com/rippy1911/anatome/blob/main/api/src/routes/personal.ts): `api/src/routes/personal.ts`
- [Share dashboards](https://github.com/rippy1911/anatome/blob/main/api/src/routes/view.ts): `api/src/routes/view.ts`
- [Identity and auth](https://github.com/rippy1911/anatome/blob/main/api/src/lib/auth.ts): `api/src/lib/auth.ts`
- [Account and activity store](https://github.com/rippy1911/anatome/blob/main/api/src/lib/db.ts): `api/src/lib/db.ts`

### Other components

- **Visitor**
- **Assistant client**

## Connections

- Visitor → Site routes: opens (evidence: `src/App.jsx`)
- Site routes → API playground: routes to (evidence: `src/App.jsx`)
- Site routes → Guide pages: routes to (evidence: `src/App.jsx`)
- API playground → Exercise search UI: renders (evidence: `src/pages/Playground.jsx`)
- Exercise search UI → API URL client: uses API URL (evidence: `src/components/playground/ExerciseSearch.jsx`)
- Guide pages → Guide catalog client: loads guide data (evidence: `src/pages/GuideTree.jsx`)
- Guide catalog client → API URL client: requests catalog (evidence: `src/lib/guides.js`)
- Guide catalog client → Guide catalog data: falls back to snapshot (evidence: `src/lib/guides.js`)
- Assistant client → MCP tools: calls MCP (evidence: `README.md`)
- HTTP API → SVG renderer: renders diagrams (evidence: `api/src/index.ts`)
- HTTP API → Body path data: loads paths (evidence: `api/src/index.ts`)
- SVG renderer → Body path data: uses paths (evidence: `api/src/lib/bodyData.ts`)
- SVG renderer → Muscle catalog: normalizes muscles (evidence: `api/src/lib/muscleEngine.ts`)
- HTTP API → Exercise search logic: searches exercises (evidence: `api/src/index.ts`)
- HTTP API → MCP tools: dispatches MCP (evidence: `api/src/index.ts`)
- OAuth flows → Identity and auth: uses identity (evidence: `api/src/routes/oauth.ts`)
- OAuth flows → Account and activity store: reads and writes (evidence: `api/src/routes/oauth.ts`)
- Personal logging → Identity and auth: uses identity (evidence: `api/src/routes/personal.ts`)
- Personal logging → Account and activity store: reads and writes (evidence: `api/src/routes/personal.ts`)
- Personal logging → Share dashboards: references share views (evidence: `api/src/routes/personal.ts`)
