|
|
@@ -400,47 +400,63 @@ supabase functions serve
|
|
|
|
|
|
## Environment Configuration
|
|
|
|
|
|
+### Quick Setup
|
|
|
+
|
|
|
+1. **Frontend**: Copy `shopcall.ai-main/.env.example` to `.env` and fill in your values
|
|
|
+2. **Backend**: Copy `supabase/.env.example` to `.env` and fill in your values
|
|
|
+3. **Database**: Configure pg_cron settings in Supabase Dashboard (see below)
|
|
|
+
|
|
|
### Frontend `.env` (shopcall.ai-main)
|
|
|
+
|
|
|
+Required environment variables:
|
|
|
+
|
|
|
```bash
|
|
|
-# Supabase Configuration
|
|
|
-VITE_SUPABASE_URL=https://ztklqodcdjeqpsvhlpud.supabase.co
|
|
|
-VITE_SUPABASE_ANON_KEY=<anon_key>
|
|
|
+# Supabase Configuration (from Supabase Dashboard → Settings → API)
|
|
|
+VITE_SUPABASE_URL=https://YOUR_PROJECT.supabase.co
|
|
|
+VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
|
|
|
|
|
|
-# Backend API Base URL (Supabase Edge Functions)
|
|
|
-VITE_API_URL=https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1
|
|
|
+# Backend API Base URL (typically VITE_SUPABASE_URL + /functions/v1)
|
|
|
+VITE_API_URL=https://YOUR_PROJECT.supabase.co/functions/v1
|
|
|
|
|
|
# Frontend URL (for OAuth callbacks)
|
|
|
-VITE_FRONTEND_URL=https://shopcall.ai
|
|
|
+VITE_FRONTEND_URL=http://localhost:8080 # or https://yourdomain.com for production
|
|
|
```
|
|
|
|
|
|
-### Supabase Edge Functions `.env`
|
|
|
+**Note**: `VITE_API_URL` is derived from `VITE_SUPABASE_URL` by appending `/functions/v1`
|
|
|
+
|
|
|
+### Supabase Edge Functions `.env` (supabase)
|
|
|
+
|
|
|
+Required environment variables:
|
|
|
+
|
|
|
```bash
|
|
|
-# OAuth Configuration
|
|
|
-SHOPIFY_API_KEY=<shopify_api_key>
|
|
|
-SHOPIFY_API_SECRET=<shopify_api_secret>
|
|
|
-SHOPRENTER_CLIENT_ID=<shoprenter_client_id>
|
|
|
-SHOPRENTER_CLIENT_SECRET=<shoprenter_client_secret>
|
|
|
+# Supabase Configuration (from Supabase Dashboard → Settings → API)
|
|
|
+SUPABASE_URL=https://YOUR_PROJECT.supabase.co
|
|
|
+SUPABASE_ANON_KEY=your_supabase_anon_key
|
|
|
+SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
|
|
|
|
|
|
-# Scheduled Sync Security
|
|
|
-INTERNAL_SYNC_SECRET=<random_secure_secret_for_scheduled_sync>
|
|
|
+# Frontend URL (same as VITE_FRONTEND_URL in frontend .env)
|
|
|
+FRONTEND_URL=http://localhost:8080 # or https://yourdomain.com for production
|
|
|
|
|
|
-# Email Configuration
|
|
|
-RESEND_API_KEY=<resend_api_key>
|
|
|
+# E-commerce Platform OAuth Credentials
|
|
|
+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
|
|
|
|
|
|
-# Frontend URL
|
|
|
-FRONTEND_URL=https://shopcall.ai
|
|
|
+# Internal Security (generate with: openssl rand -hex 32)
|
|
|
+INTERNAL_SYNC_SECRET=your_random_secure_secret
|
|
|
|
|
|
-# Supabase Configuration
|
|
|
-SUPABASE_URL=<supabase_project_url>
|
|
|
-SUPABASE_ANON_KEY=<supabase_anon_key>
|
|
|
-SUPABASE_SERVICE_ROLE_KEY=<supabase_service_role_key>
|
|
|
+# Email Configuration (from https://resend.com/api-keys)
|
|
|
+RESEND_API_KEY=your_resend_api_key
|
|
|
```
|
|
|
|
|
|
### Supabase Database Settings (for pg_cron)
|
|
|
+
|
|
|
Configure in Supabase Dashboard → Project Settings → Database → Custom Postgres Configuration:
|
|
|
+
|
|
|
```
|
|
|
-app.internal_sync_secret = '<same_as_INTERNAL_SYNC_SECRET_above>'
|
|
|
-app.supabase_url = 'https://ztklqodcdjeqpsvhlpud.supabase.co'
|
|
|
+app.internal_sync_secret = 'same_as_INTERNAL_SYNC_SECRET_above'
|
|
|
+app.supabase_url = 'https://YOUR_PROJECT.supabase.co'
|
|
|
```
|
|
|
|
|
|
## Deployment
|