# zaidh-mech/project-zeno architecture

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

- Interactive diagram: https://gitdiagram.com/zaidh-mech/project-zeno
- Repository: https://github.com/zaidh-mech/project-zeno

## Overview

Aura combines a phone-led voice companion, embedded device firmware, an AI audio service, an NFC-opened birthday website, encrypted memory-gallery publishing, and a compact enclosure model. The primary flow is phone control captures speech and sends it to the backend; the C3 receives expression commands over Bluetooth and fetches reply audio over Wi-Fi. Gallery relationships are included where excerpts show them; unsampled route internals and device/backend protocol details are limited to README-documented links.

Main entry points: [`web/lib/gallery-github.ts`](https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-github.ts) (GitHub Publishing), [`backend/app.py`](https://github.com/zaidh-mech/project-zeno/blob/main/backend/app.py) (Voice Backend), [`web/components/MemoryGallery.tsx`](https://github.com/zaidh-mech/project-zeno/blob/main/web/components/MemoryGallery.tsx) (Memory Gallery), [`web/app/control/page.tsx`](https://github.com/zaidh-mech/project-zeno/blob/main/web/app/control/page.tsx) (Phone Control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_device["Companion Device"]
  node_c3["C3 Firmware<br/>[c3_main.cpp]"]
  node_s3["Legacy S3 Firmware<br/>[main.cpp]"]
end

subgraph group_service["Voice Service"]
  node_backend["Voice Backend<br/>[app.py]"]
end

subgraph group_portal["Birthday Portal"]
  node_control["Phone Control<br/>[page.tsx]"]
  node_homepage["Birthday Home<br/>[page.tsx]"]
  node_scene["Aura Scene<br/>[AuraScene.tsx]"]
  node_pet["Companion Pet<br/>[CompanionPet.tsx]"]
  node_intro["Keepsake Intro<br/>[KeepsakeIntro.tsx]"]
  node_touchsky["Touch Sky<br/>[TouchSky.tsx]"]
  node_together["Together Cards<br/>[TogetherCards.tsx]"]
  node_games["Play Corner<br/>[PlayCorner.tsx]"]
  node_content["Site Content<br/>[content.ts]"]
  node_settings["Site Settings<br/>[site-settings.ts]"]
end

subgraph group_gallery["Memory Gallery"]
  node_galleryview["Memory Gallery<br/>[MemoryGallery.tsx]"]
  node_galleryadmin["Gallery Admin"]
  node_galleryapi["Gallery API<br/>[route.ts]"]
  node_unlockapi["Gallery Unlock<br/>[route.ts]"]
  node_memoryapi["Memory Updates<br/>[route.ts]"]
  node_photoapi["Photo Access<br/>[route.ts]"]
  node_exportapi["Gallery Export<br/>[route.ts]"]
  node_galleryauth["Gallery Auth<br/>[gallery-auth.ts]"]
  node_store[("Local Album Store<br/>[gallery-store.ts]")]
  node_export["Gallery Export Logic<br/>[gallery-export.ts]"]
  node_reader["Gallery Encryption<br/>[gallery-reader.ts]"]
  node_names["Nickname Encryption<br/>[gallery-names.ts]"]
  node_github["GitHub Publishing<br/>[gallery-github.ts]"]
end

subgraph group_mechanical["Enclosure Design"]
  node_cad["Companion CAD Model<br/>[build_companion.py]"]
end

node_person(("Recipient / Maker"))
node_githubservice[("GitHub Repository")]
node_nfc["NFC Tag"]

node_person -->|"uses on phone"| node_control
node_control -->|"sends recorded voice"| node_backend
node_backend -->|"returns reply audio"| node_control
node_backend -->|"provides expression commands"| node_c3
node_c3 -->|"downloads reply audio"| node_backend
node_person -->|"opens website"| node_nfc
node_nfc -->|"opens portal"| node_homepage
node_person -->|"views memories"| node_galleryview
node_galleryview -->|"reads published album"| node_reader
node_galleryview -->|"checks nickname answers"| node_names
node_galleryadmin -->|"manages published album"| node_github
node_github -->|"decrypts album"| node_reader
node_github -->|"handles nickname albums"| node_names
node_github -->|"publishes via API"| node_githubservice
node_reader -->|"decrypts nickname payload"| node_names
node_export -->|"reads album data"| node_store

click node_control "https://github.com/zaidh-mech/project-zeno/blob/main/web/app/control/page.tsx"
click node_c3 "https://github.com/zaidh-mech/project-zeno/blob/main/src/c3_main.cpp"
click node_s3 "https://github.com/zaidh-mech/project-zeno/blob/main/src/main.cpp"
click node_backend "https://github.com/zaidh-mech/project-zeno/blob/main/backend/app.py"
click node_homepage "https://github.com/zaidh-mech/project-zeno/blob/main/web/app/page.tsx"
click node_scene "https://github.com/zaidh-mech/project-zeno/blob/main/web/components/AuraScene.tsx"
click node_pet "https://github.com/zaidh-mech/project-zeno/blob/main/web/components/CompanionPet.tsx"
click node_intro "https://github.com/zaidh-mech/project-zeno/blob/main/web/components/KeepsakeIntro.tsx"
click node_touchsky "https://github.com/zaidh-mech/project-zeno/blob/main/web/components/TouchSky.tsx"
click node_together "https://github.com/zaidh-mech/project-zeno/blob/main/web/components/TogetherCards.tsx"
click node_games "https://github.com/zaidh-mech/project-zeno/blob/main/web/components/PlayCorner.tsx"
click node_content "https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/content.ts"
click node_galleryview "https://github.com/zaidh-mech/project-zeno/blob/main/web/components/MemoryGallery.tsx"
click node_galleryadmin "https://github.com/zaidh-mech/project-zeno/blob/main/web/components/OnlineGalleryAdmin.tsx"
click node_galleryapi "https://github.com/zaidh-mech/project-zeno/blob/main/web/app/api/gallery/route.ts"
click node_unlockapi "https://github.com/zaidh-mech/project-zeno/blob/main/web/app/api/gallery/unlock/route.ts"
click node_memoryapi "https://github.com/zaidh-mech/project-zeno/blob/main/web/app/api/gallery/memory/%5Bid%5D/route.ts"
click node_photoapi "https://github.com/zaidh-mech/project-zeno/blob/main/web/app/api/gallery/photo/%5Bid%5D/route.ts"
click node_exportapi "https://github.com/zaidh-mech/project-zeno/blob/main/web/app/api/gallery/export/route.ts"
click node_galleryauth "https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-auth.ts"
click node_store "https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-store.ts"
click node_export "https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-export.ts"
click node_reader "https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-reader.ts"
click node_names "https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-names.ts"
click node_github "https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-github.ts"
click node_settings "https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/site-settings.ts"
click node_cad "https://github.com/zaidh-mech/project-zeno/blob/main/companion/tools/build_companion.py"

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_c3,node_s3 toneBlue
class node_backend,node_githubservice toneAmber
class node_control,node_homepage,node_scene,node_pet,node_intro,node_touchsky,node_together,node_games,node_content,node_settings toneMint
class node_galleryview,node_galleryadmin,node_galleryapi,node_unlockapi,node_memoryapi,node_photoapi,node_exportapi,node_galleryauth,node_store,node_export,node_reader,node_names,node_github toneRose
class node_cad,node_person,node_nfc toneIndigo
```

## Components

### Companion Device

- [C3 Firmware](https://github.com/zaidh-mech/project-zeno/blob/main/src/c3_main.cpp): `src/c3_main.cpp`
- [Legacy S3 Firmware](https://github.com/zaidh-mech/project-zeno/blob/main/src/main.cpp): `src/main.cpp`

### Voice Service

- [Voice Backend](https://github.com/zaidh-mech/project-zeno/blob/main/backend/app.py): `backend/app.py`

### Birthday Portal

- [Phone Control](https://github.com/zaidh-mech/project-zeno/blob/main/web/app/control/page.tsx): `web/app/control/page.tsx`
- [Birthday Home](https://github.com/zaidh-mech/project-zeno/blob/main/web/app/page.tsx): `web/app/page.tsx`
- [Aura Scene](https://github.com/zaidh-mech/project-zeno/blob/main/web/components/AuraScene.tsx): `web/components/AuraScene.tsx`
- [Companion Pet](https://github.com/zaidh-mech/project-zeno/blob/main/web/components/CompanionPet.tsx): `web/components/CompanionPet.tsx`
- [Keepsake Intro](https://github.com/zaidh-mech/project-zeno/blob/main/web/components/KeepsakeIntro.tsx): `web/components/KeepsakeIntro.tsx`
- [Touch Sky](https://github.com/zaidh-mech/project-zeno/blob/main/web/components/TouchSky.tsx): `web/components/TouchSky.tsx`
- [Together Cards](https://github.com/zaidh-mech/project-zeno/blob/main/web/components/TogetherCards.tsx): `web/components/TogetherCards.tsx`
- [Play Corner](https://github.com/zaidh-mech/project-zeno/blob/main/web/components/PlayCorner.tsx): `web/components/PlayCorner.tsx`
- [Site Content](https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/content.ts): `web/lib/content.ts`
- [Site Settings](https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/site-settings.ts): `web/lib/site-settings.ts`

### Memory Gallery

- [Memory Gallery](https://github.com/zaidh-mech/project-zeno/blob/main/web/components/MemoryGallery.tsx): `web/components/MemoryGallery.tsx`
- [Gallery Admin](https://github.com/zaidh-mech/project-zeno/blob/main/web/components/OnlineGalleryAdmin.tsx): `web/components/OnlineGalleryAdmin.tsx`
- [Gallery API](https://github.com/zaidh-mech/project-zeno/blob/main/web/app/api/gallery/route.ts): `web/app/api/gallery/route.ts`
- [Gallery Unlock](https://github.com/zaidh-mech/project-zeno/blob/main/web/app/api/gallery/unlock/route.ts): `web/app/api/gallery/unlock/route.ts`
- [Memory Updates](https://github.com/zaidh-mech/project-zeno/blob/main/web/app/api/gallery/memory/%5Bid%5D/route.ts): `web/app/api/gallery/memory/[id]/route.ts`
- [Photo Access](https://github.com/zaidh-mech/project-zeno/blob/main/web/app/api/gallery/photo/%5Bid%5D/route.ts): `web/app/api/gallery/photo/[id]/route.ts`
- [Gallery Export](https://github.com/zaidh-mech/project-zeno/blob/main/web/app/api/gallery/export/route.ts): `web/app/api/gallery/export/route.ts`
- [Gallery Auth](https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-auth.ts): `web/lib/gallery-auth.ts`
- [Local Album Store](https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-store.ts): `web/lib/gallery-store.ts`
- [Gallery Export Logic](https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-export.ts): `web/lib/gallery-export.ts`
- [Gallery Encryption](https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-reader.ts): `web/lib/gallery-reader.ts`
- [Nickname Encryption](https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-names.ts): `web/lib/gallery-names.ts`
- [GitHub Publishing](https://github.com/zaidh-mech/project-zeno/blob/main/web/lib/gallery-github.ts): `web/lib/gallery-github.ts`

### Enclosure Design

- [Companion CAD Model](https://github.com/zaidh-mech/project-zeno/blob/main/companion/tools/build_companion.py): `companion/tools/build_companion.py`

### Other components

- **Recipient / Maker**
- **GitHub Repository**
- **NFC Tag**

## Connections

- Recipient / Maker → Phone Control: uses on phone
- Phone Control → Voice Backend: sends recorded voice
- Voice Backend → Phone Control: returns reply audio
- Voice Backend → C3 Firmware: provides expression commands
- C3 Firmware → Voice Backend: downloads reply audio
- Recipient / Maker → NFC Tag: opens website
- NFC Tag → Birthday Home: opens portal
- Recipient / Maker → Memory Gallery: views memories
- Memory Gallery → Gallery Encryption: reads published album (evidence: `web/components/MemoryGallery.tsx`)
- Memory Gallery → Nickname Encryption: checks nickname answers (evidence: `web/components/MemoryGallery.tsx`)
- Gallery Admin → GitHub Publishing: manages published album (evidence: `web/components/OnlineGalleryAdmin.tsx`)
- GitHub Publishing → Gallery Encryption: decrypts album (evidence: `web/lib/gallery-github.ts`)
- GitHub Publishing → Nickname Encryption: handles nickname albums (evidence: `web/lib/gallery-github.ts`)
- GitHub Publishing → GitHub Repository: publishes via API (evidence: `web/lib/gallery-github.ts`)
- Gallery Encryption → Nickname Encryption: decrypts nickname payload (evidence: `web/lib/gallery-reader.ts`)
- Gallery Export Logic → Local Album Store: reads album data (evidence: `web/lib/gallery-export.ts`)
