Convex Backend
OpenSync’s entire backend runs on Convex. There is no separate server, no Docker containers, and no infrastructure to manage. Convex provides the database, serverless functions, real-time subscriptions, HTTP endpoints, file storage, and scheduled jobs.One-click deploy
The fastest way to set up the backend:- A new Convex project linked to your account
- All database tables with their schemas and indexes
- Serverless functions for queries, mutations, and actions
- HTTP endpoints for the sync API (
/sync/session,/sync/message,/sync/batch,/search, etc.) - Search indexes for full-text search
- Vector indexes for semantic search
- Scheduled function support for background embedding generation
Manual deploy
1. Install the Convex CLI
2. Clone and initialize
- Sign in to your Convex account (or create one).
- Create a new project.
- Push the schema, functions, and indexes.
npx convex dev runs in watch mode. It pushes changes to your development deployment every time you save a file in the convex/ directory.
3. Set environment variables
4. Deploy to production
Database schema
The Convex backend defines these tables:Indexes
Key indexes defined in the schema:
Search indexes enable full-text search on
sessions.searchableText. Vector indexes enable cosine similarity search on sessionEmbeddings.embedding.
HTTP endpoints
The sync API is defined inconvex/http.ts. These are the endpoints that plugins call:
All endpoints except
/health require an Authorization: Bearer osk_... header.
Convex dashboard
Access your project at dashboard.convex.dev:- Data tab: Browse and edit documents in any table
- Functions tab: See all deployed functions, their execution logs, and errors
- Logs tab: Real-time function execution logs with timing and error details
- Settings tab: Environment variables, deployment URLs, and project configuration
Scaling
Convex handles scaling automatically:
The free tier includes 1 million function calls per month, which is sufficient for most individual developers. Teams with higher usage can upgrade through the Convex dashboard.
Monitoring
Function logs
Checkdashboard.convex.dev > Logs for:
- Function execution times
- Error stack traces
- Write conflict retries
- Scheduled function results