# hugo-jouffre/memo-book architecture

> Architecture diagram of the GitHub repository hugo-jouffre/memo-book, 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/hugo-jouffre/memo-book
- Repository: https://github.com/hugo-jouffre/memo-book

## Overview

MemoBook captures spoken travel memories in its iOS app, turns them into reviewed and structured book content, and generates a shareable or printable PDF. The backend also supports conversation, accounts, payments, notifications, and exports; the repository includes a separate browser-based book-composition generator. The README documents the main product stages and capabilities. Some backend jobs and iOS feature implementations were not sampled, so their internal call relationships are not asserted here.

Main entry points: [`backend/src/app.ts`](https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/app.ts) (HTTP API), [`ios/Modules/Sources/MemoBookNetworking/MemoBookAPIClient.swift`](https://github.com/hugo-jouffre/memo-book/blob/main/ios/Modules/Sources/MemoBookNetworking/MemoBookAPIClient.swift) (API client), [`backend/src/jobs`](https://github.com/hugo-jouffre/memo-book/tree/main/backend/src/jobs) (Memo pipeline), [`backend/src/context.ts`](https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/context.ts) (Service context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ios["iOS app"]
  node_iosapp["MemoBook app<br/>[MemoBookApp.swift]"]
  node_onboarding["Onboarding"]
  node_recording["Voice capture"]
  node_memo["Memo management"]
  node_chat["MEMO chat"]
  node_preview["Book preview"]
  node_network["API client"]
end

subgraph group_backend["Backend"]
  node_api["HTTP API<br/>[app.ts]"]
  node_context["Service context<br/>[context.ts]"]
  node_queue["Job queue<br/>[queue.ts]"]
  node_storage[("Media storage<br/>[storage.ts]")]
  node_database[("PostgreSQL")]
end

subgraph group_book["Book production"]
  node_pipeline["Memo pipeline"]
  node_transcription["Transcription<br/>[transcription.ts]"]
  node_structuring["Story structuring<br/>[structuring.ts]"]
  node_rendering["PDF rendering<br/>[apitemplate.ts]"]
end

subgraph group_account["Accounts and services"]
  node_payments["Payments and wallet<br/>[payments.ts]"]
  node_redaction["Privacy redaction<br/>[redaction.ts]"]
  node_notifications["Notifications<br/>[notifications.ts]"]
end

subgraph group_generator["Browser generator"]
  node_generatorui["Composition tool<br/>[app.js]"]
  node_generatorsrv["Generator server<br/>[server.mjs]"]
end

node_traveller(("Traveller"))
node_openai{{"OpenAI"}}
node_anthropic{{"Anthropic"}}
node_apitemplate{{"APITemplate"}}
node_stripe{{"Stripe"}}
node_appstore{{"Apple App Store"}}

node_traveller -->|"uses"| node_iosapp
node_iosapp -->|"opens"| node_onboarding
node_traveller -->|"records memories"| node_recording
node_recording -.->|"uploads audio"| node_network
node_memo -.->|"syncs entries"| node_network
node_chat -.->|"sends conversation"| node_network
node_preview -->|"requests preview"| node_network
node_network -->|"sends HTTP requests"| node_api
node_api -->|"uses services"| node_context
node_context -->|"creates queue"| node_queue
node_pipeline -->|"transcribes"| node_transcription
node_pipeline -->|"structures stories"| node_structuring
node_pipeline -->|"renders book"| node_rendering
node_transcription -->|"uses API"| node_openai
node_structuring -->|"uses API"| node_anthropic
node_rendering -->|"renders with"| node_apitemplate
node_api -.->|"stores media"| node_storage
node_context -->|"connects to"| node_database
node_api -->|"serves payments"| node_payments
node_payments -->|"uses payments API"| node_stripe
node_api -.->|"provides redaction"| node_redaction
node_api -.->|"provides notifications"| node_notifications
node_traveller -->|"composes books"| node_generatorui
node_generatorui -.->|"uses server"| node_generatorsrv
node_preview -.->|"supports subscription"| node_appstore

click node_iosapp "https://github.com/hugo-jouffre/memo-book/blob/main/ios/App/MemoBookApp.swift"
click node_onboarding "https://github.com/hugo-jouffre/memo-book/blob/main/ios/Modules/Sources/MemoBookFeature/OnboardingStorage.swift"
click node_recording "https://github.com/hugo-jouffre/memo-book/tree/main/ios/Modules/Sources/MemoBookFeature/Recording"
click node_memo "https://github.com/hugo-jouffre/memo-book/tree/main/ios/Modules/Sources/MemoBookFeature/MemoDetail"
click node_chat "https://github.com/hugo-jouffre/memo-book/tree/main/ios/Modules/Sources/MemoBookFeature/Chat"
click node_preview "https://github.com/hugo-jouffre/memo-book/blob/main/ios/Modules/Sources/MemoBookFeature/BookPreview/BookPreviewFlowView.swift"
click node_network "https://github.com/hugo-jouffre/memo-book/blob/main/ios/Modules/Sources/MemoBookNetworking/MemoBookAPIClient.swift"
click node_api "https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/app.ts"
click node_context "https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/context.ts"
click node_queue "https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/jobs/queue.ts"
click node_pipeline "https://github.com/hugo-jouffre/memo-book/tree/main/backend/src/jobs"
click node_transcription "https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/transcription.ts"
click node_structuring "https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/structuring.ts"
click node_rendering "https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/apitemplate.ts"
click node_storage "https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/storage.ts"
click node_payments "https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/payments.ts"
click node_redaction "https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/redaction.ts"
click node_notifications "https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/notifications.ts"
click node_generatorui "https://github.com/hugo-jouffre/memo-book/blob/main/MemoBook%20Generator/public/app.js"
click node_generatorsrv "https://github.com/hugo-jouffre/memo-book/blob/main/MemoBook%20Generator/server.mjs"

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_iosapp,node_onboarding,node_recording,node_memo,node_chat,node_preview,node_network toneBlue
class node_api,node_context,node_queue,node_storage,node_database toneAmber
class node_pipeline,node_transcription,node_structuring,node_rendering,node_apitemplate toneMint
class node_payments,node_redaction,node_notifications toneRose
class node_generatorui,node_generatorsrv,node_traveller,node_openai,node_anthropic,node_stripe,node_appstore toneIndigo
```

## Components

### iOS app

- [MemoBook app](https://github.com/hugo-jouffre/memo-book/blob/main/ios/App/MemoBookApp.swift): `ios/App/MemoBookApp.swift`
- [Onboarding](https://github.com/hugo-jouffre/memo-book/blob/main/ios/Modules/Sources/MemoBookFeature/OnboardingStorage.swift): `ios/Modules/Sources/MemoBookFeature/OnboardingStorage.swift`
- [Voice capture](https://github.com/hugo-jouffre/memo-book/tree/main/ios/Modules/Sources/MemoBookFeature/Recording): `ios/Modules/Sources/MemoBookFeature/Recording`
- [Memo management](https://github.com/hugo-jouffre/memo-book/tree/main/ios/Modules/Sources/MemoBookFeature/MemoDetail): `ios/Modules/Sources/MemoBookFeature/MemoDetail`
- [MEMO chat](https://github.com/hugo-jouffre/memo-book/tree/main/ios/Modules/Sources/MemoBookFeature/Chat): `ios/Modules/Sources/MemoBookFeature/Chat`
- [Book preview](https://github.com/hugo-jouffre/memo-book/blob/main/ios/Modules/Sources/MemoBookFeature/BookPreview/BookPreviewFlowView.swift): `ios/Modules/Sources/MemoBookFeature/BookPreview/BookPreviewFlowView.swift`
- [API client](https://github.com/hugo-jouffre/memo-book/blob/main/ios/Modules/Sources/MemoBookNetworking/MemoBookAPIClient.swift): `ios/Modules/Sources/MemoBookNetworking/MemoBookAPIClient.swift`

### Backend

- [HTTP API](https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Service context](https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/context.ts): `backend/src/context.ts`
- [Job queue](https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/jobs/queue.ts): `backend/src/jobs/queue.ts`
- [Media storage](https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/storage.ts): `backend/src/services/storage.ts`
- **PostgreSQL**

### Book production

- [Memo pipeline](https://github.com/hugo-jouffre/memo-book/tree/main/backend/src/jobs): `backend/src/jobs`
- [Transcription](https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/transcription.ts): `backend/src/services/transcription.ts`
- [Story structuring](https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/structuring.ts): `backend/src/services/structuring.ts`
- [PDF rendering](https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/apitemplate.ts): `backend/src/services/apitemplate.ts`

### Accounts and services

- [Payments and wallet](https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/payments.ts): `backend/src/services/payments.ts`
- [Privacy redaction](https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/redaction.ts): `backend/src/services/redaction.ts`
- [Notifications](https://github.com/hugo-jouffre/memo-book/blob/main/backend/src/services/notifications.ts): `backend/src/services/notifications.ts`

### Browser generator

- [Composition tool](https://github.com/hugo-jouffre/memo-book/blob/main/MemoBook%20Generator/public/app.js): `MemoBook Generator/public/app.js`
- [Generator server](https://github.com/hugo-jouffre/memo-book/blob/main/MemoBook%20Generator/server.mjs): `MemoBook Generator/server.mjs`

### Other components

- **Traveller**
- **OpenAI**
- **Anthropic**
- **APITemplate**
- **Stripe**
- **Apple App Store**

## Connections

- Traveller → MemoBook app: uses (evidence: `README.md`)
- MemoBook app → Onboarding: opens (evidence: `ios/App/MemoBookApp.swift`)
- Traveller → Voice capture: records memories (evidence: `README.md`)
- Voice capture → API client: uploads audio
- Memo management → API client: syncs entries
- MEMO chat → API client: sends conversation
- Book preview → API client: requests preview (evidence: `ios/Modules/Sources/MemoBookFeature/BookPreview/BookPreviewFlowView.swift`)
- API client → HTTP API: sends HTTP requests (evidence: `ios/Modules/Sources/MemoBookNetworking/MemoBookAPIClient.swift`)
- HTTP API → Service context: uses services (evidence: `backend/src/app.ts`)
- Service context → Job queue: creates queue (evidence: `backend/src/context.ts`)
- Memo pipeline → Transcription: transcribes (evidence: `README.md`)
- Memo pipeline → Story structuring: structures stories (evidence: `README.md`)
- Memo pipeline → PDF rendering: renders book (evidence: `README.md`)
- Transcription → OpenAI: uses API (evidence: `README.md`)
- Story structuring → Anthropic: uses API (evidence: `README.md`)
- PDF rendering → APITemplate: renders with (evidence: `README.md`)
- HTTP API → Media storage: stores media
- Service context → PostgreSQL: connects to (evidence: `backend/src/context.ts`)
- HTTP API → Payments and wallet: serves payments (evidence: `backend/src/app.ts`)
- Payments and wallet → Stripe: uses payments API (evidence: `README.md`)
- HTTP API → Privacy redaction: provides redaction
- HTTP API → Notifications: provides notifications
- Traveller → Composition tool: composes books (evidence: `README.md`)
- Composition tool → Generator server: uses server
- Book preview → Apple App Store: supports subscription (evidence: `README.md`)
