# iyadeh/vaultshare architecture

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

- Interactive diagram: https://gitdiagram.com/iyadeh/vaultshare
- Repository: https://github.com/iyadeh/vaultshare

## Overview

VaultShare is a multi-tenant file-storage and controlled-link sharing application. Owners authenticate, upload and manage files, configure share protections, and review link status and access activity; recipients open public share links to access files. The README documents password protection, download limits, expiration, audit logs, and PostgreSQL RLS. The tree and sampled excerpts support the main UI, auth, and file-management boundaries; unsampled share, audit, and settings internals are represented at their existing enclosing paths, with uncertain implementation wiring omitted.

Main entry points: [`src/lib/supabase/server.ts`](https://github.com/iyadeh/vaultshare/blob/main/src/lib/supabase/server.ts) (Server client), [`src/components/files/files-view.tsx`](https://github.com/iyadeh/vaultshare/blob/main/src/components/files/files-view.tsx) (File management), [`src/app/auth/callback/route.ts`](https://github.com/iyadeh/vaultshare/blob/main/src/app/auth/callback/route.ts) (Auth callback), [`src/app/s/[token]/page.tsx`](https://github.com/iyadeh/vaultshare/blob/main/src/app/s/%5Btoken%5D/page.tsx) (Public share route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and access"]
  node_login["Sign in<br/>[page.tsx]"]
  node_register["Register<br/>[page.tsx]"]
  node_auth_callback["Auth callback<br/>[route.ts]"]
  node_session_proxy["Session routing<br/>[proxy.ts]"]
  node_supabase_proxy["Session refresh<br/>[proxy.ts]"]
end

subgraph group_owner["Owner workspace"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_dashboard_ui["Dashboard views"]
  node_files_page["File workspace<br/>[page.tsx]"]
  node_files_ui["File management<br/>[files-view.tsx]"]
  node_get_files["List files<br/>[get-files.ts]"]
  node_upload_file["Upload file<br/>[upload-file.ts]"]
  node_delete_file["Delete file<br/>[delete-file.ts]"]
  node_activity["Access activity<br/>[page.tsx]"]
  node_activity_ui["Activity views<br/>[activity-view.tsx]"]
  node_settings["Owner settings<br/>[page.tsx]"]
  node_settings_ui["Settings views<br/>[settings-view.tsx]"]
end

subgraph group_sharing["Controlled sharing"]
  node_shares_page["Share management<br/>[page.tsx]"]
  node_shares_ui["Share links view<br/>[shares-view.tsx]"]
  node_public_share["Public share route<br/>[page.tsx]"]
  node_public_share_ui["Recipient experience"]
end

subgraph group_platform["Supabase services"]
  node_browser_client["Browser client<br/>[client.ts]"]
  node_server_client["Server client<br/>[server.ts]"]
  node_supabase_auth["Supabase Auth"]
  node_supabase_storage["Supabase Storage"]
  node_postgres[("PostgreSQL RLS")]
end

node_owner_actor(("File owner"))
node_recipient_actor(("Link recipient"))

node_owner_actor -->|"signs in"| node_login
node_owner_actor -->|"registers"| node_register
node_login -->|"creates client"| node_browser_client
node_register -->|"creates client"| node_browser_client
node_browser_client -->|"authenticates"| node_supabase_auth
node_supabase_auth -->|"redirects"| node_auth_callback
node_auth_callback -->|"creates client"| node_server_client
node_auth_callback -->|"exchanges code"| node_supabase_auth
node_session_proxy -->|"refreshes session"| node_supabase_proxy
node_supabase_proxy -->|"validates session"| node_supabase_auth
node_owner_actor -->|"opens workspace"| node_dashboard
node_dashboard -->|"renders"| node_dashboard_ui
node_owner_actor -->|"manages files"| node_files_page
node_files_page -->|"renders"| node_files_ui
node_files_ui -->|"loads files"| node_get_files
node_files_ui -->|"deletes file"| node_delete_file
node_files_ui -->|"uploads file"| node_upload_file
node_get_files -->|"queries as user"| node_server_client
node_delete_file -->|"deletes as user"| node_server_client
node_upload_file -->|"stores as user"| node_server_client
node_server_client -->|"reads and writes"| node_postgres
node_server_client -->|"transfers files"| node_supabase_storage
node_owner_actor -->|"manages links"| node_shares_page
node_shares_page -->|"renders"| node_shares_ui
node_owner_actor -->|"reviews access"| node_activity
node_activity -->|"renders"| node_activity_ui
node_owner_actor -->|"updates preferences"| node_settings
node_settings -->|"renders"| node_settings_ui
node_recipient_actor -->|"opens link"| node_public_share
node_public_share -->|"renders"| node_public_share_ui
node_public_share -->|"loads share"| node_server_client
node_server_client -->|"enforces RLS"| node_postgres

click node_login "https://github.com/iyadeh/vaultshare/blob/main/src/app/login/page.tsx"
click node_register "https://github.com/iyadeh/vaultshare/blob/main/src/app/register/page.tsx"
click node_auth_callback "https://github.com/iyadeh/vaultshare/blob/main/src/app/auth/callback/route.ts"
click node_session_proxy "https://github.com/iyadeh/vaultshare/blob/main/src/proxy.ts"
click node_supabase_proxy "https://github.com/iyadeh/vaultshare/blob/main/src/lib/supabase/proxy.ts"
click node_browser_client "https://github.com/iyadeh/vaultshare/blob/main/src/lib/supabase/client.ts"
click node_server_client "https://github.com/iyadeh/vaultshare/blob/main/src/lib/supabase/server.ts"
click node_dashboard "https://github.com/iyadeh/vaultshare/blob/main/src/app/dashboard/page.tsx"
click node_dashboard_ui "https://github.com/iyadeh/vaultshare/tree/main/src/components/dashboard"
click node_files_page "https://github.com/iyadeh/vaultshare/blob/main/src/app/files/page.tsx"
click node_files_ui "https://github.com/iyadeh/vaultshare/blob/main/src/components/files/files-view.tsx"
click node_get_files "https://github.com/iyadeh/vaultshare/blob/main/src/lib/files/get-files.ts"
click node_upload_file "https://github.com/iyadeh/vaultshare/blob/main/src/lib/files/upload-file.ts"
click node_delete_file "https://github.com/iyadeh/vaultshare/blob/main/src/lib/files/delete-file.ts"
click node_shares_page "https://github.com/iyadeh/vaultshare/blob/main/src/app/shares/page.tsx"
click node_shares_ui "https://github.com/iyadeh/vaultshare/blob/main/src/components/shares/shares-view.tsx"
click node_public_share "https://github.com/iyadeh/vaultshare/blob/main/src/app/s/%5Btoken%5D/page.tsx"
click node_public_share_ui "https://github.com/iyadeh/vaultshare/blob/main/src/components/public-share/public-share-view.tsx"
click node_activity "https://github.com/iyadeh/vaultshare/blob/main/src/app/activity/page.tsx"
click node_activity_ui "https://github.com/iyadeh/vaultshare/blob/main/src/components/activity/activity-view.tsx"
click node_settings "https://github.com/iyadeh/vaultshare/blob/main/src/app/settings/page.tsx"
click node_settings_ui "https://github.com/iyadeh/vaultshare/blob/main/src/components/settings/settings-view.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_login,node_register,node_auth_callback,node_session_proxy,node_supabase_proxy toneBlue
class node_dashboard,node_dashboard_ui,node_files_page,node_files_ui,node_get_files,node_upload_file,node_delete_file,node_activity,node_activity_ui,node_settings,node_settings_ui toneAmber
class node_shares_page,node_shares_ui,node_public_share,node_public_share_ui toneMint
class node_browser_client,node_server_client,node_supabase_auth,node_supabase_storage,node_postgres toneRose
class node_owner_actor,node_recipient_actor toneIndigo
```

## Components

### Identity and access

- [Sign in](https://github.com/iyadeh/vaultshare/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Register](https://github.com/iyadeh/vaultshare/blob/main/src/app/register/page.tsx): `src/app/register/page.tsx`
- [Auth callback](https://github.com/iyadeh/vaultshare/blob/main/src/app/auth/callback/route.ts): `src/app/auth/callback/route.ts`
- [Session routing](https://github.com/iyadeh/vaultshare/blob/main/src/proxy.ts): `src/proxy.ts`
- [Session refresh](https://github.com/iyadeh/vaultshare/blob/main/src/lib/supabase/proxy.ts): `src/lib/supabase/proxy.ts`

### Owner workspace

- [Dashboard](https://github.com/iyadeh/vaultshare/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Dashboard views](https://github.com/iyadeh/vaultshare/tree/main/src/components/dashboard): `src/components/dashboard`
- [File workspace](https://github.com/iyadeh/vaultshare/blob/main/src/app/files/page.tsx): `src/app/files/page.tsx`
- [File management](https://github.com/iyadeh/vaultshare/blob/main/src/components/files/files-view.tsx): `src/components/files/files-view.tsx`
- [List files](https://github.com/iyadeh/vaultshare/blob/main/src/lib/files/get-files.ts): `src/lib/files/get-files.ts`
- [Upload file](https://github.com/iyadeh/vaultshare/blob/main/src/lib/files/upload-file.ts): `src/lib/files/upload-file.ts`
- [Delete file](https://github.com/iyadeh/vaultshare/blob/main/src/lib/files/delete-file.ts): `src/lib/files/delete-file.ts`
- [Access activity](https://github.com/iyadeh/vaultshare/blob/main/src/app/activity/page.tsx): `src/app/activity/page.tsx`
- [Activity views](https://github.com/iyadeh/vaultshare/blob/main/src/components/activity/activity-view.tsx): `src/components/activity/activity-view.tsx`
- [Owner settings](https://github.com/iyadeh/vaultshare/blob/main/src/app/settings/page.tsx): `src/app/settings/page.tsx`
- [Settings views](https://github.com/iyadeh/vaultshare/blob/main/src/components/settings/settings-view.tsx): `src/components/settings/settings-view.tsx`

### Controlled sharing

- [Share management](https://github.com/iyadeh/vaultshare/blob/main/src/app/shares/page.tsx): `src/app/shares/page.tsx`
- [Share links view](https://github.com/iyadeh/vaultshare/blob/main/src/components/shares/shares-view.tsx): `src/components/shares/shares-view.tsx`
- [Public share route](https://github.com/iyadeh/vaultshare/blob/main/src/app/s/%5Btoken%5D/page.tsx): `src/app/s/[token]/page.tsx`
- [Recipient experience](https://github.com/iyadeh/vaultshare/blob/main/src/components/public-share/public-share-view.tsx): `src/components/public-share/public-share-view.tsx`

### Supabase services

- [Browser client](https://github.com/iyadeh/vaultshare/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [Server client](https://github.com/iyadeh/vaultshare/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- **Supabase Auth**
- **Supabase Storage**
- **PostgreSQL RLS**

### Other components

- **File owner**
- **Link recipient**

## Connections

- File owner → Sign in: signs in
- File owner → Register: registers
- Sign in → Browser client: creates client
- Register → Browser client: creates client
- Browser client → Supabase Auth: authenticates
- Supabase Auth → Auth callback: redirects
- Auth callback → Server client: creates client
- Auth callback → Supabase Auth: exchanges code
- Session routing → Session refresh: refreshes session
- Session refresh → Supabase Auth: validates session
- File owner → Dashboard: opens workspace
- Dashboard → Dashboard views: renders
- File owner → File workspace: manages files
- File workspace → File management: renders
- File management → List files: loads files
- File management → Delete file: deletes file
- File management → Upload file: uploads file
- List files → Server client: queries as user
- Delete file → Server client: deletes as user
- Upload file → Server client: stores as user
- Server client → PostgreSQL RLS: reads and writes
- Server client → Supabase Storage: transfers files
- File owner → Share management: manages links
- Share management → Share links view: renders
- File owner → Access activity: reviews access
- Access activity → Activity views: renders
- File owner → Owner settings: updates preferences
- Owner settings → Settings views: renders
- Link recipient → Public share route: opens link
- Public share route → Recipient experience: renders
- Public share route → Server client: loads share
- Server client → PostgreSQL RLS: enforces RLS
