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’s Postgres database is hosted on Supabase and consists of nine tables covering user profiles, workspaces, file storage, sharing, activity, and notifications. Types are generated from the live schema using npm run gen:types and stored in src/types/databaseTypes.ts. Each table is described below with its columns, types, and notable constraints.
Row-level security (RLS) is enabled on all tables. Every query made with the anonymous key is automatically scoped to the authenticated user by the policies defined in Supabase. Server-side operations (Edge Functions) use the SUPABASE_SERVICE_ROLE_KEY to bypass RLS when necessary.

Enums

EnumValuesUsed on
user_rolesuperadmin, admin, editor, viewerprofiles.role, workspace_members.role, file_shares.shared_role
file_statusactive, archived, deletedfiles.status, folders.status
share_typeuser, role, publicfile_shares.share_type
permission_typeview, edit, delete, sharefile_shares.permissions

Tables

Extends Supabase Auth users with display information and a platform-wide role. A row is created automatically when a user signs up.
ColumnTypeNotes
iduuidPrimary key; matches auth.users.id
emailtextUser’s email address
full_nametext | nullDisplay name
avatar_urltext | nullR2 URL of the profile picture
roleuser_rolePlatform-wide role; defaults to viewer
created_attimestamptzRow creation timestamp
updated_attimestamptzLast update timestamp
A workspace is the top-level container for files, folders, members, and activity. Each workspace has one owner and can have many members with different roles.
ColumnTypeNotes
iduuidPrimary key
nametextDisplay name of the workspace
descriptiontext | nullOptional description
slugtextURL-safe unique identifier
owner_iduuidFK → profiles.id
created_attimestamptzRow creation timestamp
updated_attimestamptzLast update timestamp
Join table between workspaces and users. Determines what actions a member can perform within a given workspace.
ColumnTypeNotes
iduuidPrimary key
workspace_iduuidFK → workspaces.id
user_iduuidFK → profiles.id
roleuser_roleMember’s role in this workspace
invited_byuuid | nullFK → profiles.id; null for the owner
joined_attimestamptzTimestamp of when the member joined
Stores metadata for every uploaded file. The binary content lives in Cloudflare R2, referenced by r2_key.
ColumnTypeNotes
iduuidPrimary key
nametextSanitized file name used in the UI
original_nametextOriginal filename at upload time
workspace_iduuidFK → workspaces.id
folder_iduuid | nullFK → folders.id; null means workspace root
uploaded_byuuidFK → profiles.id
sizeint8File size in bytes
mime_typetextMIME type (e.g., image/png)
extensiontextFile extension without the dot
r2_keytextObject key in the R2 bucket
statusfile_statusactive, archived, or deleted
versionint4Increments on each new version upload
metadatajsonbArbitrary extra metadata
created_attimestamptzRow creation timestamp
updated_attimestamptzLast update timestamp
Represents a hierarchical folder within a workspace. Self-referencing via parent_id to support arbitrary nesting depth.
ColumnTypeNotes
iduuidPrimary key
nametextDisplay name of the folder
workspace_iduuidFK → workspaces.id
parent_iduuid | nullFK → folders.id; null means workspace root
created_byuuidFK → profiles.id
statusfile_statusactive, archived, or deleted
metadatajsonbArbitrary extra metadata (e.g., color)
created_attimestamptzRow creation timestamp
updated_attimestamptzLast update timestamp
Records every share link or direct share created for a file or folder. Supports public links with optional expiration and password, and direct user-to-user or role-based sharing.
ColumnTypeNotes
iduuidPrimary key
resource_iduuidID of the shared file or folder
resource_typetextfile or folder
share_typeshare_typepublic, user, or role
permissionspermission_type[]Array of granted permissions
tokentext | nullUnique token for public link access
expires_attimestamptz | nullOptional expiration timestamp
passwordtext | nullHashed password for protected links
shared_byuuidFK → profiles.id
shared_withuuid | nullFK → profiles.id; null for public shares
shared_roleuser_role | nullTarget role for role-based shares
is_activebooleanWhether the share is currently active
created_attimestamptzRow creation timestamp
Tracks which files or folders a user has marked as a favorite within a workspace.
ColumnTypeNotes
iduuidPrimary key
resource_iduuidID of the favorited file or folder
resource_typetextfile or folder
user_iduuidFK → profiles.id
workspace_iduuidFK → workspaces.id
created_attimestamptzTimestamp when the favorite was added
Append-only audit log of user actions within a workspace. Supports filtering by action type, date range, and user in the activity timeline UI.
ColumnTypeNotes
iduuidPrimary key
workspace_iduuidFK → workspaces.id
user_iduuid | nullFK → profiles.id; null for system actions
actionactivity_actionEnum of tracked actions (upload, delete, share, etc.)
resource_typetext | nullfile, folder, or other resource type
resource_iduuid | nullID of the affected resource
resource_nametext | nullDisplay name of the resource at the time of the action
metadatajsonbAdditional context (e.g., file size, mime type)
ip_addresstext | nullIP address of the client
created_attimestamptzTimestamp of the action
Stores in-app notifications delivered to users via Supabase Realtime. Clients subscribe to inserts on this table to receive push notifications without polling.
ColumnTypeNotes
iduuidPrimary key
user_iduuidFK → profiles.id
titletextShort notification heading
messagetextNotification body text
typetextNotification category (e.g., share, mention)
resource_iduuid | nullID of the related resource
resource_typetext | nullType of the related resource
is_readbooleanWhether the user has read the notification
created_attimestamptzTimestamp when the notification was created

Build docs developers (and LLMs) love