ZS Tech CRM
CRM and operations console

01 / Overview
ZS Tech CRM is the operations console of ZS Tech, a smart home and access control company in Cairo: contacts, a sales pipeline with a quote builder, projects, a price book, and money, in seven modules on 34 tables. I designed and built it alone on Next.js 16 and Supabase.
02 / Problem
ZS Tech sells and installs smart home and access control systems. A deal starts as a contact, becomes a priced quote built from a catalogue of devices and labour, turns into a project on site, and ends as instalments that have to be collected. Spreadsheets lost track of every step.
The team needed one place for that whole path, simple enough to learn in a day, and strict enough that field staff never see cost or margin.
03 / What I built
Seven modules that follow a deal from first contact to the last instalment, built smaller on purpose so the team actually uses every screen.
- Dashboard: cash in and out by month, receivables and overdue, open pipeline, win rate with lost reasons, top products, and deals by source
- Pipeline as a drag and drop kanban and a list, with a deal page per opportunity
- Quote builder: price book, packages, sections, discount and terms, margin per line, a live client preview, and a print view
- Contacts with filters, deals, payments, and notes
- Projects for won deals: tasks, payments, installed devices with warranty, site photos, and handover sign off
- Price book with inline cost and price, a package builder, and multi supplier sourcing with currency conversion
- Money: receivables with instalments and recorded payments, expenses, project profit and loss, and accounts with transfers
- Settings: company and quote rules, user invites with per module access, suppliers, exchange rates, lists, and an activity log
04 / How it works
Row-Level Security is the real boundary, not the UI. Owners edit everything; every other user gets None, View, or Edit per module. Cost and margin columns come back empty for anyone without money access, enforced by database views and column grants, so a field account cannot read a margin even through the API.
Reads go through views and writes through validated server actions on a user scoped client, so the database checks every change again. Seven migrations build 34 tables, 10 views, and 22 functions, and the money maths lives in a pure, unit tested library.
Unit tests cover the calculations, integration tests hit the database as each seeded role to prove the access rules, and a Playwright suite walks the main flows end to end. Uploads go to Cloudflare R2, and the app runs on Vercel.
05 / Outcome
ZS Tech runs its pipeline, quotes, projects, and collections from one console, live on Vercel, with the money rules enforced by the database rather than by the screens.
It is deliberately small: seven modules that match how the business actually works, so every screen earns its place.
06 / Screens




Related writing
- 23 Oct 2026 · 4 min readTesting Supabase access rules as real usersHow I test Row-Level Security by signing in as each seeded user against a local Supabase, plus one Playwright run through the path that makes money.
- 16 Oct 2026 · 5 min readNone, View, Edit: per-module access in SupabaseRoles were too coarse. How one access table, three Postgres functions, and one RLS helper give each user None, View, or Edit on every module.
- 9 Oct 2026 · 5 min readInstalments vs payments: a money model that adds upA payment plan is not a payment. How the CRM separates instalments from receipts, handles partial payments, and always knows what is overdue.