Minimal overview. See QUICK_START.md for dev flow; this README focuses on Production Setup readiness.
- Domains
- Frontend:
snuggleup.co.za(A/AAAA or CNAME to host) -> verify HTTPS. - Backend/API:
api.snuggleup.co.za(CNAME to Render service) -> verify HTTPS.
- Frontend:
- Environment Variables (Backend)
BACKEND_URL=https://api.snuggleup.co.zaFRONTEND_URL=https://snuggleup.co.zaPAYFAST_TEST_MODE=false(after live switch)PAYFAST_MERCHANT_ID,PAYFAST_MERCHANT_KEY,PAYFAST_PASSPHRASECJ_EMAIL,CJ_API_KEY,USD_TO_ZAR(e.g. 18.50)SUPABASE_URL,SUPABASE_ANON_KEY
- Environment Variables (Frontend - Vite)
VITE_API_BASE=https://api.snuggleup.co.za/api
- Supabase Redirects
- Add both domain URLs (frontend + backend) under Authentication -> URL Configuration.
- PayFast Dashboard
- Set return/cancel/notify URLs to:
https://api.snuggleup.co.za/api/payments/success|cancel|notify.
- Set return/cancel/notify URLs to:
- Analytics & SEO
- GA4 Measurement ID in
frontend/index.html. - JSON-LD organization node uses production domain/logo.
- GA4 Measurement ID in
- Shipping & Orders
- Ensure curated products include CJ variant IDs for freight quotes & future auto-order.
- Confirm
USD_TO_ZARis updated daily/weekly.
GET https://api.snuggleup.co.za/api/health
Returns JSON with readiness flags (DB, PayFast live creds, CJ auth config, env URLs).
- User redirected to PayFast via /api/payments/create.
- PayFast posts IPN to
/api/payments/notify. - Server:
- Rebuild signature (alphabetical params + optional passphrase).
- Server-to-server validation against PayFast validate endpoint.
- Updates order status (
paid,failed,pending).
- Point domains & wait for HTTPS.
- Set backend env vars (above list) & redeploy.
- Set frontend
VITE_API_BASE& rebuild. - Flip
PAYFAST_TEST_MODE=false; add live merchant creds/passphrase. - Update Supabase redirect URLs.
- Hit
/api/health-> verifyready.payfastLiveReady=true. - Perform a small live transaction (low-priced test item) & confirm order status becomes
paid.
- Implement CJ auto-order on successful PayFast IPN (call
cjClient.createOrder). - Add address capture & pass logisticName / variant mapping.
- Add email notifications (order confirmation, shipping updates).
Refer to DEPLOYMENT_CHECKLIST.md and payfast_README.md for deeper detail.