Skip to main content
Convex hosts Pindeck’s backend: database, real-time queries, mutations, HTTP actions, auth, and media storage. This page walks you through creating a project and deploying your functions.

Prerequisites

npm install -g convex

Deploy

1

Create a Convex project

Log in to the Convex dashboard and create a new project. Once created, note your deployment name — it looks like tremendous-jaguar-953. Your project URLs will be:
  • Client URL: https://<deployment-name>.convex.cloud
  • HTTP/actions URL: https://<deployment-name>.convex.site
2

Set VITE_CONVEX_URL in your local environment

Copy the example env file and set your production Convex URL:
cp .env.example .env.local
Then edit .env.local:
VITE_CONVEX_URL=https://<deployment-name>.convex.cloud
VITE_CONVEX_SITE_URL=https://<deployment-name>.convex.site
CONVEX_DEPLOYMENT=<deployment-name>
3

Configure environment variables in the Convex dashboard

In your Convex project’s Settings → Environment Variables, add the following:
VariableDescription
JWT_PRIVATE_KEYPrivate key for Convex Auth JWT signing
OPEN_ROUTER_KEYAPI key for OpenRouter (AI model routing)
FAL_KEYAPI key for fal.ai (image generation)
INGEST_API_KEYShared secret for the Discord ingest HTTP endpoint
NEXTCLOUD_WEBDAV_BASE_URLWebDAV base URL for your Nextcloud instance
NEXTCLOUD_WEBDAV_USERNextcloud username
NEXTCLOUD_WEBDAV_APP_PASSWORDNextcloud app password
NEXTCLOUD_UPLOAD_PREFIXUpload path prefix (default: pindeck/media-uploads)
AUTH_GOOGLE_IDGoogle OAuth client ID
AUTH_GOOGLE_SECRETGoogle OAuth client secret
AUTH_GITHUB_IDGitHub OAuth client ID
AUTH_GITHUB_SECRETGitHub OAuth client secret
SITE_URLPublic URL of your deployed frontend (no trailing slash)
OPENROUTER_VLM_MODEL, OPENROUTER_PROVIDER_SORT, DISCORD_STATUS_WEBHOOK_URL, and NEXTCLOUD_UPLOAD_PREFIX are optional. Omit them to use defaults.
4

Deploy Convex functions

From the root of the repository, run:
bun run deploy:convex
This runs bun run check:prod-target first to confirm your environment is pointing at production, then calls convex deploy.

Verifying the deployment

After deploying, confirm your local environment is correctly targeting production:
bun run check:prod-target
A passing check outputs:
Convex target check passed: production (<deployment-name>)
If it fails, double-check that VITE_CONVEX_URL, VITE_CONVEX_SITE_URL, and CONVEX_DEPLOYMENT are all set correctly in .env.local.

Re-deploying after changes

Any time you change Convex functions or the schema, re-deploy by running the same command:
bun run deploy:convex
The production target check runs automatically before every deploy.
Do not use convex dev when targeting your production deployment. convex dev runs a local development backend and will conflict with your production Convex project. Use bun run deploy:convex for all production deployments.

Build docs developers (and LLMs) love