Bilingual CRM for customers, leads and support
An Arabic and English CRM for customers, leads, activities and support tickets with role-based access, Excel import and a reports dashboard, built in Next.js and also delivered in plain PHP and MySQL.
The problem
A business needed customer records, new leads, every call, email and WhatsApp follow-up, and support tickets in one system that staff can use in Arabic or English, with admin and employee permissions kept separate. A written system description set the scope, including a planned link to a case management system later.
How I built it
I built it in Next.js with TypeScript, PostgreSQL and role-based sign-in. It covers customers, leads with one-click conversion to a customer, activities, tickets with message threads, notifications, attachments, global search and an analytics dashboard, and customers and leads can be imported in bulk from Excel or CSV. Pagination, filters, dark mode and loading states went in as a second phase. I also produced a plain PHP and MySQL build with the same eight tables and screens.
What got hard
- The first hosted deployment fought back for an afternoon.
On 31 January 2026 the hosted database connection kept failing. A one-letter difference in the database host name (.co instead of .com) sat behind it, and I found it by building a setup route that tested DNS, raw sockets and pooler address variants. Table creation and bulk import followed the same day.
- Prisma and the Vercel build did not get along at first.
I fixed client generation on the Vercel build, dropped the forced binary engine, removed a base path that caused a 404 on the root domain, and moved runtime queries to a lightweight Postgres client while keeping Prisma for the schema.
- The public demo crashed on one page.
Seed data from an earlier seven-stage lead pipeline did not match the current four-stage model, which broke the leads page. I remapped the seed data and added an allow-list on create and update so an unknown status can never reach the store.
- Two stacks for one product.
The PHP build reproduces the same eight tables, bilingual screens and Excel import so the client can run it on hosting that offers PHP and MySQL.
The result
Delivered as a Next.js app and as a PHP and MySQL build. The Next.js version is live as a public demo with sample data (33 commits from 27 January to 10 August 2026).
The ← and → keys turn the page too.