# barun-work04/vaulted-cloud-storage architecture

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

- Interactive diagram: https://gitdiagram.com/barun-work04/vaulted-cloud-storage
- Repository: https://github.com/barun-work04/vaulted-cloud-storage

## Overview

Vaulted is a Next.js file-storage application backed by Appwrite. Users sign in or register by email, verify with an OTP, then browse a dashboard or categorized file lists, search and sort files, and manage them through upload and file actions. Server actions coordinate identity, file metadata, and binary storage; Appwrite supplies authentication, database, and storage services. The README documents download and permission-based access, but sampled excerpts do not establish every UI-to-action connection, so those links are left unverified.

Main entry points: [`lib/actions/file.action.ts`](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/lib/actions/file.action.ts) (File Actions API), [`app/(root)/page.tsx`](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/app/(root)/page.tsx) (Dashboard), [`lib/appwrite/index.ts`](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/lib/appwrite/index.ts) (Appwrite Clients), [`lib/actions/user.actions.ts`](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/lib/actions/user.actions.ts) (Account Actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Authentication"]
  node_auth_pages["Sign-in / Sign-up<br/>[page.tsx]"]
  node_auth_form["Authentication Form<br/>[AuthForm.tsx]"]
  node_otp["OTP Verification<br/>[OTPModal.tsx]"]
  node_user_actions["Account Actions<br/>[user.actions.ts]"]
end

subgraph group_experience["File Experience"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_usage_cards["Usage Summary"]
  node_category_cards["Category Summary<br/>[CategoryCard.tsx]"]
  node_recent_files["Recent Files<br/>[RecentFiles.tsx]"]
  node_category_page["Category Browser<br/>[page.tsx]"]
  node_search["Global Search<br/>[Search.tsx]"]
  node_file_card["File Card<br/>[Card.tsx]"]
end

subgraph group_operations["File Operations"]
  node_file_uploader["File Uploader<br/>[FileUploader.tsx]"]
  node_file_actions["File Actions<br/>[ActionDropdown.tsx]"]
  node_file_action_content["Action Dialogs"]
  node_file_actions_api["File Actions API<br/>[file.action.ts]"]
end

subgraph group_backend["Appwrite Backend"]
  node_appwrite_clients["Appwrite Clients<br/>[index.ts]"]
  node_appwrite_config["Appwrite Config<br/>[config.ts]"]
  node_appwrite_auth{{"Appwrite Auth"}}
  node_metadata_db[("Metadata Database")]
  node_file_storage[("File Storage")]
end

node_visitor(("User"))

node_visitor -->|"opens"| node_auth_pages
node_auth_pages -->|"renders"| node_auth_form
node_auth_form -->|"requests account"| node_user_actions
node_auth_form -->|"opens verification"| node_otp
node_otp -->|"verifies code"| node_user_actions
node_user_actions -->|"creates sessions"| node_appwrite_clients
node_appwrite_clients -->|"configures"| node_appwrite_config
node_appwrite_clients -->|"provides client"| node_appwrite_auth
node_appwrite_clients -->|"provides client"| node_metadata_db
node_visitor -->|"opens"| node_dashboard
node_dashboard -->|"loads user"| node_user_actions
node_dashboard -->|"loads usage and files"| node_file_actions_api
node_dashboard -->|"renders"| node_usage_cards
node_dashboard -->|"renders"| node_category_cards
node_dashboard -->|"renders"| node_recent_files
node_visitor -->|"browses files"| node_category_page
node_category_page -->|"queries files"| node_file_actions_api
node_category_page -->|"renders results"| node_file_card
node_visitor -->|"searches files"| node_search
node_search -->|"queries matches"| node_file_actions_api
node_search -->|"shows file preview"| node_file_card
node_visitor -->|"uploads file"| node_file_uploader
node_file_uploader -.->|"submits upload"| node_file_actions_api
node_file_actions -.->|"opens actions"| node_file_action_content
node_file_actions -.->|"requests file changes"| node_file_actions_api
node_file_actions_api -->|"uses clients"| node_appwrite_clients
node_file_actions_api -->|"reads and writes metadata"| node_metadata_db
node_file_actions_api -->|"stores and deletes files"| node_file_storage

click node_auth_pages "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/app/(auth)/sign-in/page.tsx"
click node_auth_form "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/AuthForm.tsx"
click node_otp "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/OTPModal.tsx"
click node_user_actions "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/lib/actions/user.actions.ts"
click node_appwrite_clients "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/lib/appwrite/index.ts"
click node_appwrite_config "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/lib/appwrite/config.ts"
click node_dashboard "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/app/(root)/page.tsx"
click node_usage_cards "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/Dashboard/StorageUsageCard.tsx"
click node_category_cards "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/Dashboard/CategoryCard.tsx"
click node_recent_files "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/Dashboard/RecentFiles.tsx"
click node_category_page "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/app/(root)/%5Btype%5D/page.tsx"
click node_search "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/Search.tsx"
click node_file_card "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/Card.tsx"
click node_file_uploader "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/FileUploader.tsx"
click node_file_actions "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/ActionDropdown.tsx"
click node_file_action_content "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/ActionModalContent.tsx"
click node_file_actions_api "https://github.com/barun-work04/vaulted-cloud-storage/blob/main/lib/actions/file.action.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_auth_pages,node_auth_form,node_otp,node_user_actions,node_visitor toneBlue
class node_dashboard,node_usage_cards,node_category_cards,node_recent_files,node_category_page,node_search,node_file_card toneAmber
class node_file_uploader,node_file_actions,node_file_action_content,node_file_actions_api toneMint
class node_appwrite_clients,node_appwrite_config,node_appwrite_auth,node_metadata_db,node_file_storage toneRose
```

## Components

### Authentication

- [Sign-in / Sign-up](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/app/(auth)/sign-in/page.tsx): `app/(auth)/sign-in/page.tsx`
- [Authentication Form](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/AuthForm.tsx): `components/AuthForm.tsx`
- [OTP Verification](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/OTPModal.tsx): `components/OTPModal.tsx`
- [Account Actions](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/lib/actions/user.actions.ts): `lib/actions/user.actions.ts`

### File Experience

- [Dashboard](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/app/(root)/page.tsx): `app/(root)/page.tsx`
- [Usage Summary](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/Dashboard/StorageUsageCard.tsx): `components/Dashboard/StorageUsageCard.tsx`
- [Category Summary](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/Dashboard/CategoryCard.tsx): `components/Dashboard/CategoryCard.tsx`
- [Recent Files](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/Dashboard/RecentFiles.tsx): `components/Dashboard/RecentFiles.tsx`
- [Category Browser](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/app/(root)/%5Btype%5D/page.tsx): `app/(root)/[type]/page.tsx`
- [Global Search](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/Search.tsx): `components/Search.tsx`
- [File Card](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/Card.tsx): `components/Card.tsx`

### File Operations

- [File Uploader](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/FileUploader.tsx): `components/FileUploader.tsx`
- [File Actions](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/ActionDropdown.tsx): `components/ActionDropdown.tsx`
- [Action Dialogs](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/components/ActionModalContent.tsx): `components/ActionModalContent.tsx`
- [File Actions API](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/lib/actions/file.action.ts): `lib/actions/file.action.ts`

### Appwrite Backend

- [Appwrite Clients](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/lib/appwrite/index.ts): `lib/appwrite/index.ts`
- [Appwrite Config](https://github.com/barun-work04/vaulted-cloud-storage/blob/main/lib/appwrite/config.ts): `lib/appwrite/config.ts`
- **Appwrite Auth**
- **Metadata Database**
- **File Storage**

### Other components

- **User**

## Connections

- User → Sign-in / Sign-up: opens
- Sign-in / Sign-up → Authentication Form: renders (evidence: `app/(auth)/sign-in/page.tsx`)
- Authentication Form → Account Actions: requests account (evidence: `components/AuthForm.tsx`)
- Authentication Form → OTP Verification: opens verification (evidence: `components/AuthForm.tsx`)
- OTP Verification → Account Actions: verifies code (evidence: `components/OTPModal.tsx`)
- Account Actions → Appwrite Clients: creates sessions (evidence: `lib/actions/user.actions.ts`)
- Appwrite Clients → Appwrite Config: configures (evidence: `lib/appwrite/index.ts`)
- Appwrite Clients → Appwrite Auth: provides client (evidence: `lib/appwrite/index.ts`)
- Appwrite Clients → Metadata Database: provides client (evidence: `lib/appwrite/index.ts`)
- User → Dashboard: opens
- Dashboard → Account Actions: loads user (evidence: `app/(root)/page.tsx`)
- Dashboard → File Actions API: loads usage and files (evidence: `app/(root)/page.tsx`)
- Dashboard → Usage Summary: renders (evidence: `app/(root)/page.tsx`)
- Dashboard → Category Summary: renders (evidence: `app/(root)/page.tsx`)
- Dashboard → Recent Files: renders (evidence: `app/(root)/page.tsx`)
- User → Category Browser: browses files
- Category Browser → File Actions API: queries files (evidence: `app/(root)/[type]/page.tsx`)
- Category Browser → File Card: renders results (evidence: `app/(root)/[type]/page.tsx`)
- User → Global Search: searches files
- Global Search → File Actions API: queries matches (evidence: `components/Search.tsx`)
- Global Search → File Card: shows file preview (evidence: `components/Search.tsx`)
- User → File Uploader: uploads file
- File Uploader → File Actions API: submits upload
- File Actions → Action Dialogs: opens actions
- File Actions → File Actions API: requests file changes
- File Actions API → Appwrite Clients: uses clients (evidence: `lib/actions/file.action.ts`)
- File Actions API → Metadata Database: reads and writes metadata (evidence: `lib/actions/file.action.ts`)
- File Actions API → File Storage: stores and deletes files (evidence: `lib/actions/file.action.ts`)
