Shipr uses Convex as its real-time database and backend platform.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/egeuysall/shipr/llms.txt
Use this file to discover all available pages before exploring further.
Why Convex?
- Real-time subscriptions - UI updates automatically when data changes
- Type-safe queries - Full TypeScript support with generated types
- Built-in authentication - Integrates with Clerk JWT tokens
- File storage - Upload and serve files with signed URLs
- Server functions - Queries, mutations, and actions in TypeScript
Schema
The database schema is defined inconvex/schema.ts:
~/workspace/source/convex/schema.ts
Tables
Users
Stores user profiles synced from Clerk.| Field | Type | Description |
|---|---|---|
clerkId | string | Clerk user ID (indexed) |
email | string | Primary email |
name | string? | Full name |
imageUrl | string? | Profile image URL |
plan | string? | "free" or "pro" |
onboardingCompleted | boolean? | Onboarding completion status |
onboardingStep | string? | Current onboarding step |
Files
Stores file upload metadata and references to Convex storage.| Field | Type | Description |
|---|---|---|
storageId | Id<"_storage"> | Reference to stored file |
userId | Id<"users"> | Owner of the file |
fileName | string | Sanitized original filename |
mimeType | string | MIME type (e.g., “image/png”) |
size | number | File size in bytes |
Chat Threads
Stores AI chat conversation threads.| Field | Type | Description |
|---|---|---|
userId | Id<"users"> | Thread owner |
title | string | Auto-generated thread title |
lastMessageAt | number | Timestamp of last message |
Chat Messages
Stores individual messages within chat threads.| Field | Type | Description |
|---|---|---|
userId | Id<"users"> | Message owner |
threadId | Id<"chatThreads"> | Parent thread |
role | "user" | "assistant" | Message sender |
content | string | Message text |
Environment Variables
.env.example
| Variable | Description |
|---|---|
NEXT_PUBLIC_CONVEX_URL | Convex deployment URL |
Queries vs Mutations
Queries
Read data from the database. Automatically re-run when data changes.Mutations
Write data to the database.Authentication
All Convex functions automatically receive Clerk authentication context:~/workspace/source/convex/users.ts
Automatic Timestamps
Convex automatically adds_creationTime to every document:
No need to manually track
createdAt fields - use _creationTime instead.