System Design
A layered breakdown of how NICK AI is structured — from the React frontend to backend functions, automations, data model, and third-party integrations.
The end-to-end journey a prospect takes through the system:
Lead Discovery
AI Search or Hulk Mode finds prospects via LLM + internet search → creates TradingCardShop records
Enrichment
Website scrape extracts email, phone, AI summary, lead score → updates shop record
Outreach
Mass email or campaign sends personalized email via Resend with tracking pixels injected
Tracking
Open/click pixel fires → trackEmail function → updates shop engagement metrics
Follow-Up
Scheduler checks ScheduledFollowUp records daily → sends follow-up emails automatically
Inbox
Replies captured in Conversation entity → AI suggests response → rep takes action
Convert
Status updated to "client" → deal value set → shows in MRR/ARR dashboard metrics
Frontend
React 18 + Vite + Tailwind CSS
Routing
React Router v6 (/:tenantSlug/*)
State / Data
TanStack Query + React Context
Backend
Deno Deploy (serverless functions)
Database
Base44 Entity Store (NoSQL)
Resend (send + webhooks)
AI
Base44 InvokeLLM (OpenAI / Anthropic / Google)
Voicemail
VoiceDrop.ai (RVM)
SMS
Twilio
Lead Data
Snov.io + Hunter.io
Auth
Base44 built-in (JWT sessions)
Hosting
Base44 Platform
Click each layer to expand its components and details.
Tenant Isolation
Every query filters by tenant_id. No cross-tenant data leakage possible at the application layer.
Snapshot on Open
Modals that perform multi-step operations (mass email) snapshot their data at open time — background refetches cannot interrupt in-flight operations.
Optimistic Updates
ShopDetailModal patches the React Query cache immediately on save, then reconciles with server truth via invalidation.
Serverless Functions
Each backend function is a self-contained Deno handler. No shared imports — deployable independently.
AI-First Personalization
Every outreach email, proposal, and voicemail script is generated fresh using the shop's AI summary + tenant business intelligence.
Automation Layers
NICK Mode = single-tenant manual trigger. Hulk Mode = all-tenant scheduled automation. Both share the same 5-step pipeline logic.
Email Health Guardrails
EmailHealth entity tracks bounce/spam/unsubscribe rates. Daily send limits enforced to protect sender reputation.
Progressive Enrichment
Shops start with basic info and accumulate data over time: web scrape → LinkedIn → Google Business → email opens/clicks → call notes.