The brief
GDF Internationals needed one CRM to replace spreadsheets across a high-volume telemarketing floor — Admin ingestion and payroll, Employee dialers, Advisors closing qualified leads, and Case Assessors running compliance checks.
The constraint was shared hosting: ~768MB memory caps, heavy aggregate queries on 40K+ growing lead pools were pegging CPUs and dashboard loads were taking 5+ seconds.
What I built
Next.js 16 + React 19 + Prisma 6 + MongoDB with proxy gating (`/src/proxy.ts`), multi-tier OTP auth, and role-partitioned App Router layouts for admin, employee, advisor, and case-assessor workspaces.
Performance layer: `DashboardStats` L2 snapshots with stale-while-revalidate, slim list projections, delta sync polling via `useVisibilityPolling`, and a client-side `LeadSaveQueue` that serializes patches per lead ID.
Operational modules — attendance review, leave requests, Cloudinary document uploads, compliance checklists, and a commission payroll processor with leaderboards.
Outcome
Dashboard response times dropped from ~5.5s to 100–300ms. Agents work concurrent boards without last-write-wins collisions; background tabs no longer storm the database.
Live deployment is private (confidential client). Happy to walk through the schema, snapshot architecture, or screen-record the admin tour for serious enquiries.