Skip to content
malekverse
All work

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
QTrust, live product

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

  1. AdminasksAI assistant
  2. AI assistantruns directlyRead tools
  3. AI assistantproposes writesPending actions
  4. Pending actionsapprove or rejectAdmin
  5. Pending actionsexecutes after approvalMongoDB
QTrust QR attendance: a student holds a card to the tablet camera and is checked in
QTrust on a phone, in Arabic with right-to-left layout

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.

malekverse

© 2026 Malek Maghraoui. Built with Next.js, three.js and GSAP.

Every color on this site is a star temperature, from 3,200 K to 30,000 K. There are no green stars.