Skip to content
Ahtisham
All projects
Mobile App2025Featured

STEMQuiz

Competitive STEM Quiz Platform

  • Production
  • On stores
  • iOS
  • Android
  • Web
  • Full Stack

The problem

A timed, competitive STEM quiz app needs monetization that users cannot bypass and billing that stays consistent across client and server.

Full-stack competitive quiz platform — RN + Expo client, Express/Postgres backend, with server-authoritative monetization, anti-fraud billing, and a full admin CMS.

STEMQuiz mobile app — a multiple-choice quiz screen, home dashboard with XP and daily challenge, and a global leaderboard.

Overview

Cross-platform (iOS / Android / web) app for timed, competitive quizzing across Science, Technology, Engineering, and Math — ~33.5k lines of TypeScript across a React Native client and an Express backend.

Built a server-authoritative tier system (Guest / Free / Premium) enforced entirely server-side, not on client trust. Guests get one quiz per subject for life (permanent DB lock); Free users get one quiz per subject per rolling 24h and must hit ≥70% accuracy to unlock the next level; Premium is unlimited — each gated path returns a distinct 403 code (GUEST_LIMIT, LOCKED_24H, LEVEL_LOCKED…).

Engineered anti-fraud billing reconciliation: resolveUserTier() cross-checks the JWT tier against the DB on every request, and on mismatch sends a refresh header so the client silently self-heals its stale token (rate-limited to 1/45s). Log sentinels ([TIER_MISMATCH], [PREMIUM_BYPASS], [PREMIUM_BLOCK_ERROR]) separate auto-healed cases from real billing desyncs.

Shipped deep gamification — XP, coins, daily streaks with milestone rewards, weekly-XP leagues, coin-based lifelines (50:50, Hint, Pause, Double Attempt), 14 auto-awarded badges, exam mode, and a 3-tier explanation system gated for monetization.

Added growth/conversion engineering: a paywall A/B copy experiment (variant assigned + persisted, separate convert/view logging), free-tier interstitial + rewarded ads (premium/guest excluded), and a first-4-days retention banner loop.

Production ops: request correlation IDs, slow-request + p95 latency tracking with [DEGRADED] alerts, feature flags (EMAIL_ENABLED, FEEDBACK_ENABLED), and a 38-check regression gate that builds, boots, and tests the server before deploy.

Admin panel is a Tailwind SPA with role-based permissions, content/event/leaderboard management, a badge studio, fraud monitoring, Excel bulk question import, bulk user actions, and email-campaign sending.

What I built

  • Built the React Native + Expo client and the Express/PostgreSQL backend — ~33.5k lines of TypeScript across both.
  • Engineered a server-authoritative Guest/Free/Premium tier system enforced entirely server-side, with distinct 403 codes per gated path.
  • Implemented anti-fraud billing reconciliation that cross-checks the JWT tier against the DB and silently self-heals stale client tokens.
  • Shipped deep gamification (XP, coins, streaks, leagues, lifelines, 14 badges), a paywall A/B experiment, rewarded ads, and a full admin CMS.

Highlights

  • Server-authoritative 3-tier monetization (Guest/Free/Premium) with distinct 403 codes
  • Anti-fraud billing reconciliation with silent client token self-heal
  • Deep gamification: XP, coins, streaks, leagues, lifelines, 14 badges
  • Paywall A/B experiment, rewarded ads, retention banner loop
  • Production ops: correlation IDs, p95 latency alerts, feature flags, 38-check regression gate
  • Admin CMS: role-based permissions, badge studio, Excel import, email campaigns
  • iOS + Android + web shipped to stores