This guide explains how to deploy ShopCall.ai after the migration from Vercel to Supabase Edge Functions with static hosting.
pending_signups, oauth_nonces)The database migrations have already been applied. The following tables were created:
Stores temporary signup data with OTP for email verification (15-minute expiration).
Stores OAuth state/nonce values for secure OAuth flows (10-minute expiration).
auth - /functions/v1/auth/*
/auth/signup - Create new user account with OTP/auth/signup/verify - Verify OTP and complete registration/auth/signup/resend-otp - Resend OTP email/auth/login - Email/password login/auth/logout - Sign out/auth/check - Validate session tokenshopify-oauth - /functions/v1/shopify-oauth/*
/shopify-oauth/init - Initialize Shopify OAuth flow/shopify-oauth/callback - Handle Shopify OAuth callbackwoocommerce-oauth - /functions/v1/woocommerce-oauth/*
/woocommerce-oauth/init - Initialize WooCommerce OAuth flow/woocommerce-oauth/callback - Handle WooCommerce callbackgdpr-webhooks - /functions/v1/gdpr-webhooks/*
/gdpr-webhooks/customers-data-request - Handle customer data requests/gdpr-webhooks/customers-redact - Handle customer data redaction/gdpr-webhooks/shop-redact - Handle shop data redactionConfigure these in your Supabase project settings under Edge Functions:
# Supabase (automatically available)
SUPABASE_URL=https://YOUR_PROJECT.supabase.co
SUPABASE_ANON_KEY=your_anon_key
# Email Service (Resend)
RESEND_API_KEY=re_YOUR_API_KEY
# Shopify Integration
SHOPIFY_API_KEY=your_shopify_api_key
SHOPIFY_API_SECRET=your_shopify_api_secret
SHOPIFY_REDIRECT_URI=https://YOUR_PROJECT.supabase.co/functions/v1/shopify-oauth/callback
# Frontend URL (for OAuth redirects)
FRONTEND_URL=https://yourdomain.com
# Edge Function Base URL
EDGE_FUNCTION_BASE_URL=https://YOUR_PROJECT.supabase.co/functions/v1
Create or update .env file in shopcall.ai-main/:
# Backend API Base URL (Supabase Edge Functions)
VITE_API_URL=https://YOUR_PROJECT.supabase.co/functions/v1
# Frontend URL (for OAuth callbacks)
VITE_FRONTEND_URL=https://yourdomain.com
cd shopcall.ai-main
npm install
npm run build
This creates a dist/ directory with your static files.
dist/ to your web server (e.g., /var/www/html/).htaccess file is in the root directory (already created in public/)Make sure mod_rewrite is enabled:
sudo a2enmod rewrite
sudo systemctl restart apache2
dist/ to your web server (e.g., /var/www/shopcall.ai/dist/)Copy nginx.conf.example to your nginx sites-available directory:
sudo cp nginx.conf.example /etc/nginx/sites-available/shopcall.ai
sudo ln -s /etc/nginx/sites-available/shopcall.ai /etc/nginx/sites-enabled/
Update the configuration with your domain and SSL certificates
Test and reload nginx:
sudo nginx -t
sudo systemctl reload nginx
npm run builddistAdd the API key to your Supabase Edge Function secrets:
supabase secrets set RESEND_API_KEY=your_api_key
Verify your sending domain in Resend (optional but recommended for production)
https://yourdomain.comhttps://YOUR_PROJECT.supabase.co/functions/v1/shopify-oauth/callbackhttps://YOUR_PROJECT.supabase.co/functions/v1/gdpr-webhooks/customers-data-requesthttps://YOUR_PROJECT.supabase.co/functions/v1/gdpr-webhooks/customers-redacthttps://YOUR_PROJECT.supabase.co/functions/v1/gdpr-webhooks/shop-redactNo special configuration needed. The OAuth flow is initiated from the dashboard.
# Test signup
curl -X POST https://YOUR_PROJECT.supabase.co/functions/v1/auth/signup \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "testpass123",
"full_name": "Test User",
"company_name": "Test Company",
"user_name": "testuser"
}'
# Test login
curl -X POST https://YOUR_PROJECT.supabase.co/functions/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "testpass123"
}'
/dashboard, /call-logs)Issue: 404 errors on routes when refreshing
.htaccess (Apache) or nginx configuration is properly set up for client-side routingIssue: CORS errors when calling Edge Functions
corsHeaders in each function)Issue: Email not sending
Issue: OAuth callback fails
delete_expired_pending_signups()delete_expired_oauth_nonces()If using the Vercel backend (shopcall.ai-backend-main/), configure these environment variables:
# Supabase Configuration
SUPABASE_URL=https://YOUR_PROJECT.supabase.co
SUPABASE_ANON_KEY=your_anon_key
# URL Configuration
BACKEND_URL=https://shopcall-ai-backend.vercel.app # Your backend deployment URL
FRONTEND_URL=https://shopcall.ai # Your frontend URL
# OAuth Configuration
SHOPIFY_API_KEY=your_shopify_api_key
SHOPIFY_API_SECRET=your_shopify_api_secret
SHOPRENTER_CLIENT_ID=your_shoprenter_client_id
SHOPRENTER_CLIENT_SECRET=your_shoprenter_client_secret
# Email Configuration
EMAIL_USER=your_gmail_address@gmail.com
EMAIL_PASSWORD=your_gmail_app_password
# Environment
NODE_ENV=production
Important: Set BACKEND_URL and FRONTEND_URL environment variables to match your actual deployment URLs. This allows for flexible deployment across different environments.
If you need to rollback to the old Vercel deployment:
Update frontend .env to point back to Vercel backend:
VITE_API_URL=https://shopcall-ai-backend.vercel.app
Rebuild and redeploy frontend
The old backend code is still available in shopcall.ai-backend-main/
.env files to version controlFor issues or questions: