# mohaneddz/warraq architecture

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

- Interactive diagram: https://gitdiagram.com/mohaneddz/warraq
- Repository: https://github.com/mohaneddz/warraq

## Overview

Warraq is a desktop library-management system. Staff sign in, then work through catalogue, member, circulation, reservation and inventory workflows; reports, activity, notifications and configurable settings support those operations. The React app routes pages through its application shell, uses shared stores and query providers, and persists library data in Supabase. The README also documents optional metadata providers and native Tauri administration. Several feature modules are unsampled, so their presence is grounded in the README and tree; only explicit or indexed relationships are drawn.

Main entry points: [`src/app/App.tsx`](https://github.com/mohaneddz/warraq/blob/main/src/app/App.tsx) (App routing), [`src/data/supabaseClient.ts`](https://github.com/mohaneddz/warraq/blob/main/src/data/supabaseClient.ts) (Supabase client), [`src/data/repositories/library.ts`](https://github.com/mohaneddz/warraq/blob/main/src/data/repositories/library.ts) (Library repository), [`src/sections/Catalog.tsx`](https://github.com/mohaneddz/warraq/blob/main/src/sections/Catalog.tsx) (Catalogue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop application"]
  node_main["React entry<br/>[main.tsx]"]
  node_app["App routing<br/>[App.tsx]"]
  node_providers["Query providers<br/>[providers.tsx]"]
  node_shell["App shell<br/>[AppShell.tsx]"]
end

subgraph group_workflows["Library workflows"]
  node_auth["Sign-in<br/>[Login.tsx]"]
  node_catalog["Catalogue<br/>[Catalog.tsx]"]
  node_members["Member records<br/>[Members.tsx]"]
  node_loans["Circulation<br/>[Loans.tsx]"]
  node_reservations["Reservations<br/>[Reservations.tsx]"]
  node_inventory["Inventory<br/>[Inventory.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_reports["Reports<br/>[Reports.tsx]"]
  node_activity["Activity log<br/>[Activity.tsx]"]
  node_notifications["Notifications<br/>[Notifications.tsx]"]
  node_settings["Settings<br/>[Settings.tsx]"]
  node_onboarding["Onboarding<br/>[Onboarding.tsx]"]
end

subgraph group_data["Data and services"]
  node_library["Library repository<br/>[library.ts]"]
  node_authdata["Auth service<br/>[auth.ts]"]
  node_settingsstore["Library settings"]
  node_database["Supabase client<br/>[supabaseClient.ts]"]
  node_metadata["Metadata integrations<br/>[metadata.ts]"]
end

subgraph group_native["Native administration"]
  node_rust["Tauri admin<br/>[admin.rs]"]
  node_rustlib["Tauri commands<br/>[lib.rs]"]
end

node_staff(("Library staff"))
node_postgres[("Shared Postgres")]

node_staff -->|"starts app"| node_main
node_main -->|"mounts"| node_app
node_app -->|"wraps"| node_providers
node_app -->|"checks session"| node_authdata
node_app -->|"initializes"| node_database
node_app -->|"routes"| node_auth
node_app -->|"wraps pages"| node_shell
node_app -->|"routes"| node_catalog
node_app -->|"routes"| node_members
node_app -->|"routes"| node_reservations
node_staff -->|"manages titles"| node_catalog
node_staff -->|"manages members"| node_members
node_staff -->|"handles circulation"| node_loans
node_staff -->|"audits shelves"| node_inventory
node_staff -->|"reviews reports"| node_reports
node_staff -->|"reviews activity"| node_activity
node_staff -->|"reviews alerts"| node_notifications
node_staff -->|"configures library"| node_settings
node_staff -->|"sets up"| node_onboarding
node_catalog -->|"saves titles"| node_library
node_reservations -->|"updates holds"| node_library
node_shell -->|"loads dashboard"| node_library
node_shell -->|"logs out"| node_authdata
node_library -->|"queries"| node_database
node_authdata -->|"authenticates"| node_database
node_settingsstore -->|"loads settings"| node_database
node_database -->|"reads and writes"| node_postgres
node_database -->|"sweeps reservations"| node_library
node_catalog -->|"enriches records"| node_metadata
node_authdata -->|"invokes admin"| node_rustlib
node_rustlib -->|"dispatches commands"| node_rust
node_rust -->|"administers accounts"| node_postgres
node_metadata -.->|"optional providers"| node_postgres

click node_main "https://github.com/mohaneddz/warraq/blob/main/src/main.tsx"
click node_app "https://github.com/mohaneddz/warraq/blob/main/src/app/App.tsx"
click node_providers "https://github.com/mohaneddz/warraq/blob/main/src/app/providers.tsx"
click node_shell "https://github.com/mohaneddz/warraq/blob/main/src/components/layout/AppShell.tsx"
click node_auth "https://github.com/mohaneddz/warraq/blob/main/src/sections/Login.tsx"
click node_catalog "https://github.com/mohaneddz/warraq/blob/main/src/sections/Catalog.tsx"
click node_members "https://github.com/mohaneddz/warraq/blob/main/src/sections/Members.tsx"
click node_loans "https://github.com/mohaneddz/warraq/blob/main/src/sections/Loans.tsx"
click node_reservations "https://github.com/mohaneddz/warraq/blob/main/src/sections/Reservations.tsx"
click node_inventory "https://github.com/mohaneddz/warraq/blob/main/src/sections/Inventory.tsx"
click node_dashboard "https://github.com/mohaneddz/warraq/blob/main/src/sections/Dashboard.tsx"
click node_reports "https://github.com/mohaneddz/warraq/blob/main/src/sections/Reports.tsx"
click node_activity "https://github.com/mohaneddz/warraq/blob/main/src/sections/Activity.tsx"
click node_notifications "https://github.com/mohaneddz/warraq/blob/main/src/sections/Notifications.tsx"
click node_settings "https://github.com/mohaneddz/warraq/blob/main/src/sections/Settings.tsx"
click node_onboarding "https://github.com/mohaneddz/warraq/blob/main/src/sections/Onboarding.tsx"
click node_library "https://github.com/mohaneddz/warraq/blob/main/src/data/repositories/library.ts"
click node_authdata "https://github.com/mohaneddz/warraq/blob/main/src/data/auth.ts"
click node_settingsstore "https://github.com/mohaneddz/warraq/blob/main/src/store/librarySettingsStore.ts"
click node_database "https://github.com/mohaneddz/warraq/blob/main/src/data/supabaseClient.ts"
click node_metadata "https://github.com/mohaneddz/warraq/blob/main/src/utils/metadata.ts"
click node_rust "https://github.com/mohaneddz/warraq/blob/main/src-tauri/src/admin.rs"
click node_rustlib "https://github.com/mohaneddz/warraq/blob/main/src-tauri/src/lib.rs"

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_main,node_app,node_providers,node_shell toneBlue
class node_auth,node_catalog,node_members,node_loans,node_reservations,node_inventory,node_dashboard,node_reports,node_activity,node_notifications,node_settings,node_onboarding,node_postgres toneAmber
class node_library,node_authdata,node_settingsstore,node_database,node_metadata toneMint
class node_rust,node_rustlib toneRose
class node_staff toneIndigo
```

## Components

### Desktop application

- [React entry](https://github.com/mohaneddz/warraq/blob/main/src/main.tsx): `src/main.tsx`
- [App routing](https://github.com/mohaneddz/warraq/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [Query providers](https://github.com/mohaneddz/warraq/blob/main/src/app/providers.tsx): `src/app/providers.tsx`
- [App shell](https://github.com/mohaneddz/warraq/blob/main/src/components/layout/AppShell.tsx): `src/components/layout/AppShell.tsx`

### Library workflows

- [Sign-in](https://github.com/mohaneddz/warraq/blob/main/src/sections/Login.tsx): `src/sections/Login.tsx`
- [Catalogue](https://github.com/mohaneddz/warraq/blob/main/src/sections/Catalog.tsx): `src/sections/Catalog.tsx`
- [Member records](https://github.com/mohaneddz/warraq/blob/main/src/sections/Members.tsx): `src/sections/Members.tsx`
- [Circulation](https://github.com/mohaneddz/warraq/blob/main/src/sections/Loans.tsx): `src/sections/Loans.tsx`
- [Reservations](https://github.com/mohaneddz/warraq/blob/main/src/sections/Reservations.tsx): `src/sections/Reservations.tsx`
- [Inventory](https://github.com/mohaneddz/warraq/blob/main/src/sections/Inventory.tsx): `src/sections/Inventory.tsx`
- [Dashboard](https://github.com/mohaneddz/warraq/blob/main/src/sections/Dashboard.tsx): `src/sections/Dashboard.tsx`
- [Reports](https://github.com/mohaneddz/warraq/blob/main/src/sections/Reports.tsx): `src/sections/Reports.tsx`
- [Activity log](https://github.com/mohaneddz/warraq/blob/main/src/sections/Activity.tsx): `src/sections/Activity.tsx`
- [Notifications](https://github.com/mohaneddz/warraq/blob/main/src/sections/Notifications.tsx): `src/sections/Notifications.tsx`
- [Settings](https://github.com/mohaneddz/warraq/blob/main/src/sections/Settings.tsx): `src/sections/Settings.tsx`
- [Onboarding](https://github.com/mohaneddz/warraq/blob/main/src/sections/Onboarding.tsx): `src/sections/Onboarding.tsx`

### Data and services

- [Library repository](https://github.com/mohaneddz/warraq/blob/main/src/data/repositories/library.ts): `src/data/repositories/library.ts`
- [Auth service](https://github.com/mohaneddz/warraq/blob/main/src/data/auth.ts): `src/data/auth.ts`
- [Library settings](https://github.com/mohaneddz/warraq/blob/main/src/store/librarySettingsStore.ts): `src/store/librarySettingsStore.ts`
- [Supabase client](https://github.com/mohaneddz/warraq/blob/main/src/data/supabaseClient.ts): `src/data/supabaseClient.ts`
- [Metadata integrations](https://github.com/mohaneddz/warraq/blob/main/src/utils/metadata.ts): `src/utils/metadata.ts`

### Native administration

- [Tauri admin](https://github.com/mohaneddz/warraq/blob/main/src-tauri/src/admin.rs): `src-tauri/src/admin.rs`
- [Tauri commands](https://github.com/mohaneddz/warraq/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`

### Other components

- **Library staff**
- **Shared Postgres**

## Connections

- Library staff → React entry: starts app
- React entry → App routing: mounts (evidence: `src/main.tsx`)
- App routing → Query providers: wraps (evidence: `src/app/App.tsx`)
- App routing → Auth service: checks session (evidence: `src/app/App.tsx`)
- App routing → Supabase client: initializes (evidence: `src/app/App.tsx`)
- App routing → Sign-in: routes (evidence: `src/app/App.tsx`)
- App routing → App shell: wraps pages (evidence: `src/app/App.tsx`)
- App routing → Catalogue: routes (evidence: `src/app/App.tsx`)
- App routing → Member records: routes (evidence: `src/app/App.tsx`)
- App routing → Reservations: routes (evidence: `src/app/App.tsx`)
- Library staff → Catalogue: manages titles
- Library staff → Member records: manages members
- Library staff → Circulation: handles circulation
- Library staff → Inventory: audits shelves
- Library staff → Reports: reviews reports
- Library staff → Activity log: reviews activity
- Library staff → Notifications: reviews alerts
- Library staff → Settings: configures library
- Library staff → Onboarding: sets up
- Catalogue → Library repository: saves titles (evidence: `src/sections/Catalog.tsx`)
- Reservations → Library repository: updates holds (evidence: `src/sections/Reservations.tsx`)
- App shell → Library repository: loads dashboard (evidence: `src/components/layout/AppShell.tsx`)
- App shell → Auth service: logs out (evidence: `src/components/layout/AppShell.tsx`)
- Library repository → Supabase client: queries (evidence: `src/data/repositories/library.ts`)
- Auth service → Supabase client: authenticates (evidence: `src/data/auth.ts`)
- Library settings → Supabase client: loads settings (evidence: `src/store/librarySettingsStore.ts`)
- Supabase client → Shared Postgres: reads and writes (evidence: `src/data/supabaseClient.ts`)
- Supabase client → Library repository: sweeps reservations (evidence: `src/data/database.ts`)
- Catalogue → Metadata integrations: enriches records (evidence: `src/sections/Catalog.tsx`)
- Auth service → Tauri commands: invokes admin (evidence: `src/data/auth.ts`)
- Tauri commands → Tauri admin: dispatches commands (evidence: `src-tauri/src/lib.rs`)
- Tauri admin → Shared Postgres: administers accounts
- Metadata integrations → Shared Postgres: optional providers
