Skip to main content
This guide covers deploying Digcrate to production on Vercel with a Convex backend. Complete the prerequisites and prepare your environment variables before starting.
1

Clone the repository and install dependencies

git clone https://github.com/tmoody1973/crate-web.git
cd crate-web
npm install
2

Configure environment variables

Copy the example env file and fill in your values:
cp .env.local.example .env.local
See Environment variables for a full reference of every variable.
3

Initialize Convex

Convex requires two steps — one for local development and one for production.Local developmentRun the Convex dev server to create a development deployment and push your schema:
npx convex dev
This writes NEXT_PUBLIC_CONVEX_URL and CONVEX_DEPLOYMENT to your .env.local automatically.Production deploymentWhen you are ready to go to production, deploy Convex to a production environment:
npx convex deploy --yes
Copy the production NEXT_PUBLIC_CONVEX_URL output — you will need it in the next step.
During local development you need both servers running at the same time. Open two terminal tabs:
  • Terminal 1: npx convex dev
  • Terminal 2: npm run dev
The Convex dev server syncs your schema and functions to the cloud in real time. Next.js reads the NEXT_PUBLIC_CONVEX_URL from .env.local to connect.
4

Deploy to Vercel

Install the Vercel CLI and deploy:
npm i -g vercel
vercel --prod
Follow the prompts to link the project to your Vercel account. Vercel will detect Next.js automatically and configure the build settings.
5

Set environment variables in Vercel

After deploying, add all environment variables in the Vercel dashboard:
  1. Open your project in the Vercel dashboard.
  2. Go to Settings → Environment Variables.
  3. Add each variable from your .env.local, using the production values (production Convex URL, live Stripe keys, production Auth0 callback URL, etc.).
Key differences between local and production values:
VariableLocal valueProduction value
NEXT_PUBLIC_CONVEX_URLDev deployment URLProduction deployment URL
STRIPE_SECRET_KEYsk_test_...sk_live_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYpk_test_...pk_live_...
AUTH0_CALLBACK_URLhttp://localhost:3000/api/auth0/callbackhttps://yourdomain.com/api/auth0/callback
After saving, redeploy for the new variables to take effect:
vercel --prod
6

Configure Stripe webhooks

Digcrate uses a Stripe webhook to process subscription events (checkout completed, subscription updated, invoice paid, etc.).
  1. In the Stripe dashboard, go to Developers → Webhooks.
  2. Click Add endpoint.
  3. Set the endpoint URL to https://yourdomain.com/api/webhooks/stripe.
  4. Select the following events to listen for:
    • checkout.session.completed
    • customer.subscription.updated
    • customer.subscription.deleted
    • invoice.payment_succeeded
    • invoice.payment_failed
  5. Copy the Signing secret and set it as STRIPE_WEBHOOK_SECRET in Vercel.
If you are not enabling subscription billing, you can skip this step. All users will be on the free tier.
7

Configure Auth0 Token Vault (connected services)

If you want to enable Spotify, Slack, and Google Docs integrations, configure Auth0:
  1. In the Auth0 dashboard, create a new application of type Regular Web Application.
  2. Under Settings, add your production callback URL to Allowed Callback URLs:
    https://yourdomain.com/api/auth0/callback
    
  3. Enable the Token Vault feature under Connections and configure the Spotify, Slack, and Google OAuth connections.
  4. Copy the Domain, Client ID, and Client Secret from the Auth0 application settings and set them as environment variables in Vercel.
Auth0 Token Vault is optional. Skip this step if you do not need Spotify, Slack, or Google Docs integration.
8

Verify the deployment

Open your Vercel deployment URL and:
  1. Sign up for an account — Clerk should handle the flow and redirect you to the workspace.
  2. Run a test query (e.g. /artist Radiohead) — the agent should stream a response.
  3. If you configured Stripe, visit /pricing and verify the plans appear.
  4. Check the Convex dashboard to confirm data is being written to the database.