# sahol3/xotstudio architecture

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

- Interactive diagram: https://gitdiagram.com/sahol3/xotstudio
- Repository: https://github.com/sahol3/xotstudio

## Overview

XOT Studio is a self-hosted website with a visual content editor and contact inbox. Visitors request prerendered pages, which are rendered from mirrored templates with stored overrides; editors sign in, modify content, and manage submissions through admin APIs. The README also documents self-hosted Framer assets and responsive image delivery. The source index supports the main rendering, storage, auth, and editor links; some browser-to-API interactions are documented rather than shown in excerpts.

Main entry points: [`lib/store.ts`](https://github.com/sahol3/xotstudio/blob/main/lib/store.ts) (Content storage), [`lib/render.ts`](https://github.com/sahol3/xotstudio/blob/main/lib/render.ts) (Template renderer), [`app/preview/[[...path]]/route.ts`](https://github.com/sahol3/xotstudio/blob/main/app/preview/%5B%5B...path%5D%5D/route.ts) (Editor preview), [`public/fx/s/framer.D5DlDBlP.mjs`](https://github.com/sahol3/xotstudio/blob/main/public/fx/s/framer.D5DlDBlP.mjs) (Framer runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public website"]
  node_public_routes["Page routes<br/>[route.ts]"]
  node_other_routes["Other page routes<br/>[route.ts]"]
end

subgraph group_editing["Content editing"]
  node_admin_ui["Visual editor<br/>[admin-app.tsx]"]
  node_preview["Editor preview<br/>[route.ts]"]
  node_editor_script["Editor browser script<br/>[editor.js]"]
  node_patch_script["Content patcher<br/>[patch.js]"]
end

subgraph group_admin["Admin and contact"]
  node_content_api["Content API<br/>[route.ts]"]
  node_login_api["Login API<br/>[route.ts]"]
  node_auth["Session auth<br/>[auth.ts]"]
  node_middleware["Access middleware<br/>[middleware.ts]"]
  node_submissions_api["Submissions API<br/>[route.ts]"]
  node_contact_api["Contact endpoint<br/>[route.ts]"]
  node_upload_api["Upload endpoint<br/>[route.ts]"]
end

subgraph group_runtime["Rendering and storage"]
  node_page_server["Page serving<br/>[serve.ts]"]
  node_renderer["Template renderer<br/>[render.ts]"]
  node_content_model["Editable content model<br/>[content.ts]"]
  node_content_data["CMS data<br/>[cms-data.ts]"]
  node_storage[("Content storage<br/>[store.ts]")]
end

subgraph group_assets["Site assets"]
  node_fx_route["Asset route<br/>[route.ts]"]
  node_framer["Framer runtime"]
  node_motion["Motion runtime"]
  node_react["React runtime<br/>[react.Bg2SsqF2.mjs]"]
  node_runtime_core["Rolldown runtime"]
end

node_visitor(("Visitor"))
node_blob[("Vercel Blob")]
node_admin_user(("Editor"))

node_visitor -->|"requests home"| node_public_routes
node_visitor -.->|"requests pages"| node_other_routes
node_public_routes -->|"serves home"| node_page_server
node_other_routes -->|"serves page"| node_page_server
node_page_server -->|"renders page"| node_renderer
node_renderer -->|"uses fields"| node_content_model
node_renderer -->|"reads overrides"| node_storage
node_storage -->|"reads and writes"| node_blob
node_admin_user -.->|"signs in"| node_login_api
node_login_api -->|"checks credentials"| node_auth
node_admin_user -->|"edits content"| node_admin_ui
node_admin_ui -.->|"saves edits"| node_content_api
node_content_api -->|"uses content model"| node_content_model
node_content_api -->|"stores edits"| node_storage
node_admin_ui -->|"loads preview"| node_preview
node_preview -->|"verifies session"| node_auth
node_preview -->|"renders preview"| node_renderer
node_middleware -->|"checks session"| node_auth
node_admin_user -.->|"manages messages"| node_submissions_api
node_submissions_api -->|"reads and deletes"| node_storage
node_visitor -.->|"sends message"| node_contact_api
node_contact_api -->|"stores submission"| node_storage
node_admin_user -.->|"uploads assets"| node_upload_api
node_upload_api -->|"stores upload"| node_storage
node_fx_route -->|"uses CMS data"| node_content_data
node_framer -->|"imports runtime"| node_motion
node_framer -->|"imports runtime"| node_react
node_framer -->|"imports runtime"| node_runtime_core
node_motion -->|"imports runtime"| node_react
node_motion -->|"imports runtime"| node_runtime_core
node_react -->|"imports runtime"| node_runtime_core
node_preview -->|"loads editor"| node_editor_script
node_renderer -->|"injects patcher"| node_patch_script

click node_public_routes "https://github.com/sahol3/xotstudio/blob/main/app/route.ts"
click node_other_routes "https://github.com/sahol3/xotstudio/blob/main/app/contact/route.ts"
click node_page_server "https://github.com/sahol3/xotstudio/blob/main/lib/serve.ts"
click node_renderer "https://github.com/sahol3/xotstudio/blob/main/lib/render.ts"
click node_content_model "https://github.com/sahol3/xotstudio/blob/main/lib/content.ts"
click node_content_data "https://github.com/sahol3/xotstudio/blob/main/content/cms-data.ts"
click node_storage "https://github.com/sahol3/xotstudio/blob/main/lib/store.ts"
click node_admin_ui "https://github.com/sahol3/xotstudio/blob/main/app/admin/ui/admin-app.tsx"
click node_preview "https://github.com/sahol3/xotstudio/blob/main/app/preview/%5B%5B...path%5D%5D/route.ts"
click node_content_api "https://github.com/sahol3/xotstudio/blob/main/app/api/admin/content/route.ts"
click node_login_api "https://github.com/sahol3/xotstudio/blob/main/app/api/admin/login/route.ts"
click node_auth "https://github.com/sahol3/xotstudio/blob/main/lib/auth.ts"
click node_middleware "https://github.com/sahol3/xotstudio/blob/main/middleware.ts"
click node_submissions_api "https://github.com/sahol3/xotstudio/blob/main/app/api/admin/submissions/route.ts"
click node_contact_api "https://github.com/sahol3/xotstudio/blob/main/app/api/contact/route.ts"
click node_upload_api "https://github.com/sahol3/xotstudio/blob/main/app/api/admin/upload/route.ts"
click node_fx_route "https://github.com/sahol3/xotstudio/blob/main/app/fx/m/%5B...file%5D/route.ts"
click node_framer "https://github.com/sahol3/xotstudio/blob/main/public/fx/s/framer.D5DlDBlP.mjs"
click node_motion "https://github.com/sahol3/xotstudio/blob/main/public/fx/s/motion.BiGGL1B_.mjs"
click node_react "https://github.com/sahol3/xotstudio/blob/main/public/fx/s/react.Bg2SsqF2.mjs"
click node_runtime_core "https://github.com/sahol3/xotstudio/blob/main/public/fx/s/rolldown-runtime.Dlrze_Ig.mjs"
click node_editor_script "https://github.com/sahol3/xotstudio/blob/main/public/xot/editor.js"
click node_patch_script "https://github.com/sahol3/xotstudio/blob/main/public/xot/patch.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_public_routes,node_other_routes toneBlue
class node_admin_ui,node_preview,node_editor_script,node_patch_script,node_blob toneAmber
class node_content_api,node_login_api,node_auth,node_middleware,node_submissions_api,node_contact_api,node_upload_api toneMint
class node_page_server,node_renderer,node_content_model,node_content_data,node_storage toneRose
class node_fx_route,node_framer,node_motion,node_react,node_runtime_core,node_visitor,node_admin_user toneIndigo
```

## Components

### Public website

- [Page routes](https://github.com/sahol3/xotstudio/blob/main/app/route.ts): `app/route.ts`
- [Other page routes](https://github.com/sahol3/xotstudio/blob/main/app/contact/route.ts): `app/contact/route.ts`

### Content editing

- [Visual editor](https://github.com/sahol3/xotstudio/blob/main/app/admin/ui/admin-app.tsx): `app/admin/ui/admin-app.tsx`
- [Editor preview](https://github.com/sahol3/xotstudio/blob/main/app/preview/%5B%5B...path%5D%5D/route.ts): `app/preview/[[...path]]/route.ts`
- [Editor browser script](https://github.com/sahol3/xotstudio/blob/main/public/xot/editor.js): `public/xot/editor.js`
- [Content patcher](https://github.com/sahol3/xotstudio/blob/main/public/xot/patch.js): `public/xot/patch.js`

### Admin and contact

- [Content API](https://github.com/sahol3/xotstudio/blob/main/app/api/admin/content/route.ts): `app/api/admin/content/route.ts`
- [Login API](https://github.com/sahol3/xotstudio/blob/main/app/api/admin/login/route.ts): `app/api/admin/login/route.ts`
- [Session auth](https://github.com/sahol3/xotstudio/blob/main/lib/auth.ts): `lib/auth.ts`
- [Access middleware](https://github.com/sahol3/xotstudio/blob/main/middleware.ts): `middleware.ts`
- [Submissions API](https://github.com/sahol3/xotstudio/blob/main/app/api/admin/submissions/route.ts): `app/api/admin/submissions/route.ts`
- [Contact endpoint](https://github.com/sahol3/xotstudio/blob/main/app/api/contact/route.ts): `app/api/contact/route.ts`
- [Upload endpoint](https://github.com/sahol3/xotstudio/blob/main/app/api/admin/upload/route.ts): `app/api/admin/upload/route.ts`

### Rendering and storage

- [Page serving](https://github.com/sahol3/xotstudio/blob/main/lib/serve.ts): `lib/serve.ts`
- [Template renderer](https://github.com/sahol3/xotstudio/blob/main/lib/render.ts): `lib/render.ts`
- [Editable content model](https://github.com/sahol3/xotstudio/blob/main/lib/content.ts): `lib/content.ts`
- [CMS data](https://github.com/sahol3/xotstudio/blob/main/content/cms-data.ts): `content/cms-data.ts`
- [Content storage](https://github.com/sahol3/xotstudio/blob/main/lib/store.ts): `lib/store.ts`

### Site assets

- [Asset route](https://github.com/sahol3/xotstudio/blob/main/app/fx/m/%5B...file%5D/route.ts): `app/fx/m/[...file]/route.ts`
- [Framer runtime](https://github.com/sahol3/xotstudio/blob/main/public/fx/s/framer.D5DlDBlP.mjs): `public/fx/s/framer.D5DlDBlP.mjs`
- [Motion runtime](https://github.com/sahol3/xotstudio/blob/main/public/fx/s/motion.BiGGL1B_.mjs): `public/fx/s/motion.BiGGL1B_.mjs`
- [React runtime](https://github.com/sahol3/xotstudio/blob/main/public/fx/s/react.Bg2SsqF2.mjs): `public/fx/s/react.Bg2SsqF2.mjs`
- [Rolldown runtime](https://github.com/sahol3/xotstudio/blob/main/public/fx/s/rolldown-runtime.Dlrze_Ig.mjs): `public/fx/s/rolldown-runtime.Dlrze_Ig.mjs`

### Other components

- **Visitor**
- **Vercel Blob**
- **Editor**

## Connections

- Visitor → Page routes: requests home (evidence: `app/route.ts`)
- Visitor → Other page routes: requests pages (evidence: `app/contact/route.ts`)
- Page routes → Page serving: serves home (evidence: `app/route.ts`)
- Other page routes → Page serving: serves page (evidence: `app/contact/route.ts`)
- Page serving → Template renderer: renders page (evidence: `lib/serve.ts`)
- Template renderer → Editable content model: uses fields (evidence: `lib/render.ts`)
- Template renderer → Content storage: reads overrides (evidence: `lib/render.ts`)
- Content storage → Vercel Blob: reads and writes (evidence: `lib/store.ts`)
- Editor → Login API: signs in (evidence: `README.md`)
- Login API → Session auth: checks credentials (evidence: `app/api/admin/login/route.ts`)
- Editor → Visual editor: edits content (evidence: `README.md`)
- Visual editor → Content API: saves edits (evidence: `README.md`)
- Content API → Editable content model: uses content model (evidence: `app/api/admin/content/route.ts`)
- Content API → Content storage: stores edits (evidence: `app/api/admin/content/route.ts`)
- Visual editor → Editor preview: loads preview (evidence: `app/preview/[[...path]]/route.ts`)
- Editor preview → Session auth: verifies session (evidence: `app/preview/[[...path]]/route.ts`)
- Editor preview → Template renderer: renders preview (evidence: `app/preview/[[...path]]/route.ts`)
- Access middleware → Session auth: checks session (evidence: `middleware.ts`)
- Editor → Submissions API: manages messages (evidence: `README.md`)
- Submissions API → Content storage: reads and deletes (evidence: `app/api/admin/submissions/route.ts`)
- Visitor → Contact endpoint: sends message (evidence: `README.md`)
- Contact endpoint → Content storage: stores submission (evidence: `app/api/contact/route.ts`)
- Editor → Upload endpoint: uploads assets (evidence: `README.md`)
- Upload endpoint → Content storage: stores upload (evidence: `app/api/admin/upload/route.ts`)
- Asset route → CMS data: uses CMS data (evidence: `app/fx/m/[...file]/route.ts`)
- Framer runtime → Motion runtime: imports runtime (evidence: `public/fx/s/framer.D5DlDBlP.mjs`)
- Framer runtime → React runtime: imports runtime (evidence: `public/fx/s/framer.D5DlDBlP.mjs`)
- Framer runtime → Rolldown runtime: imports runtime (evidence: `public/fx/s/framer.D5DlDBlP.mjs`)
- Motion runtime → React runtime: imports runtime (evidence: `public/fx/s/motion.BiGGL1B_.mjs`)
- Motion runtime → Rolldown runtime: imports runtime (evidence: `public/fx/s/motion.BiGGL1B_.mjs`)
- React runtime → Rolldown runtime: imports runtime (evidence: `public/fx/s/react.Bg2SsqF2.mjs`)
- Editor preview → Editor browser script: loads editor (evidence: `app/preview/[[...path]]/route.ts`)
- Template renderer → Content patcher: injects patcher (evidence: `lib/render.ts`)
