# rachet-dev/rachebook architecture

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

- Interactive diagram: https://gitdiagram.com/rachet-dev/rachebook
- Repository: https://github.com/rachet-dev/rachebook

## Overview

#### Purpose and runtime
`rachebook` is a native iOS 13+ handwritten-note application. It manages text notes and invokes Yandex Vision to OCR handwriting captured from the camera or photo library. The app is built and launched through `rachebook.xcodeproj`; UIKit application startup is in `rachebook/AppDelegate.swift`.

#### Application bootstrap and UI shell
The UIKit lifecycle starts in `rachebook/AppDelegate.swift`, with launch-screen and application metadata under `rachebook/Base.lproj/LaunchScreen.storyboard` and `rachebook/Info.plist`. The primary UI is controller-based rather than a web or service runtime.

#### Note domain model
`Models/Note.swift` defines the note entity used across listing, editing, search, sorting, and OCR-created records. `Models/NoteStore.swift` is the central note-state/persistence boundary: UI controllers should consume and mutate notes through it rather than own storage independently.

#### Notes browsing workflow
`Views/NotesListViewController.swift` is the main note-management surface. It presents stored notes and drives user-facing operations including content/tag search, date-based sorting, creating notes, selecting a note for editing, and deletion. It coordinates list state with `Models/NoteStore.swift`.

#### Editing and capture workflow
`Views/NoteEditorViewController.swift` owns the individual-note editing flow. It is the likely integration point for creating or updating `Models/Note.swift` instances and for initiating image acquisition from device camera or gallery before OCR. Completed edits flow back through `Models/NoteStore.swift`.

#### OCR integration boundary
`Models/YandexVisionService.swift` encapsulates communication with the external Yandex Vision API. The service requires a Yandex Cloud API key and `folderId`, currently configured in that source file per the README. Its input boundary is an acquired image; its output is recognized text used to automatically create a note through the editor/store flow. Network access and cloud credentials are therefore isolated from the view controllers.

#### Assets and infrastructure
Visual resources are packaged in `rachebook/Assets.xcassets`, including the app icon. Xcode project/workspace metadata lives in `rachebook.xcodeproj`. Material external dependencies are iOS UIKit/device media access and Yandex Cloud Vision; no backend service or web runtime is represented in the repository.

