AzoozGAT Platform
Quiz and learning management platform serving live courses. The product I lead day-to-day at AzoozGAT.
The problem
AzoozGAT needed a production learning platform — quiz delivery, role-based access, and payment-gated cohorts — built from the ground up with a small team. The first cut carried real performance debt: a heavy first-load bundle, database reads multiplying under session traffic, and slow course and quiz pages that hurt engagement.
Performance wins
Three optimisations shipped on the platform, shown as relative before/after — the percentages are the real measured figures.
Architecture
- Next.js App Router with server components for static-fast course pages, decoupling quiz content from real-time access checks
- Firebase Auth custom claims as the single source of truth for roles — enforced in middleware, API routes, and every Firestore security rule, so permissions never drift between layers
- Stripe Checkout with idempotent webhooks that update entitlements through Firestore transactions; replays never double-credit a user or strand them mid-flow
- Edge middleware enforces role-based route protection before handlers run — no database round-trip on the hot path
- Bundle work: tree-shook the quiz SDK, lazy-loaded the quiz player via next/dynamic, and split vendor dependencies into shared chunks
- Access tokens cached in custom claims and permission checks batched into a single query to cut per-session reads
Highlights
RBAC across the full stack
Role state lives in one place (Firestore + custom claims); middleware, API routes, security rules, and the UI all derive from it, eliminating permission drift.
Payment-gated entitlements, idempotent by design
Stripe webhooks update access via Firestore transactions with replay protection — payment events never double-credit or leave a user in a broken state.
Static-first performance
Course pages render as static HTML first and hydrate only the interactive quiz player, cutting initial bundle and time-to-interactive.
Impact
−30%
Bundle size, post-refactor
−75%
Fewer database operations per session
−24%
Faster page load times (LCP)