# sarojbaraal/baraltree architecture

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

- Interactive diagram: https://gitdiagram.com/sarojbaraal/baraltree
- Repository: https://github.com/sarojbaraal/baraltree

## Overview

Vanshavali is a Nepali-language family-tree web app. Users sign in, browse and search family relationships, inspect or edit people, and can export family data or images; administrative controls support request review and role/position management. These responsibilities are implemented in one large app.js file, so the nodes represent logical capabilities rather than separate modules. Supabase provides remote data and authentication, while sw.js caches the app shell for offline use. Excerpts are partial, so internal links are limited to relationships shown directly.

Main entry points: [`app.js`](https://github.com/sarojbaraal/baraltree/blob/main/app.js) (Vanshavali App), [`index.html`](https://github.com/sarojbaraal/baraltree/blob/main/index.html) (App Shell), [`sw.js`](https://github.com/sarojbaraal/baraltree/blob/main/sw.js) (Offline Cache)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access"]
  node_auth["Sign In<br/>[app.js]"]
end

subgraph group_genealogy["Family Tree"]
  node_tree["Family Tree View<br/>[app.js]"]
  node_search["Family Search<br/>[app.js]"]
  node_directory["Family Directory<br/>[app.js]"]
end

subgraph group_management["People Management"]
  node_person_detail["Person Details<br/>[app.js]"]
  node_person_edit["Person Editing<br/>[app.js]"]
  node_data_exchange["Import and Export<br/>[app.js]"]
  node_admin["Request and Role Admin<br/>[app.js]"]
end

subgraph group_delivery["App Delivery"]
  node_app_shell["App Shell<br/>[index.html]"]
  node_application["Vanshavali App<br/>[app.js]"]
  node_offline["Offline Cache<br/>[sw.js]"]
end

node_user(("User"))
node_supabase[("Supabase")]

node_user -->|"opens"| node_app_shell
node_app_shell -->|"loads"| node_application
node_application -->|"provides"| node_auth
node_auth -->|"authenticates"| node_supabase
node_application -->|"reads and writes"| node_supabase
node_user -->|"browses"| node_tree
node_user -->|"searches"| node_search
node_search -->|"selects person"| node_tree
node_user -->|"browses"| node_directory
node_user -->|"opens"| node_person_detail
node_user -->|"edits"| node_person_edit
node_user -->|"imports or exports"| node_data_exchange
node_user -->|"manages"| node_admin
node_offline -->|"caches shell"| node_app_shell
node_offline -->|"caches app"| node_application

click node_app_shell "https://github.com/sarojbaraal/baraltree/blob/main/index.html"
click node_application "https://github.com/sarojbaraal/baraltree/blob/main/app.js"
click node_auth "https://github.com/sarojbaraal/baraltree/blob/main/app.js"
click node_tree "https://github.com/sarojbaraal/baraltree/blob/main/app.js"
click node_search "https://github.com/sarojbaraal/baraltree/blob/main/app.js"
click node_directory "https://github.com/sarojbaraal/baraltree/blob/main/app.js"
click node_person_detail "https://github.com/sarojbaraal/baraltree/blob/main/app.js"
click node_person_edit "https://github.com/sarojbaraal/baraltree/blob/main/app.js"
click node_data_exchange "https://github.com/sarojbaraal/baraltree/blob/main/app.js"
click node_admin "https://github.com/sarojbaraal/baraltree/blob/main/app.js"
click node_offline "https://github.com/sarojbaraal/baraltree/blob/main/sw.js"

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_auth,node_user toneBlue
class node_tree,node_search,node_directory,node_supabase toneAmber
class node_person_detail,node_person_edit,node_data_exchange,node_admin toneMint
class node_app_shell,node_application,node_offline toneRose
```

## Components

### Access

- [Sign In](https://github.com/sarojbaraal/baraltree/blob/main/app.js): `app.js`

### Family Tree

- [Family Tree View](https://github.com/sarojbaraal/baraltree/blob/main/app.js): `app.js`
- [Family Search](https://github.com/sarojbaraal/baraltree/blob/main/app.js): `app.js`
- [Family Directory](https://github.com/sarojbaraal/baraltree/blob/main/app.js): `app.js`

### People Management

- [Person Details](https://github.com/sarojbaraal/baraltree/blob/main/app.js): `app.js`
- [Person Editing](https://github.com/sarojbaraal/baraltree/blob/main/app.js): `app.js`
- [Import and Export](https://github.com/sarojbaraal/baraltree/blob/main/app.js): `app.js`
- [Request and Role Admin](https://github.com/sarojbaraal/baraltree/blob/main/app.js): `app.js`

### App Delivery

- [App Shell](https://github.com/sarojbaraal/baraltree/blob/main/index.html): `index.html`
- [Vanshavali App](https://github.com/sarojbaraal/baraltree/blob/main/app.js): `app.js`
- [Offline Cache](https://github.com/sarojbaraal/baraltree/blob/main/sw.js): `sw.js`

### Other components

- **User**
- **Supabase**

## Connections

- User → App Shell: opens
- App Shell → Vanshavali App: loads
- Vanshavali App → Sign In: provides (evidence: `app.js`)
- Sign In → Supabase: authenticates (evidence: `app.js`)
- Vanshavali App → Supabase: reads and writes (evidence: `app.js`)
- User → Family Tree View: browses (evidence: `app.js`)
- User → Family Search: searches (evidence: `app.js`)
- Family Search → Family Tree View: selects person (evidence: `app.js`)
- User → Family Directory: browses (evidence: `app.js`)
- User → Person Details: opens (evidence: `app.js`)
- User → Person Editing: edits (evidence: `app.js`)
- User → Import and Export: imports or exports (evidence: `app.js`)
- User → Request and Role Admin: manages (evidence: `app.js`)
- Offline Cache → App Shell: caches shell (evidence: `sw.js`)
- Offline Cache → Vanshavali App: caches app (evidence: `sw.js`)
