Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/S4nti4goCoder/cloudsyncpro/llms.txt

Use this file to discover all available pages before exploring further.

CloudSyncPro is built on a three-tier architecture where a React single-page application communicates with Supabase for authentication, data, and serverless compute, and with Cloudflare R2 for binary object storage. The tiers are deliberately decoupled: the frontend never holds server secrets, Supabase Edge Functions act as the trusted intermediary for storage operations, and R2 handles raw bytes independently of the database.

Three-tier architecture

The three tiers map directly onto the request path a user takes when uploading a file: the browser loads the SPA from a CDN, the SPA calls Supabase for auth and queries, and the Edge Functions bridge Supabase to R2 for file transfers.
┌─────────────┐         ┌─────────────────┐
│   Browser   │ ──────► │   Vite (SPA)    │
└──────┬──────┘         └────────┬────────┘
       │                          │
       │  Supabase JS             │ static assets
       │  (auth + queries)        │ from /dist
       ▼                          ▼
┌─────────────────────────────────────────┐
│               Supabase                  │
│  ┌──────┐  ┌────────┐  ┌──────────────┐ │
│  │ Auth │  │Postgres│  │Edge Functions│ │
│  │      │  │ + RLS  │  │              │ │
│  └──────┘  └────────┘  └──────┬───────┘ │
└────────────────────────────────┼────────┘
                                 │  upload, delete, purge

                       ┌──────────────────┐
                       │   Cloudflare R2  │
                       │  (object store)  │
                       └──────────────────┘

Tech stack

LayerTechnology
FrontendVite, React 19, TypeScript
StylingTailwind CSS v4, shadcn/ui (radix-ui)
Client stateZustand (with persist)
Server stateTanStack Query v5
RoutingReact Router v7
BackendSupabase (Auth + Postgres + Edge Functions + Realtime)
StorageCloudflare R2

Key design decisions

SPA with lazy-loaded routes. Every route is code-split and loaded on demand by React Router v7. This keeps the initial bundle small — for example, DashboardPage ships as 2.8 KB gzip despite pulling in Recharts. Row-level security (RLS) for authorization. All Postgres tables have RLS policies enabled. The frontend uses the anonymous key, so every query is automatically scoped to the authenticated user without any server-side filtering code in the application layer. Presigned URL uploads. File bytes never pass through Supabase. The client requests a short-lived presigned URL from the upload-file Edge Function, then PUTs directly to R2. This eliminates Supabase egress costs and removes a bandwidth bottleneck. See upload flow for the full sequence. Realtime for in-app notifications. Supabase Realtime listens on the notifications table. When a server-side operation (share, mention, etc.) inserts a row, the connected client receives the push immediately without polling. pg_cron for automatic trash purge. A scheduled job runs daily at 03:15 UTC, invoking the purge-files Edge Function to hard-delete any trashed files whose updated_at is older than 30 days from both R2 and Postgres. This keeps storage costs bounded without any application-level cron infrastructure.

Build docs developers (and LLMs) love