# aleafarrel-id/vexel architecture

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

- Interactive diagram: https://gitdiagram.com/aleafarrel-id/vexel
- Repository: https://github.com/aleafarrel-id/vexel

## Overview

Vexel is a self-hosted, cloud-ready file workspace. The main workflow runs from a person using the browser drive to browse and manage files, upload or download content, and preview or share it; API services enforce access and coordinate persistence and blob storage. Separate capabilities include account and admin settings, public-share collaboration, and thumbnail generation. The README documents major behaviors not shown in sampled source; those subsystems are included, but uncertain implementation links are omitted. Source excerpts establish selected service wiring, not every route or storage interaction.

Main entry points: [`apps/api/src/app.ts`](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/app.ts) (HTTP API), [`apps/api/src/services/node.service.ts`](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/services/node.service.ts) (Node management), [`apps/web/src/features/drive`](https://github.com/aleafarrel-id/vexel/tree/main/apps/web/src/features/drive) (Drive workspace), [`apps/web/src/features/drive/uploads/upload-engine.ts`](https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/features/drive/uploads/upload-engine.ts) (Upload engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web workspace"]
  node_webapp["Web app shell<br/>[App.tsx]"]
  node_drive["Drive workspace"]
  node_queries["Drive queries<br/>[nodes.queries.ts]"]
  node_uploads["Upload engine<br/>[upload-engine.ts]"]
  node_downloads["Download engine<br/>[download-engine.ts]"]
  node_previews["File previews"]
  node_publicshare["Public share workspace"]
  node_settings["Settings and admin UI"]
end

subgraph group_api["API domain"]
  node_api["HTTP API<br/>[app.ts]"]
  node_authroutes["Auth routes<br/>[auth.route.ts]"]
  node_noderoutes["Node routes<br/>[nodes.route.ts]"]
  node_uploadroutes["Upload routes<br/>[uploads.route.ts]"]
  node_shareroutes["Share routes<br/>[shares.route.ts]"]
  node_authservice["Authentication<br/>[auth.service.ts]"]
  node_nodeservice["Node management<br/>[node.service.ts]"]
  node_shareservice["Share management<br/>[share.service.ts]"]
  node_thumbnail["Thumbnail service"]
end

subgraph group_persistence["Persistence"]
  node_database[("SQLite or PostgreSQL<br/>[index.ts]")]
end

subgraph group_blob["File storage"]
  node_storageadapter["Storage adapter<br/>[adapter.ts]"]
  node_thumbnailcache[("Thumbnail cache<br/>[thumbnail-cache.ts]")]
end

subgraph group_shared["Shared contracts"]
  node_contracts["Shared schemas and types"]
end

node_person(("Workspace user"))

node_person -->|"uses"| node_webapp
node_webapp -.->|"opens"| node_drive
node_drive -.->|"requests nodes"| node_queries
node_queries -.->|"calls API"| node_api
node_drive -->|"starts uploads"| node_uploads
node_uploads -->|"uploads chunks"| node_api
node_drive -->|"downloads files"| node_downloads
node_downloads -.->|"requests downloads"| node_api
node_drive -->|"opens previews"| node_previews
node_person -->|"visits share"| node_publicshare
node_publicshare -.->|"resolves share"| node_api
node_person -->|"configures workspace"| node_settings
node_api -->|"mounts"| node_authroutes
node_api -->|"mounts"| node_noderoutes
node_api -->|"mounts"| node_uploadroutes
node_api -->|"mounts"| node_shareroutes
node_authroutes -->|"calls"| node_authservice
node_api -->|"configures"| node_nodeservice
node_api -->|"configures"| node_shareservice
node_nodeservice -->|"requests thumbnails"| node_thumbnail
node_nodeservice -->|"streams files"| node_storageadapter
node_shareservice -->|"uses range parser"| node_nodeservice
node_authservice -->|"reads and writes"| node_database
node_nodeservice -->|"reads and writes"| node_database
node_shareservice -->|"reads and writes"| node_database
node_thumbnail -->|"reads blobs"| node_storageadapter
node_thumbnail -->|"uses cache"| node_thumbnailcache
node_nodeservice -->|"resolves cache"| node_thumbnailcache
node_uploads -->|"uses upload types"| node_contracts
node_storageadapter -->|"uses shared types"| node_contracts

click node_webapp "https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/App.tsx"
click node_drive "https://github.com/aleafarrel-id/vexel/tree/main/apps/web/src/features/drive"
click node_queries "https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/lib/queries/nodes.queries.ts"
click node_uploads "https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/features/drive/uploads/upload-engine.ts"
click node_downloads "https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/features/drive/downloads/download-engine.ts"
click node_previews "https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/features/preview/FilePreviewModal.tsx"
click node_publicshare "https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/features/public-share/PublicShareWorkspace.tsx"
click node_settings "https://github.com/aleafarrel-id/vexel/tree/main/apps/web/src/features/settings"
click node_api "https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/app.ts"
click node_authroutes "https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/routes/auth.route.ts"
click node_noderoutes "https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/routes/nodes.route.ts"
click node_uploadroutes "https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/routes/uploads.route.ts"
click node_shareroutes "https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/routes/shares.route.ts"
click node_authservice "https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/services/auth.service.ts"
click node_nodeservice "https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/services/node.service.ts"
click node_shareservice "https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/services/share.service.ts"
click node_thumbnail "https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/services/thumbnail.service.ts"
click node_database "https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/db/index.ts"
click node_storageadapter "https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/storage/adapter.ts"
click node_thumbnailcache "https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/storage/thumbnail-cache.ts"
click node_contracts "https://github.com/aleafarrel-id/vexel/tree/main/packages/shared/src"

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_webapp,node_drive,node_queries,node_uploads,node_downloads,node_previews,node_publicshare,node_settings,node_person toneBlue
class node_api,node_authroutes,node_noderoutes,node_uploadroutes,node_shareroutes,node_authservice,node_nodeservice,node_shareservice,node_thumbnail toneAmber
class node_database toneMint
class node_storageadapter,node_thumbnailcache toneRose
class node_contracts toneIndigo
```

## Components

### Web workspace

- [Web app shell](https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Drive workspace](https://github.com/aleafarrel-id/vexel/tree/main/apps/web/src/features/drive): `apps/web/src/features/drive`
- [Drive queries](https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/lib/queries/nodes.queries.ts): `apps/web/src/lib/queries/nodes.queries.ts`
- [Upload engine](https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/features/drive/uploads/upload-engine.ts): `apps/web/src/features/drive/uploads/upload-engine.ts`
- [Download engine](https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/features/drive/downloads/download-engine.ts): `apps/web/src/features/drive/downloads/download-engine.ts`
- [File previews](https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/features/preview/FilePreviewModal.tsx): `apps/web/src/features/preview/FilePreviewModal.tsx`
- [Public share workspace](https://github.com/aleafarrel-id/vexel/blob/main/apps/web/src/features/public-share/PublicShareWorkspace.tsx): `apps/web/src/features/public-share/PublicShareWorkspace.tsx`
- [Settings and admin UI](https://github.com/aleafarrel-id/vexel/tree/main/apps/web/src/features/settings): `apps/web/src/features/settings`

### API domain

- [HTTP API](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/app.ts): `apps/api/src/app.ts`
- [Auth routes](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/routes/auth.route.ts): `apps/api/src/routes/auth.route.ts`
- [Node routes](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/routes/nodes.route.ts): `apps/api/src/routes/nodes.route.ts`
- [Upload routes](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/routes/uploads.route.ts): `apps/api/src/routes/uploads.route.ts`
- [Share routes](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/routes/shares.route.ts): `apps/api/src/routes/shares.route.ts`
- [Authentication](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/services/auth.service.ts): `apps/api/src/services/auth.service.ts`
- [Node management](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/services/node.service.ts): `apps/api/src/services/node.service.ts`
- [Share management](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/services/share.service.ts): `apps/api/src/services/share.service.ts`
- [Thumbnail service](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/services/thumbnail.service.ts): `apps/api/src/services/thumbnail.service.ts`

### Persistence

- [SQLite or PostgreSQL](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/db/index.ts): `apps/api/src/db/index.ts`

### File storage

- [Storage adapter](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/storage/adapter.ts): `apps/api/src/storage/adapter.ts`
- [Thumbnail cache](https://github.com/aleafarrel-id/vexel/blob/main/apps/api/src/storage/thumbnail-cache.ts): `apps/api/src/storage/thumbnail-cache.ts`

### Shared contracts

- [Shared schemas and types](https://github.com/aleafarrel-id/vexel/tree/main/packages/shared/src): `packages/shared/src`

### Other components

- **Workspace user**

## Connections

- Workspace user → Web app shell: uses (evidence: `README.md`)
- Web app shell → Drive workspace: opens
- Drive workspace → Drive queries: requests nodes (evidence: `apps/web/src/features/drive/uploads/upload-engine.ts`)
- Drive queries → HTTP API: calls API
- Drive workspace → Upload engine: starts uploads (evidence: `README.md`)
- Upload engine → HTTP API: uploads chunks (evidence: `README.md`)
- Drive workspace → Download engine: downloads files (evidence: `README.md`)
- Download engine → HTTP API: requests downloads
- Drive workspace → File previews: opens previews (evidence: `README.md`)
- Workspace user → Public share workspace: visits share (evidence: `README.md`)
- Public share workspace → HTTP API: resolves share
- Workspace user → Settings and admin UI: configures workspace (evidence: `README.md`)
- HTTP API → Auth routes: mounts (evidence: `apps/api/src/app.ts`)
- HTTP API → Node routes: mounts (evidence: `apps/api/src/app.ts`)
- HTTP API → Upload routes: mounts (evidence: `apps/api/src/app.ts`)
- HTTP API → Share routes: mounts (evidence: `apps/api/src/app.ts`)
- Auth routes → Authentication: calls (evidence: `apps/api/src/routes/auth.route.ts`)
- HTTP API → Node management: configures (evidence: `apps/api/src/app.ts`)
- HTTP API → Share management: configures (evidence: `apps/api/src/app.ts`)
- Node management → Thumbnail service: requests thumbnails (evidence: `apps/api/src/services/node.service.ts`)
- Node management → Storage adapter: streams files (evidence: `apps/api/src/services/node.service.ts`)
- Share management → Node management: uses range parser (evidence: `apps/api/src/services/share.service.ts`)
- Authentication → SQLite or PostgreSQL: reads and writes (evidence: `apps/api/src/services/auth.service.ts`)
- Node management → SQLite or PostgreSQL: reads and writes (evidence: `apps/api/src/services/node.service.ts`)
- Share management → SQLite or PostgreSQL: reads and writes (evidence: `apps/api/src/services/share.service.ts`)
- Thumbnail service → Storage adapter: reads blobs (evidence: `apps/api/src/services/thumbnail.service.ts`)
- Thumbnail service → Thumbnail cache: uses cache (evidence: `apps/api/src/services/thumbnail.service.ts`)
- Node management → Thumbnail cache: resolves cache (evidence: `apps/api/src/services/node.service.ts`)
- Upload engine → Shared schemas and types: uses upload types (evidence: `apps/web/src/features/drive/uploads/upload-engine.ts`)
- Storage adapter → Shared schemas and types: uses shared types (evidence: `apps/api/src/storage/adapter.ts`)
