AI CRM¶
Repo: savvydealer-adam/ai-crm · Path: C:/Users/adam/ai-crm · Owner: Adam
Status: Live · % Done: 85 · Last commit: 2026-04-13
Deployed: https://crm.savvydealer.com
What it is¶
SavvyDealer's internal CRM of record: dealers, contacts, products-in-use, billing, MRR, and a QuickBooks Online-backed financial dashboard. This is how we run the agency.
Why it exists¶
Off-the-shelf CRMs didn't model dealership-specific data (rooftops, OEM, digital products per store) and didn't unify sales, delivery, and finance in one place. The AI CRM is the single pane of glass for the SavvyDealer team.
How it works¶
Stack: React + Vite + TS (client), Express + TS (server), Drizzle ORM, Supabase Postgres (project omsvmmrgvvwpuxdetrhd), Cloud Run.
- Multi-tenant dealership model with product assignments (dealership_products) driving MRR math
- QBO integration (server/routes/quickbooks.ts + server/services/quickbooks.ts) with auto-refresh tokens and retry-on-401
- Hourly scheduler (server/services/scheduledInvoices.ts) creates future-dated QBO invoices on the scheduled go-live date
- Financial access middleware (server/middleware/financialAccess.ts) restricts MRR/expense data to a whitelist
- CI/CD: push to main triggers Cloud Build ai-crm-deploy → Cloud Run ai-crm
What's done¶
- Dealership/contact/product CRUD with super-admin and role-based access
- QuickBooks OAuth + bidirectional sync (invoices, payments, expense category write-back)
- Financial dashboard: MRR trend (12mo), MRR by product/dealer, expense breakdown, cash-vs-expected reconciliation, subscription detection
- Hourly scheduled-invoice processor for future-dated billing
- AI CRM REST API with X-API-Key auth (consumed by
dealership-intel, scrapers, etc.) - QBO token resilience (proactive 30-min refresh + retry-on-401)
What's next¶
- More reporting cuts (churn, dealer LTV, product margin)
- Deeper integration with
dealerpulseandcontractsso a signed deal auto-provisions a product + a scheduled invoice - CRM → analyst-persona handoff for QBRs
Where the code lives¶
- Entry:
server/index.ts - QBO:
server/routes/quickbooks.ts,server/services/quickbooks.ts,server/services/scheduledInvoices.ts - Financial:
server/routes/financial.ts,client/src/pages/Financial.tsx - Deploy:
cloudbuild.yaml,Dockerfile, triggerai-crm-deploy
Integrations¶
- QuickBooks Online — source of truth for customers/products/invoices (CRM links only, never creates QBO records)
- dealership-intel — pushes enriched dealer contacts in via API key
- contracts — signed contracts should provision CRM products
- Supabase — shared auth/DB
Don't rebuild this — extend it¶
All agency operational data (dealers, MRR, invoices, contacts) lives here. Do not spin up a second CRM — build on the AI CRM API and its Supabase schema.