# bible-translation-tools/sefer architecture

> Architecture diagram of the GitHub repository bible-translation-tools/sefer, 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/bible-translation-tools/sefer
- Repository: https://github.com/bible-translation-tools/sefer

## Overview

Sefer is a local-first scripture-editor scaffold, but its README says the first screen is intentionally only a shell and editing, storage, Git, parsing, and proofreading remain planned. The current runnable flow is user → application boot/composition → services and routed shell; the tree also shows editor, search, review, sync, and host subsystems that are not yet established as an integrated user workflow. The graph distinguishes documented architecture from sampled wiring; unsampled implementation details and speculative connections are omitted.

Main entry points: [`src/app/services.ts`](https://github.com/bible-translation-tools/sefer/blob/master/src/app/services.ts) (Service wiring), [`src/core`](https://github.com/bible-translation-tools/sefer/tree/master/src/core) (Core domain), [`src/App.tsx`](https://github.com/bible-translation-tools/sefer/blob/master/src/App.tsx) (App root), [`src/core/galley/galley.ts`](https://github.com/bible-translation-tools/sefer/blob/master/src/core/galley/galley.ts) (Galley analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_app["App root<br/>[App.tsx]"]
  node_composition["Composition<br/>[composition.ts]"]
  node_services["Service wiring<br/>[services.ts]"]
  node_routes["Routed screens"]
  node_project_context["Project context<br/>[ProjectContext.tsx]"]
  node_app_modules["App services"]
  node_review["Review UI<br/>[ReviewPanel.tsx]"]
end

subgraph group_policy["Core policy"]
  node_core["Core domain"]
  node_galley["Galley analysis<br/>[galley.ts]"]
  node_repository["Git repository policy<br/>[repository.ts]"]
  node_search["Project search<br/>[search.ts]"]
end

subgraph group_editing["Editor subsystem"]
  node_editor["Editor engine<br/>[compose.ts]"]
  node_editor_entry["Editor API<br/>[index.ts]"]
end

subgraph group_hosts["Host capabilities"]
  node_platform["Host adapters"]
  node_tauri_host["Desktop host<br/>[lib.rs]"]
  node_git_commands["Native Git commands<br/>[git.rs]"]
  node_history_worker["History index worker<br/>[worker.ts]"]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"composes"| node_composition
node_app -->|"renders"| node_routes
node_composition -->|"builds services"| node_services
node_services -->|"detects host"| node_platform
node_services -->|"wires layers"| node_core
node_routes -.->|"uses project state"| node_project_context
node_project_context -->|"uses app modules"| node_app_modules
node_tauri_host -->|"registers commands"| node_git_commands
node_repository -->|"uses path policy"| node_core
node_galley -->|"uses observability"| node_core
node_search -->|"uses analysis"| node_galley
node_editor_entry -->|"exports engine"| node_editor
node_editor -.->|"analyzes source"| node_galley
node_review -.->|"uses services"| node_services
node_history_worker -->|"builds book index"| node_core

click node_app "https://github.com/bible-translation-tools/sefer/blob/master/src/App.tsx"
click node_composition "https://github.com/bible-translation-tools/sefer/blob/master/src/app/composition.ts"
click node_services "https://github.com/bible-translation-tools/sefer/blob/master/src/app/services.ts"
click node_routes "https://github.com/bible-translation-tools/sefer/tree/master/src/routes"
click node_project_context "https://github.com/bible-translation-tools/sefer/blob/master/src/app/ProjectContext.tsx"
click node_app_modules "https://github.com/bible-translation-tools/sefer/tree/master/src/app"
click node_platform "https://github.com/bible-translation-tools/sefer/tree/master/src/platform"
click node_tauri_host "https://github.com/bible-translation-tools/sefer/blob/master/src-tauri/src/lib.rs"
click node_git_commands "https://github.com/bible-translation-tools/sefer/blob/master/src-tauri/src/git.rs"
click node_core "https://github.com/bible-translation-tools/sefer/tree/master/src/core"
click node_galley "https://github.com/bible-translation-tools/sefer/blob/master/src/core/galley/galley.ts"
click node_repository "https://github.com/bible-translation-tools/sefer/blob/master/src/core/git/repository.ts"
click node_search "https://github.com/bible-translation-tools/sefer/blob/master/src/core/search/search.ts"
click node_editor "https://github.com/bible-translation-tools/sefer/blob/master/src/editor/core/compose.ts"
click node_editor_entry "https://github.com/bible-translation-tools/sefer/blob/master/src/editor/index.ts"
click node_review "https://github.com/bible-translation-tools/sefer/blob/master/src/app/ui/review/ReviewPanel.tsx"
click node_history_worker "https://github.com/bible-translation-tools/sefer/blob/master/src/platform/web/history/worker.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_app,node_composition,node_services,node_routes,node_project_context,node_app_modules,node_review,node_user toneBlue
class node_core,node_galley,node_repository,node_search toneAmber
class node_editor,node_editor_entry toneMint
class node_platform,node_tauri_host,node_git_commands,node_history_worker toneRose
```

## Components

### Application shell

- [App root](https://github.com/bible-translation-tools/sefer/blob/master/src/App.tsx): `src/App.tsx`
- [Composition](https://github.com/bible-translation-tools/sefer/blob/master/src/app/composition.ts): `src/app/composition.ts`
- [Service wiring](https://github.com/bible-translation-tools/sefer/blob/master/src/app/services.ts): `src/app/services.ts`
- [Routed screens](https://github.com/bible-translation-tools/sefer/tree/master/src/routes): `src/routes`
- [Project context](https://github.com/bible-translation-tools/sefer/blob/master/src/app/ProjectContext.tsx): `src/app/ProjectContext.tsx`
- [App services](https://github.com/bible-translation-tools/sefer/tree/master/src/app): `src/app`
- [Review UI](https://github.com/bible-translation-tools/sefer/blob/master/src/app/ui/review/ReviewPanel.tsx): `src/app/ui/review/ReviewPanel.tsx`

### Core policy

- [Core domain](https://github.com/bible-translation-tools/sefer/tree/master/src/core): `src/core`
- [Galley analysis](https://github.com/bible-translation-tools/sefer/blob/master/src/core/galley/galley.ts): `src/core/galley/galley.ts`
- [Git repository policy](https://github.com/bible-translation-tools/sefer/blob/master/src/core/git/repository.ts): `src/core/git/repository.ts`
- [Project search](https://github.com/bible-translation-tools/sefer/blob/master/src/core/search/search.ts): `src/core/search/search.ts`

### Editor subsystem

- [Editor engine](https://github.com/bible-translation-tools/sefer/blob/master/src/editor/core/compose.ts): `src/editor/core/compose.ts`
- [Editor API](https://github.com/bible-translation-tools/sefer/blob/master/src/editor/index.ts): `src/editor/index.ts`

### Host capabilities

- [Host adapters](https://github.com/bible-translation-tools/sefer/tree/master/src/platform): `src/platform`
- [Desktop host](https://github.com/bible-translation-tools/sefer/blob/master/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Native Git commands](https://github.com/bible-translation-tools/sefer/blob/master/src-tauri/src/git.rs): `src-tauri/src/git.rs`
- [History index worker](https://github.com/bible-translation-tools/sefer/blob/master/src/platform/web/history/worker.ts): `src/platform/web/history/worker.ts`

### Other components

- **User**

## Connections

- User → App root: opens (evidence: `src/App.tsx`)
- App root → Composition: composes (evidence: `src/App.tsx`)
- App root → Routed screens: renders (evidence: `src/App.tsx`)
- Composition → Service wiring: builds services (evidence: `src/app/services.ts`)
- Service wiring → Host adapters: detects host (evidence: `src/app/services.ts`)
- Service wiring → Core domain: wires layers (evidence: `src/app/services.ts`)
- Routed screens → Project context: uses project state
- Project context → App services: uses app modules (evidence: `src/app/ProjectContext.tsx`)
- Desktop host → Native Git commands: registers commands (evidence: `src-tauri/src/lib.rs`)
- Git repository policy → Core domain: uses path policy (evidence: `src/core/git/repository.ts`)
- Galley analysis → Core domain: uses observability (evidence: `src/core/galley/galley.ts`)
- Project search → Galley analysis: uses analysis (evidence: `src/core/search/search.ts`)
- Editor API → Editor engine: exports engine (evidence: `src/editor/index.ts`)
- Editor engine → Galley analysis: analyzes source
- Review UI → Service wiring: uses services
- History index worker → Core domain: builds book index (evidence: `src/platform/web/history/worker.ts`)
