# rhytam23/note-saver architecture

> Architecture diagram of the GitHub repository rhytam23/note-saver, 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/rhytam23/note-saver
- Repository: https://github.com/rhytam23/note-saver

## Overview

NoteNirman is an offline-first, cross-platform notes and study app. Users authenticate, create and edit notes locally, then synchronize changes in the background; they can also organize and search notes, use study tools, import or export data, and optionally use AI or Telegram. The graph emphasizes the documented live product workflow. The README says block editing, real-time collaboration, and semantic search are dormant, so those subsystems are not presented as active app paths. Some feature relationships are documented rather than verified in sampled implementation excerpts.

Main entry points: [`src/App.tsx`](https://github.com/rhytam23/note-saver/blob/main/src/App.tsx) (App shell), [`src/services/syncEngine.ts`](https://github.com/rhytam23/note-saver/blob/main/src/services/syncEngine.ts) (Background sync), [`src/hooks/useAuth.ts`](https://github.com/rhytam23/note-saver/blob/main/src/hooks/useAuth.ts) (Authentication), [`src/hooks/useNotes.ts`](https://github.com/rhytam23/note-saver/blob/main/src/hooks/useNotes.ts) (Notes workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_auth["Authentication<br/>[useAuth.ts]"]
  node_editor["Note editor<br/>[NoteEditor.tsx]"]
end

subgraph group_notes["Notes and persistence"]
  node_notes_hook["Notes workflow<br/>[useNotes.ts]"]
  node_localdb[("Local note store<br/>[localDb.ts]")]
  node_sync["Background sync<br/>[syncEngine.ts]"]
  node_search["Local search"]
end

subgraph group_platform["Platform and themes"]
  node_platform_factory["Platform adapters"]
  node_platform_interfaces["Platform interfaces"]
  node_seasonal["Seasonal themes"]
end

subgraph group_tools["Study and portability"]
  node_study["Flashcards and notebooks"]
  node_links["Wiki links and graph<br/>[LinkGraphModal.tsx]"]
  node_reminders["Reminders<br/>[reminderEngine.ts]"]
  node_import["Import pipeline<br/>[importPipeline.ts]"]
  node_export["Export pipeline<br/>[exportPipeline.ts]"]
  node_backup["Backup and restore<br/>[backupEngine.ts]"]
end

subgraph group_integrations["Optional integrations"]
  node_supabase[("Cloud auth and database<br/>[supabase.ts]")]
  node_ai["Gemini assistant<br/>[index.ts]"]
  node_telegram["Telegram bot<br/>[index.ts]"]
end

node_user(("App user"))

node_user -->|"uses"| node_app
node_app -->|"authenticates through"| node_auth
node_app -->|"loads notes through"| node_notes_hook
node_app -->|"opens editor"| node_editor
node_auth -->|"uses auth"| node_supabase
node_auth -->|"flushes pending work"| node_sync
node_notes_hook -->|"reads and writes"| node_localdb
node_notes_hook -->|"requests sync"| node_sync
node_sync -->|"queues and persists"| node_localdb
node_sync -->|"syncs remotely"| node_supabase
node_user -->|"searches notes"| node_search
node_app -.->|"selects platform services"| node_platform_factory
node_platform_factory -->|"implements contracts"| node_platform_interfaces
node_app -->|"presents theme"| node_seasonal
node_seasonal -->|"adapts to date and location"| node_user
node_user -->|"reviews and organizes"| node_study
node_user -->|"navigates note links"| node_links
node_app -->|"synchronizes reminders"| node_reminders
node_user -->|"imports content"| node_import
node_import -->|"stores imported notes"| node_localdb
node_user -->|"exports notes"| node_export
node_user -->|"backs up or restores"| node_backup
node_user -->|"optionally requests assistance"| node_ai
node_app -->|"calls through edge function"| node_ai
node_user -->|"optionally manages notes"| node_telegram
node_telegram -->|"accesses shared notes"| node_supabase

click node_app "https://github.com/rhytam23/note-saver/blob/main/src/App.tsx"
click node_auth "https://github.com/rhytam23/note-saver/blob/main/src/hooks/useAuth.ts"
click node_editor "https://github.com/rhytam23/note-saver/blob/main/src/components/NoteEditor.tsx"
click node_notes_hook "https://github.com/rhytam23/note-saver/blob/main/src/hooks/useNotes.ts"
click node_localdb "https://github.com/rhytam23/note-saver/blob/main/src/services/localDb.ts"
click node_sync "https://github.com/rhytam23/note-saver/blob/main/src/services/syncEngine.ts"
click node_supabase "https://github.com/rhytam23/note-saver/blob/main/src/services/supabase.ts"
click node_search "https://github.com/rhytam23/note-saver/blob/main/src/services/localSearchService.ts"
click node_platform_factory "https://github.com/rhytam23/note-saver/blob/main/src/services/platform/platformAdapterFactory.ts"
click node_platform_interfaces "https://github.com/rhytam23/note-saver/blob/main/src/services/platform/platformInterfaces.ts"
click node_seasonal "https://github.com/rhytam23/note-saver/blob/main/src/contexts/SeasonalContext.tsx"
click node_study "https://github.com/rhytam23/note-saver/blob/main/src/components/FlashcardsModal.tsx"
click node_links "https://github.com/rhytam23/note-saver/blob/main/src/components/LinkGraphModal.tsx"
click node_reminders "https://github.com/rhytam23/note-saver/blob/main/src/services/reminderEngine.ts"
click node_import "https://github.com/rhytam23/note-saver/blob/main/src/services/importPipeline.ts"
click node_export "https://github.com/rhytam23/note-saver/blob/main/src/services/exportPipeline.ts"
click node_backup "https://github.com/rhytam23/note-saver/blob/main/src/services/backupEngine.ts"
click node_ai "https://github.com/rhytam23/note-saver/blob/main/supabase/functions/gemini-copilot/index.ts"
click node_telegram "https://github.com/rhytam23/note-saver/blob/main/telegram/bot/index.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_auth,node_editor,node_user toneBlue
class node_notes_hook,node_localdb,node_sync,node_search toneAmber
class node_platform_factory,node_platform_interfaces,node_seasonal toneMint
class node_study,node_links,node_reminders,node_import,node_export,node_backup toneRose
class node_supabase,node_ai,node_telegram toneIndigo
```

## Components

### App and experience

- [App shell](https://github.com/rhytam23/note-saver/blob/main/src/App.tsx): `src/App.tsx`
- [Authentication](https://github.com/rhytam23/note-saver/blob/main/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`
- [Note editor](https://github.com/rhytam23/note-saver/blob/main/src/components/NoteEditor.tsx): `src/components/NoteEditor.tsx`

### Notes and persistence

- [Notes workflow](https://github.com/rhytam23/note-saver/blob/main/src/hooks/useNotes.ts): `src/hooks/useNotes.ts`
- [Local note store](https://github.com/rhytam23/note-saver/blob/main/src/services/localDb.ts): `src/services/localDb.ts`
- [Background sync](https://github.com/rhytam23/note-saver/blob/main/src/services/syncEngine.ts): `src/services/syncEngine.ts`
- [Local search](https://github.com/rhytam23/note-saver/blob/main/src/services/localSearchService.ts): `src/services/localSearchService.ts`

### Platform and themes

- [Platform adapters](https://github.com/rhytam23/note-saver/blob/main/src/services/platform/platformAdapterFactory.ts): `src/services/platform/platformAdapterFactory.ts`
- [Platform interfaces](https://github.com/rhytam23/note-saver/blob/main/src/services/platform/platformInterfaces.ts): `src/services/platform/platformInterfaces.ts`
- [Seasonal themes](https://github.com/rhytam23/note-saver/blob/main/src/contexts/SeasonalContext.tsx): `src/contexts/SeasonalContext.tsx`

### Study and portability

- [Flashcards and notebooks](https://github.com/rhytam23/note-saver/blob/main/src/components/FlashcardsModal.tsx): `src/components/FlashcardsModal.tsx`
- [Wiki links and graph](https://github.com/rhytam23/note-saver/blob/main/src/components/LinkGraphModal.tsx): `src/components/LinkGraphModal.tsx`
- [Reminders](https://github.com/rhytam23/note-saver/blob/main/src/services/reminderEngine.ts): `src/services/reminderEngine.ts`
- [Import pipeline](https://github.com/rhytam23/note-saver/blob/main/src/services/importPipeline.ts): `src/services/importPipeline.ts`
- [Export pipeline](https://github.com/rhytam23/note-saver/blob/main/src/services/exportPipeline.ts): `src/services/exportPipeline.ts`
- [Backup and restore](https://github.com/rhytam23/note-saver/blob/main/src/services/backupEngine.ts): `src/services/backupEngine.ts`

### Optional integrations

- [Cloud auth and database](https://github.com/rhytam23/note-saver/blob/main/src/services/supabase.ts): `src/services/supabase.ts`
- [Gemini assistant](https://github.com/rhytam23/note-saver/blob/main/supabase/functions/gemini-copilot/index.ts): `supabase/functions/gemini-copilot/index.ts`
- [Telegram bot](https://github.com/rhytam23/note-saver/blob/main/telegram/bot/index.ts): `telegram/bot/index.ts`

### Other components

- **App user**

## Connections

- App user → App shell: uses (evidence: `README.md`)
- App shell → Authentication: authenticates through (evidence: `src/App.tsx`)
- App shell → Notes workflow: loads notes through (evidence: `src/App.tsx`)
- App shell → Note editor: opens editor (evidence: `src/App.tsx`)
- Authentication → Cloud auth and database: uses auth (evidence: `src/hooks/useAuth.ts`)
- Authentication → Background sync: flushes pending work (evidence: `src/hooks/useAuth.ts`)
- Notes workflow → Local note store: reads and writes (evidence: `src/hooks/useNotes.ts`)
- Notes workflow → Background sync: requests sync (evidence: `src/hooks/useNotes.ts`)
- Background sync → Local note store: queues and persists (evidence: `src/services/syncEngine.ts`)
- Background sync → Cloud auth and database: syncs remotely (evidence: `src/services/syncEngine.ts`)
- App user → Local search: searches notes (evidence: `README.md`)
- App shell → Platform adapters: selects platform services
- Platform adapters → Platform interfaces: implements contracts (evidence: `src/services/platform/platformAdapterFactory.ts`)
- App shell → Seasonal themes: presents theme (evidence: `src/App.tsx`)
- Seasonal themes → App user: adapts to date and location (evidence: `src/contexts/SeasonalContext.tsx`)
- App user → Flashcards and notebooks: reviews and organizes (evidence: `README.md`)
- App user → Wiki links and graph: navigates note links (evidence: `README.md`)
- App shell → Reminders: synchronizes reminders (evidence: `src/App.tsx`)
- App user → Import pipeline: imports content (evidence: `README.md`)
- Import pipeline → Local note store: stores imported notes (evidence: `src/services/importPipeline.ts`)
- App user → Export pipeline: exports notes (evidence: `README.md`)
- App user → Backup and restore: backs up or restores (evidence: `README.md`)
- App user → Gemini assistant: optionally requests assistance (evidence: `README.md`)
- App shell → Gemini assistant: calls through edge function (evidence: `README.md`)
- App user → Telegram bot: optionally manages notes (evidence: `README.md`)
- Telegram bot → Cloud auth and database: accesses shared notes (evidence: `README.md`)
