SaaS2026
QTrust
A multi-tenant SaaS for Quranic schools, with an AI admin agent that asks before it writes.
- Role
- Solo: product, design and engineering
- Year
- 2026
- Stack
- Next.js 16, React 19, MongoDB, NextAuth, next-intl, Zod, Groq, Upstash, Expo
- Links
- Live productSource

The problem
Quranic associations and Hifz schools run on paper registers, WhatsApp groups and spreadsheets. Attendance, schedules, family billing, admissions and memorisation progress are all tracked by hand, usually by volunteers.
What I built
- QR attendance from a tablet app (Expo), scheduling, family billing, admissions and Hifz tracking in one place.
- Arabic, French and English with full right-to-left support: 1,313 translation keys.
- Multi-tenant from the data model up: plans, entitlements, billing and an audit log per school.
- An AI admin assistant that answers questions about the school and prepares actions across every module.
How it earns trust
Writes wait for a human
The agent has 43 function-calling tools: 19 read-only and 24 that write. A write never executes directly. It becomes a pending action that an admin approves or rejects.
Every argument is checked
Tool arguments are validated against Zod schemas before anything runs, so a malformed or invented field is rejected instead of written.
Untrusted input stays untrusted
The system prompt has an explicit section on handling untrusted data, and every AI call goes through a per-school quota, a token ledger and an audit trail.
Isolation before features
Moving to multi-tenant, a written audit found about 70 unscoped queries and 16 models without a tenant ID. Isolation was fixed before any AI feature shipped. 28 models now carry a tenant ID.
By the numbers
- agent tools
- 43agent tools
- writes gated by human approval
- 24writes gated by human approval
- tenant-scoped models
- 28tenant-scoped models
- translation keys (AR, FR, EN)
- 1,313translation keys (AR, FR, EN)
How it fits together
- AdminasksAI assistant
- AI assistantruns directlyRead tools
- AI assistantproposes writesPending actions
- Pending actionsapprove or rejectAdmin
- Pending actionsexecutes after approvalMongoDB


What I'd do next
Wrap the approval flow in an automated test suite. Today it's covered by a written QA plan and an 18-defect QA sweep, which isn't enough for something that writes to billing.