Main entry points: [`Views/NoteEditorViewController.swift`](https://github.com/rachet-dev/rachebook/blob/main/Views/NoteEditorViewController.swift) (Note Editor), [`rachebook/AppDelegate.swift`](https://github.com/rachet-dev/rachebook/blob/main/rachebook/AppDelegate.swift) (App Delegate), [`Views/NotesListViewController.swift`](https://github.com/rachet-dev/rachebook/blob/main/Views/NotesListViewController.swift) (Notes List), [`Models/YandexVisionService.swift`](https://github.com/rachet-dev/rachebook/blob/main/Models/YandexVisionService.swift) (Yandex Vision Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ios["iOS App"]
  node_xcode["Xcode Project<br/>build project"]
  node_app_delegate["App Delegate<br/>UIKit bootstrap<br/>[AppDelegate.swift]"]
  node_launch_screen["Launch Screen<br/>storyboard"]
  node_app_metadata["App Metadata<br/>Info.plist<br/>[Info.plist]"]
  node_assets["Visual Assets<br/>asset catalog<br/>[Assets.xcassets]"]
  node_notes_list["Notes List<br/>view controller"]
  node_note_editor["Note Editor<br/>view controller"]
end

subgraph group_domain["Notes Domain"]
  node_note["Note<br/>domain entity<br/>[Note.swift]"]
  node_note_store[("Note Store<br/>state and persistence<br/>[NoteStore.swift]")]
  node_vision_service["Yandex Vision Service<br/>OCR client"]
end

subgraph group_external["External Services"]
  node_device_media["Camera &amp; Photo Library<br/>iOS media access"]
  node_yandex_vision{{"Yandex Cloud Vision<br/>external OCR API"}}
end

node_xcode -->|"builds"| node_app_delegate
node_app_delegate -->|"launches with"| node_launch_screen
node_app_delegate -->|"reads metadata"| node_app_metadata
node_app_delegate -->|"starts UI"| node_notes_list
node_assets -->|"supplies visuals"| node_notes_list
node_notes_list -->|"lists and mutates"| node_note_store
node_notes_list -->|"creates or opens"| node_note_editor
node_note_editor -->|"saves edits"| node_note_store
node_note_store -->|"stores"| node_note
node_note_editor -->|"acquires image"| node_device_media
node_note_editor -->|"sends image for OCR"| node_vision_service
node_vision_service -->|"OCR request"| node_yandex_vision
node_vision_service -->|"recognized text"| node_note_editor

click node_xcode "https://github.com/rachet-dev/rachebook/tree/main/rachebook.xcodeproj"
click node_app_delegate "https://github.com/rachet-dev/rachebook/blob/main/rachebook/AppDelegate.swift"
click node_launch_screen "https://github.com/rachet-dev/rachebook/blob/main/rachebook/Base.lproj/LaunchScreen.storyboard"
click node_app_metadata "https://github.com/rachet-dev/rachebook/blob/main/rachebook/Info.plist"
click node_assets "https://github.com/rachet-dev/rachebook/tree/main/rachebook/Assets.xcassets"
click node_notes_list "https://github.com/rachet-dev/rachebook/blob/main/Views/NotesListViewController.swift"
click node_note_editor "https://github.com/rachet-dev/rachebook/blob/main/Views/NoteEditorViewController.swift"
click node_note "https://github.com/rachet-dev/rachebook/blob/main/Models/Note.swift"
click node_note_store "https://github.com/rachet-dev/rachebook/blob/main/Models/NoteStore.swift"
click node_vision_service "https://github.com/rachet-dev/rachebook/blob/main/Models/YandexVisionService.swift"

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_xcode,node_app_delegate,node_launch_screen,node_app_metadata,node_assets,node_notes_list,node_note_editor toneBlue
class node_note,node_note_store,node_vision_service toneAmber
class node_device_media,node_yandex_vision toneMint
```

## Components

### iOS App

- [Xcode Project](https://github.com/rachet-dev/rachebook/tree/main/rachebook.xcodeproj): build project · `rachebook.xcodeproj`
- [App Delegate](https://github.com/rachet-dev/rachebook/blob/main/rachebook/AppDelegate.swift): UIKit bootstrap · `rachebook/AppDelegate.swift`
- [Launch Screen](https://github.com/rachet-dev/rachebook/blob/main/rachebook/Base.lproj/LaunchScreen.storyboard): storyboard · `rachebook/Base.lproj/LaunchScreen.storyboard`
- [App Metadata](https://github.com/rachet-dev/rachebook/blob/main/rachebook/Info.plist): Info.plist · `rachebook/Info.plist`
- [Visual Assets](https://github.com/rachet-dev/rachebook/tree/main/rachebook/Assets.xcassets): asset catalog · Includes the app icon. · `rachebook/Assets.xcassets`
- [Notes List](https://github.com/rachet-dev/rachebook/blob/main/Views/NotesListViewController.swift): view controller · Browse, search, sort, create, select, and delete notes. · `Views/NotesListViewController.swift`
- [Note Editor](https://github.com/rachet-dev/rachebook/blob/main/Views/NoteEditorViewController.swift): view controller · Edits notes and initiates image capture or selection. · `Views/NoteEditorViewController.swift`

### Notes Domain

- [Note](https://github.com/rachet-dev/rachebook/blob/main/Models/Note.swift): domain entity · `Models/Note.swift`
- [Note Store](https://github.com/rachet-dev/rachebook/blob/main/Models/NoteStore.swift): state and persistence · Central boundary for note reads and mutations. · `Models/NoteStore.swift`
- [Yandex Vision Service](https://github.com/rachet-dev/rachebook/blob/main/Models/YandexVisionService.swift): OCR client · Isolates cloud credentials and OCR networking. · `Models/YandexVisionService.swift`

### External Services

- **Camera & Photo Library**: iOS media access
- **Yandex Cloud Vision**: external OCR API

## Connections

- Xcode Project → App Delegate: builds
- App Delegate → Launch Screen: launches with
- App Delegate → App Metadata: reads metadata
- App Delegate → Notes List: starts UI
- Visual Assets → Notes List: supplies visuals
- Notes List → Note Store: lists and mutates
- Notes List → Note Editor: creates or opens
- Note Editor → Note Store: saves edits
- Note Store → Note: stores
- Note Editor → Camera & Photo Library: acquires image
- Note Editor → Yandex Vision Service: sends image for OCR
- Yandex Vision Service → Yandex Cloud Vision: OCR request
- Yandex Vision Service → Note Editor: recognized text
