All implementations

Next.js + Supabase

structural

Next.js App Router front-end against Supabase (Postgres + Auth + Storage). Row-Level Security policies enforce per-workspace tenancy. Inngest runs scheduled email sequences.

For spec: CRM Platform

Frontend
Next.js 15
Backend
Next.js route handlers
Database
Postgres (Supabase)
Auth
Supabase Auth
Hosting
Vercel
storage
Supabase Storage
jobs
Inngest
4 tables1 routes1 modules3 packages3 env vars1 feature uncovered

Packages

next^15
@supabase/supabase-js^2
inngestScheduled email sequences

Environment

NEXT_PUBLIC_SUPABASE_URLrequired
NEXT_PUBLIC_SUPABASE_ANON_KEYrequired
SUPABASE_SERVICE_ROLE_KEYrequired

Feature implementations

Audit Logging

audit-logging

Postgres trigger writes to audit_log on changes to tenant tables.

Tables

audit_log8 fields
  • idbigint
  • workspace_iduuid
  • actor_iduuid
  • actiontext
  • target_tabletext
  • target_idtext
  • diffjsonb
  • created_attimestamptz

File Storage

file-storage

Supabase Storage bucket per workspace. Signed URLs for downloads.

Notifications

notifications

In-app toasts + digest emails via Resend + Inngest cron.

Tables

notifications5 fields
  • iduuid
  • user_iduuid
  • kindtext
  • payloadjsonb
  • read_attimestamptz

Roles & Permissions

roles-permissions

RLS policies on every tenant table: USING (workspace_id IN (SELECT ...)).

Policies live in `supabase/migrations/*_rls.sql`. Keep them in sync with any new tenant-scoped table.

Search

search

Postgres tsvector over contact.name, company.name, deal.title.

Routes

GET/search

Transactional Email

transactional-email

Resend for single sends; Inngest functions for sequences.

Modules

  • inngest/functions/email-sequence.ts N-step drip campaign

User System & Auth

user-system

Supabase Auth; a workspaces table + workspace_members for team access.

Tables

workspaces3 fields
  • iduuid
  • nametext
  • owner_iduuid
workspace_members3 fields
  • workspace_iduuid
  • user_iduuid
  • roletext

Uncovered features

The spec includes features this implementation doesn't describe. Contributions welcome.

Onboarding & Activation