System Settings & Integrations
PHASE 3D ARCHITECTUREAudit backend database linkages, PayPal Sandbox REST API v2 connectivity, Gemini AI Copilot engine, and demo environment health
PayPal REST API (Orders v2 Sandbox)
api-m.sandbox.paypal.comTo connect your real PayPal Developer Sandbox account, visit PayPal Developer Dashboard and configure:
PAYPAL_CLIENT_ID=<your-sandbox-client-id>
PAYPAL_CLIENT_SECRET=<your-sandbox-client-secret>
PAYPAL_BASE_URL=https://api-m.sandbox.paypal.com
Secrets are stored server-side only and never transmitted to the browser.
Supabase PostgreSQL Database
@supabase/supabase-js (v2)- 001_initial_schema.sqlCore Schema, Tables & Read-Only RLS
- 002_paypal_sandbox_integration.sqlPayPal Capture & State Columns
- 003_paypal_webhooks.sqlWebhook Events Ledger & Anon Lockdown
- 004_paypal_webhooks_security.sqlSecurity Invoker View & Atomic Claims
- 005_persistent_approvals.sqlMulti-Tenant Approvals & Atomic RPC
• Public Access: Direct write revoked on all tables. Anon read restricted.
• Tenant Isolation: Authenticated reads enforce business_id = auth.jwt().
• Webhook Protection: Raw table locked; public view uses security_invoker = true.
• Service-Role Operations: Approval decisions run atomic single-transaction RPC decide_approval_atomic.
The application operates on an in-memory transactional store with identical atomicity and rollback guarantees when environment variables are unconfigured. To link a live Supabase project, define NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY in .env.local.
Demo Environment State
Phase 3D Active · Sandbox TestbedAll data records, payments, and customers displayed in the UI are synthetic. No real financial credentials or payment cards are stored or charged.
AI Integration & Copilot Engine
Google Gemini & Tool OrchestratorAI chat prompts are processed through server-side function calling with Gemini. When a live API key is unconfigured, requests seamlessly fall back to the deterministic tool engine without leaking credentials.