Multi-tenant Next.js portal for surplus funds recovery operations. Built for Moss Equity Partners, designed for public SaaS release.
- Next.js 16 (App Router) on Vercel
- Supabase Postgres (multi-org RLS) for data, auth, and storage
- React 19, Tailwind 4
- Resend (transactional email)
- Gmail OAuth + Cloudflare Worker poller (inbound mailbox sync)
- Lob (check and letter sending)
- OpenPhone / QUO (SMS, via separate Cloudflare Worker)
- SuperDoc + Tiptap (in-app document editing)
- Node 22+
- npm
- Supabase CLI (already a devDependency, invoked via
npx supabase) - A Supabase account with two projects: staging + production
- A Vercel account, project linked to this repo
-
Clone and install:
git clone https://github.com/bmoss2015/MossEquityPartners.git cd MossEquityPartners npm install -
Copy the env template and fill in values from the staging Supabase project:
cp .env.example .env.local -
Verify the Supabase CLI is linked to staging, not production:
cat supabase/.temp/project-refOutput should be
qfanroxcoepunmrmjabo. If not:npx supabase link --project-ref qfanroxcoepunmrmjabo -
Start the dev server:
npm run devOpen http://localhost:3000.
Login credentials for the staging tenant live in CLAUDE.md.
npm run dev— local dev servernpm run build— production build (note: type errors currently suppressed in next.config.ts pending cleanup)npm run start— start the built appnpm run lint— ESLintnpm run typecheck—tsc --noEmit
See CLAUDE.md for the full branch → PR → preview → merge → auto-deploy workflow. Short version:
- Branch off main:
git checkout -b <type>/<short-name>(never commit to main directly) - Push the branch, Vercel auto-builds a preview URL
- Open the PR with
gh pr create - Confirm the change on the preview URL
- Merge with
gh pr merge <n> --merge --delete-branch - Vercel auto-deploys main to production within seconds
CLAUDE.md— standing instructions, env map, deploy flow, design system, business rulesARCHITECTURE.md— one-page topology and data model referenceRUNBOOKS.md— what to do when X breaksdocs/— original product spec and reference material
| Staging | Production | |
|---|---|---|
| Supabase project | qfanroxcoepunmrmjabo | rsdmyydyhqgkkvwlklif |
| Dev URL | http://localhost:3000 (or Vercel preview) | https://app.nextsurplus.com |
| Vendor mode | Test / sandbox keys | Live keys |
workflow-minds-quo-poller— Cloudflare Worker, polls OpenPhone for inbound SMS verification codesmoss-equity-email-poller— Cloudflare Worker, drives Gmail mailbox sync every 2 minutes