This guide explains how to deploy ShopCall.ai with static hosting and Supabase Edge Functions.
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).
Stores e-commerce platform credentials and configuration.
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 callbackshoprenter-oauth - /functions/v1/oauth-shoprenter-*
/oauth-shoprenter-init - Initialize ShopRenter OAuth flow/oauth-shoprenter-callback - Handle ShopRenter OAuth callbackshoprenter-webhooks - /functions/v1/webhook-shoprenter-*
/webhook-shoprenter-uninstall - Handle ShopRenter app uninstallshoprenter-api - /functions/v1/shoprenter-*
/shoprenter-products/:storeId - Fetch products from ShopRenter/shoprenter-orders/:storeId - Fetch orders from ShopRenter/shoprenter-customers/:storeId - Fetch customers from ShopRenter/shoprenter-sync/:storeId - Trigger manual data synchronizationgdpr-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:
# 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
# ShopRenter Integration
SHOPRENTER_CLIENT_ID=your_shoprenter_client_id
SHOPRENTER_CLIENT_SECRET=your_shoprenter_client_secret
# 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
# Service Role Key (for admin operations)
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
Create or update .env file in shopcall.ai-main/:
# Supabase Configuration
VITE_SUPABASE_URL=https://YOUR_PROJECT.supabase.co
VITE_SUPABASE_ANON_KEY=your_anon_key
# 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/)Create .htaccess file in the root directory for SPA routing:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
Enable mod_rewrite:
sudo a2enmod rewrite
sudo systemctl restart apache2
dist/ to your web server (e.g., /var/www/shopcall.ai/)Configure nginx:
server {
listen 80;
server_name yourdomain.com;
root /var/www/shopcall.ai;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
Test and reload:
sudo nginx -t
sudo systemctl reload nginx
cd shopcall.ai-main && npm run buildshopcall.ai-main/distAdd the API key to your Supabase Edge Function secrets:
supabase secrets set RESEND_API_KEY=your_api_key
Verify your sending domain in Resend (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.
Register your app with ShopRenter by emailing partnersupport@shoprenter.hu with:
https://yourdomain.com/integrations?sr_install=...https://YOUR_PROJECT.supabase.co/functions/v1/oauth-shoprenter-callbackhttps://YOUR_PROJECT.supabase.co/functions/v1/webhook-shoprenter-uninstallproduct:read, product:write, customer:read, customer:write, order:read, order:write, category:read, webhook:read, webhook:writeOnce approved, you'll receive:
SHOPRENTER_CLIENT_ID)SHOPRENTER_CLIENT_SECRET)Test your integration with a ShopRenter test store (request at https://www.shoprenter.hu/tesztigenyles/?devstore=1)
# 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().env files to version controlFor issues or questions: