DocumentationDeployment

Production Deployment

Follow this guide to set up your production environment. Tijori requires Clerk for authentication and Convex for its realtime backend.

Prerequisites
What you need before you start
  • Clerk Account & Production Instance
  • Convex Account
  • Vercel Account (for frontend)
  • A production domain (recommended)
Important Note
Security and Persistence
Ensure your Convex deployment is pinned to a stable version. Never share yourCONVEX_DEPLOY_KEYpublicly. This key allows full administrative access to your database.

Configure Clerk Authentication

Clerk handles identity management and secure session tokens for Tijori.

1. Create a Production Instance

In your Clerk dashboard, navigate to your application and ensure you are in the Production environment settings.

Generate your production keys, and since convex doesn't support *.vercel.app domains, you have to use your own domain, setup your records, for detailed guide, check the offical Clerk docs

2. Obtain API Keys

Copy these keys into your local .env.prod and your Vercel environment variables.

env
VITE_CLERK_PUBLISHABLE_KEY=pk_live_...
CLERK_SECRET_KEY=sk_live_...
CLERK_JWKS_FIELD=https://clerk.custom.domain/.well-known/jwks.json
CLERK_JWT_ISSUER_DOMAIN=https://clerk.custom.domain

Initialize Convex Backend

Convex powers the database, serverless functions, and real-time synchronization.

Convex Environment Variables

Before deploying, make sure your schema is synced with Clerk. Once, your schema is in sync, generate the keys from the production instance via dashboard or from Deployment Settings

bash
# Once logged in, deloy schema to convex
bun run cvx:deploy
bash
# All production keys
CONVEX_DEPLOYMENT=cultured-man-99
VITE_CONVEX_URL=https://cultured-man-99.convex.cloud
CONVEX_DEPLOY_KEY=prod:cultured-man-99|abc123...

Deploy Frontend to Vercel

The final step is to host the React application and connect it to your backend.

For detailed guide, on deployment not only to vercel but also to any other platform, check the offical Convex Deployment Guide

Build Settings
Framework PresetTanstack Start
Build Command (vercel)bun run build:vercel
Output Directorydist
Environment Variables

Add these to Vercel Project Settings:

  • CONVEX_DEPLOYMENT
  • VITE_CONVEX_URL
  • CONVEX_DEPLOY_KEY
  • NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
  • CLERK_SECRET_KEY
  • CLERK_JWT_ISSUER_DOMAIN
  • CLERK_JWKS_FIELD

Troubleshooting

"Unauthorized" errors in Convex
This usually happens if CLERK_JWT_ISSUER_DOMAIN is not set correctly in Convex or if the Clerk instance is not in production mode. Verify the environment variable in Convex via bunx convex env list.
Variables not decrypting in production
Check if your browser's Web Crypto API is restricted by Content Security Policy (CSP). Tijori requires full access to crypto.subtle. Ensure your hosting provider isn't injecting overly restrictive headers.