Documentation & Setup Guides

Technical architecture, Supabase RLS migrations, PayPal Invoicing v2, and Gemini Function Calling

COLLECTWISE AI Architecture Overview

TAGLINE: Get Paid Faster. Let AI Handle the Follow-ups.

COLLECTWISE AI is a multi-tenant financial SaaS platform built with the Next.js 15+ App Router, engineered for frictionless serverless deployment on Vercel.

# Core Flow Architecture:
1. Client Browser (React 19, Tailwind CSS, Recharts)
2. Next.js Route Handlers (app/api/* on Node.js runtime)
3. Supabase PostgreSQL (11 tables with Row Level Security via auth.uid())
4. PayPal REST Invoicing API v2 (https://api-m.sandbox.paypal.com)
5. Google Gemini 3.8 Flash SDK (@google/genai with Function Calling & 8 Tools)

Security & Financial Boundaries

Zero Secret Exposure

Neither SUPABASE_SECRET_KEY, PAYPAL_CLIENT_SECRET, nor GEMINI_API_KEY are ever sent to browser bundles.

Authoritative Payment Verification

AI models cannot declare invoices paid. Only verified PayPal API responses or signed webhooks transition status to PAID.

Open Source Architecture & LicensingMIT LICENSE

COLLECTWISE AI is completely open source under the permissive MIT License. Developers and organizations are free to audit, self-host on Vercel, integrate their own PayPal sandbox or live accounts, connect Supabase databases, and modify source code freely.