# abdulrahman-25dev/note-app architecture

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

- Interactive diagram: https://gitdiagram.com/abdulrahman-25dev/note-app
- Repository: https://github.com/abdulrahman-25dev/note-app

## Overview

This is an Expo/React Native notes app. The principal flow loads notes on the home screen, filters and presents them, and lets users add, edit, favorite, trash, or restore notes through the notes store, which persists locally and synchronizes with Supabase when available. Separate flows cover authentication and profile management, plus appearance and language settings. The graph preserves these documented-by-source-index branches; unsampled screens are represented at their exact paths, and edges reflect only shown calls or indexed references.

Main entry points: [`store/useNotesStore.ts`](https://github.com/abdulrahman-25dev/note-app/blob/main/store/useNotesStore.ts) (Notes state), [`app/settings.tsx`](https://github.com/abdulrahman-25dev/note-app/blob/main/app/settings.tsx) (Settings), [`supabase.ts`](https://github.com/abdulrahman-25dev/note-app/blob/main/supabase.ts) (Supabase), [`app/index.tsx`](https://github.com/abdulrahman-25dev/note-app/blob/main/app/index.tsx) (Notes home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_home["Notes home<br/>[index.tsx]"]
  node_noteedit["Add and edit notes<br/>[Add.tsx]"]
  node_notedetail["Note detail<br/>[&#91;id&#93;.tsx]"]
  node_favorites["Favorites<br/>[favorites.tsx]"]
  node_trash["Trash and restore<br/>[TrashPin.tsx]"]
  node_settings["Settings<br/>[settings.tsx]"]
  node_shell["App shell<br/>[_layout.tsx]"]
end

subgraph group_identity["Identity and profile"]
  node_login["Login<br/>[Login.tsx]"]
  node_signup["Signup<br/>[Signup.tsx]"]
  node_profileedit["Edit profile<br/>[EditProfile.tsx]"]
  node_profileops["Profile service<br/>[profileService.ts]"]
  node_authstate["Auth state<br/>[useAuthStore.ts]"]
end

subgraph group_notes["Notes domain"]
  node_notestate["Notes state<br/>[useNotesStore.ts]"]
  node_pending["Offline queue<br/>[pendingQueue.ts]"]
end

subgraph group_platform["State and services"]
  node_backend[("Supabase<br/>[supabase.ts]")]
  node_theme["Theme and language state<br/>[useThemeStore.tsx]"]
  node_translations["Translations<br/>[i18n.tsx]"]
  node_alerts["Alert state<br/>[useAlertStore.ts]"]
  node_drawer["Navigation drawer<br/>[DrawerMenu.tsx]"]
  node_modal["Shared modal<br/>[sharedModal.tsx]"]
  node_alertui["Alert UI<br/>[CustomAlert.tsx]"]
  node_colors["Color palette<br/>[Colors.tsx]"]
end

node_user(("User"))

node_user -->|"opens"| node_home
node_home -->|"fetches notes"| node_notestate
node_user -->|"creates notes"| node_noteedit
node_noteedit -->|"updates"| node_notestate
node_notedetail -->|"reads and updates"| node_notestate
node_favorites -->|"reads favorites"| node_notestate
node_trash -->|"manages deleted notes"| node_notestate
node_settings -->|"refreshes profile"| node_profileops
node_settings -->|"reads auth state"| node_authstate
node_settings -->|"manages notes"| node_notestate
node_settings -->|"uses service"| node_backend
node_settings -->|"renders"| node_drawer
node_settings -->|"renders"| node_modal
node_login -->|"authenticates"| node_backend
node_login -->|"loads profile"| node_profileops
node_login -->|"updates auth state"| node_authstate
node_signup -->|"creates account"| node_backend
node_signup -->|"reports outcomes"| node_alerts
node_profileedit -->|"updates profile"| node_profileops
node_profileops -->|"reads and writes"| node_backend
node_authstate -->|"verifies session"| node_backend
node_notestate -->|"syncs notes"| node_backend
node_notestate -->|"queues offline adds"| node_pending
node_notestate -->|"reads session"| node_authstate
node_pending -->|"flushes operations"| node_backend
node_shell -->|"initializes"| node_translations
node_shell -->|"renders"| node_alertui
node_alertui -->|"reads alert state"| node_alerts
node_alertui -->|"uses"| node_modal
node_home -->|"renders"| node_drawer
node_home -->|"uses"| node_modal
node_home -->|"uses"| node_alerts
node_theme -->|"sets language"| node_translations

click node_home "https://github.com/abdulrahman-25dev/note-app/blob/main/app/index.tsx"
click node_noteedit "https://github.com/abdulrahman-25dev/note-app/blob/main/app/Notes/Add.tsx"
click node_notedetail "https://github.com/abdulrahman-25dev/note-app/blob/main/app/Notes/%5Bid%5D.tsx"
click node_favorites "https://github.com/abdulrahman-25dev/note-app/blob/main/app/favorites.tsx"
click node_trash "https://github.com/abdulrahman-25dev/note-app/blob/main/app/TrashPin.tsx"
click node_settings "https://github.com/abdulrahman-25dev/note-app/blob/main/app/settings.tsx"
click node_shell "https://github.com/abdulrahman-25dev/note-app/blob/main/app/_layout.tsx"
click node_login "https://github.com/abdulrahman-25dev/note-app/blob/main/app/Auth/Login.tsx"
click node_signup "https://github.com/abdulrahman-25dev/note-app/blob/main/app/Auth/Signup.tsx"
click node_profileedit "https://github.com/abdulrahman-25dev/note-app/blob/main/app/EditProfile.tsx"
click node_profileops "https://github.com/abdulrahman-25dev/note-app/blob/main/profileService.ts"
click node_authstate "https://github.com/abdulrahman-25dev/note-app/blob/main/store/useAuthStore.ts"
click node_notestate "https://github.com/abdulrahman-25dev/note-app/blob/main/store/useNotesStore.ts"
click node_pending "https://github.com/abdulrahman-25dev/note-app/blob/main/store/pendingQueue.ts"
click node_backend "https://github.com/abdulrahman-25dev/note-app/blob/main/supabase.ts"
click node_theme "https://github.com/abdulrahman-25dev/note-app/blob/main/store/useThemeStore.tsx"
click node_translations "https://github.com/abdulrahman-25dev/note-app/blob/main/i18n/i18n.tsx"
click node_alerts "https://github.com/abdulrahman-25dev/note-app/blob/main/store/useAlertStore.ts"
click node_drawer "https://github.com/abdulrahman-25dev/note-app/blob/main/components/DrawerMenu.tsx"
click node_modal "https://github.com/abdulrahman-25dev/note-app/blob/main/components/sharedModal.tsx"
click node_alertui "https://github.com/abdulrahman-25dev/note-app/blob/main/components/CustomAlert.tsx"
click node_colors "https://github.com/abdulrahman-25dev/note-app/blob/main/Constants/Colors.tsx"

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_home,node_noteedit,node_notedetail,node_favorites,node_trash,node_settings,node_shell,node_user toneBlue
class node_login,node_signup,node_profileedit,node_profileops,node_authstate toneAmber
class node_notestate,node_pending toneMint
class node_backend,node_theme,node_translations,node_alerts,node_drawer,node_modal,node_alertui,node_colors toneRose
```

## Components

### App experience

- [Notes home](https://github.com/abdulrahman-25dev/note-app/blob/main/app/index.tsx): `app/index.tsx`
- [Add and edit notes](https://github.com/abdulrahman-25dev/note-app/blob/main/app/Notes/Add.tsx): `app/Notes/Add.tsx`
- [Note detail](https://github.com/abdulrahman-25dev/note-app/blob/main/app/Notes/%5Bid%5D.tsx): `app/Notes/[id].tsx`
- [Favorites](https://github.com/abdulrahman-25dev/note-app/blob/main/app/favorites.tsx): `app/favorites.tsx`
- [Trash and restore](https://github.com/abdulrahman-25dev/note-app/blob/main/app/TrashPin.tsx): `app/TrashPin.tsx`
- [Settings](https://github.com/abdulrahman-25dev/note-app/blob/main/app/settings.tsx): `app/settings.tsx`
- [App shell](https://github.com/abdulrahman-25dev/note-app/blob/main/app/_layout.tsx): `app/_layout.tsx`

### Identity and profile

- [Login](https://github.com/abdulrahman-25dev/note-app/blob/main/app/Auth/Login.tsx): `app/Auth/Login.tsx`
- [Signup](https://github.com/abdulrahman-25dev/note-app/blob/main/app/Auth/Signup.tsx): `app/Auth/Signup.tsx`
- [Edit profile](https://github.com/abdulrahman-25dev/note-app/blob/main/app/EditProfile.tsx): `app/EditProfile.tsx`
- [Profile service](https://github.com/abdulrahman-25dev/note-app/blob/main/profileService.ts): `profileService.ts`
- [Auth state](https://github.com/abdulrahman-25dev/note-app/blob/main/store/useAuthStore.ts): `store/useAuthStore.ts`

### Notes domain

- [Notes state](https://github.com/abdulrahman-25dev/note-app/blob/main/store/useNotesStore.ts): `store/useNotesStore.ts`
- [Offline queue](https://github.com/abdulrahman-25dev/note-app/blob/main/store/pendingQueue.ts): `store/pendingQueue.ts`

### State and services

- [Supabase](https://github.com/abdulrahman-25dev/note-app/blob/main/supabase.ts): `supabase.ts`
- [Theme and language state](https://github.com/abdulrahman-25dev/note-app/blob/main/store/useThemeStore.tsx): `store/useThemeStore.tsx`
- [Translations](https://github.com/abdulrahman-25dev/note-app/blob/main/i18n/i18n.tsx): `i18n/i18n.tsx`
- [Alert state](https://github.com/abdulrahman-25dev/note-app/blob/main/store/useAlertStore.ts): `store/useAlertStore.ts`
- [Navigation drawer](https://github.com/abdulrahman-25dev/note-app/blob/main/components/DrawerMenu.tsx): `components/DrawerMenu.tsx`
- [Shared modal](https://github.com/abdulrahman-25dev/note-app/blob/main/components/sharedModal.tsx): `components/sharedModal.tsx`
- [Alert UI](https://github.com/abdulrahman-25dev/note-app/blob/main/components/CustomAlert.tsx): `components/CustomAlert.tsx`
- [Color palette](https://github.com/abdulrahman-25dev/note-app/blob/main/Constants/Colors.tsx): `Constants/Colors.tsx`

### Other components

- **User**

## Connections

- User → Notes home: opens
- Notes home → Notes state: fetches notes (evidence: `app/index.tsx`)
- User → Add and edit notes: creates notes
- Add and edit notes → Notes state: updates (evidence: `store/useNotesStore.ts`)
- Note detail → Notes state: reads and updates (evidence: `store/useNotesStore.ts`)
- Favorites → Notes state: reads favorites (evidence: `app/favorites.tsx`)
- Trash and restore → Notes state: manages deleted notes (evidence: `app/TrashPin.tsx`)
- Settings → Profile service: refreshes profile (evidence: `app/settings.tsx`)
- Settings → Auth state: reads auth state (evidence: `app/settings.tsx`)
- Settings → Notes state: manages notes (evidence: `app/settings.tsx`)
- Settings → Supabase: uses service (evidence: `app/settings.tsx`)
- Settings → Navigation drawer: renders (evidence: `app/settings.tsx`)
- Settings → Shared modal: renders (evidence: `app/settings.tsx`)
- Login → Supabase: authenticates (evidence: `app/Auth/Login.tsx`)
- Login → Profile service: loads profile (evidence: `app/Auth/Login.tsx`)
- Login → Auth state: updates auth state (evidence: `app/Auth/Login.tsx`)
- Signup → Supabase: creates account (evidence: `app/Auth/Signup.tsx`)
- Signup → Alert state: reports outcomes (evidence: `app/Auth/Signup.tsx`)
- Edit profile → Profile service: updates profile (evidence: `app/EditProfile.tsx`)
- Profile service → Supabase: reads and writes (evidence: `profileService.ts`)
- Auth state → Supabase: verifies session (evidence: `store/useAuthStore.ts`)
- Notes state → Supabase: syncs notes (evidence: `store/useNotesStore.ts`)
- Notes state → Offline queue: queues offline adds (evidence: `store/useNotesStore.ts`)
- Notes state → Auth state: reads session (evidence: `store/useNotesStore.ts`)
- Offline queue → Supabase: flushes operations (evidence: `store/pendingQueue.ts`)
- App shell → Translations: initializes (evidence: `app/_layout.tsx`)
- App shell → Alert UI: renders (evidence: `app/_layout.tsx`)
- Alert UI → Alert state: reads alert state (evidence: `components/CustomAlert.tsx`)
- Alert UI → Shared modal: uses (evidence: `components/CustomAlert.tsx`)
- Notes home → Navigation drawer: renders (evidence: `app/index.tsx`)
- Notes home → Shared modal: uses (evidence: `app/index.tsx`)
- Notes home → Alert state: uses (evidence: `app/index.tsx`)
- Theme and language state → Translations: sets language (evidence: `store/useThemeStore.tsx`)
