Skip to main content

ROVIK / WORK / 02

IDRAAK

FROM QUESTION BANK TO LEARNING INTELLIGENCE

IDRAAK is an AI-powered education platform designed to connect learning, assessment, performance intelligence and personalised preparation for competitive examinations.

idraak.pk

A student should not only know what they got wrong. The system should help determine what they should do next.

← All work

Executive overview

What was wrong, what ROVIK did, and what changed — then implementation, validation, and technology in the sections below.

01

Challenge

Interactive education products need reliable access control, commerce, and content delivery without trusting the client for entitlements.

  • Subscription and capability entitlements must be server-authoritative
  • Checkout and payment verification across catalogue and regions
  • Complex product surfaces spanning web experience and billing

02

Approach

IDRAAK combines interactive learning experiences with server-authoritative checkout, Stripe verification, and database-driven entitlements.

  • Catalogue validation and payment session verification
  • Webhook verification and idempotent fulfillment patterns
  • Runtime access based on subscription state in the database

03

Outcome

A digital education product architecture where commerce, entitlements, and interactive learning are connected through verified server-side control.

  • Stripe checkout integrated with catalogue and verification flows
  • Entitlements enforced from subscription and capability data
  • Engineering focused on trustworthy payment and access paths

SYSTEM REQUIREMENTS

A SCORE TELLS YOU WHAT HAPPENED. NOT WHAT TO DO NEXT.

Traditional exam preparation often separates study, MCQs, scores, incorrect answers and revision decisions. The student may receive a score but still have to manually determine next steps.

Often separated

  • Study
  • MCQs
  • Scores
  • Incorrect answers
  • Revision decisions

Manual decisions

  • Which topics are weak
  • Whether weakness is persistent
  • What should be revised next
  • How preparation is progressing
  • Whether they are becoming exam-ready
  • How their behaviour changes over time

PRODUCT VISION

A CONNECTED LEARNING SYSTEM.

IDRAAK treats preparation as a continuous journey rather than independent pages — connecting learning activity, student data and intelligence.

STUDENT JOURNEY

STUDY → ATTEMPT → ANALYSE → IMPROVE.

The documented student journey spans discovery through improvement as a connected preparation cycle.

  1. 01 — Discover

    Establish examination context.

  2. 02 — Learn

    Subjects → Chapters → Topics → Subtopics

  3. 03 — Practice

    Answer questions and assessment items.

  4. 04 — Review

    Examine sessions and mistakes.

  5. 05 — Understand

    Identify performance patterns.

  6. 06 — Plan

    Turn performance into preparation.

  7. 07 — Assess

    Use Exam Hall and other assessment flows.

  8. 08 — Improve

    Feed performance back into preparation.

LEARNING ARCHITECTURE

A HIERARCHY THAT GIVES PERFORMANCE CONTEXT.

Structured hierarchy allows performance to be interpreted below the broad subject level.

This structure is designed so weaknesses can be identified with more context than a single score.

Performance signals

  • Accuracy
  • Mastery
  • Historical performance

PERFORMANCE INTELLIGENCE

FROM ANALYTICS TO ACTION.

Documented intelligence-oriented product areas — presented as architecture, not performance results.

Performance data should become actionable information.

  • Learning DNA
  • Knowledge Profiles
  • Mistake DNA
  • At-Risk Topics
  • Adaptive Practice
  • Adaptive Difficulty
  • Daily Mission
  • Exam Readiness
  • Personalised Preparation
  • Weakness Attack
  • Progress Reassessment

Learning DNA

The current Learning DNA implementation is rule-based rather than itself being an LLM-generated profile.

  • Topic mastery
  • Accuracy
  • Performance trends
  • Weak areas
  • Recent activity
  • Preparation context
  • Next-action information

IDRAAK AI

AI WITH CONTEXT.

The AI Tutor is designed as a contextual learning assistant rather than a generic chatbot.

CONTEXT-AWARE AI

Context-aware AI

Server-side context is assembled from documented learning, performance and preparation signals before a tutor response is generated.

  • Examination
  • Subject
  • Chapter
  • Topic
  • Subtopic
  • Question
  • Student's selected answer
  • Correct answer
  • Topic mastery
  • Accuracy
  • Performance summary
  • Weakest topic
  • Next action
  • Learning DNA signals
  • Recent session information
  • Streak
  • Level

Context assembly follows documented server-side patterns such as buildTutorContext where applicable.

Controlled question context

The AI architecture deliberately restricts what question information can be supplied to the model. A valid sessionQuestionId is required when contextualising an MCQ rather than accepting an arbitrary questionId.

  • Payment data
  • Authentication tokens
  • Unrelated student records
  • Database explanations intentionally not exposed to the model

AI conversation model

  • Multi-turn conversations during a session
  • Browser maintains conversation history
  • Relevant history is sent back to the server
  • Configured maximum is currently 20 turns by default

Conversations are session-only in the current implementation — they are not currently persisted as permanent student chat history.

ASSESSMENT

MORE THAN ONE KIND OF TEST.

Assessment experiences serve different roles across practice, diagnostics, simulation and review.

  • Practice
  • Test sessions
  • Exam Hall
  • Monthly Tests
  • Exam Pressure
  • Diagnostic assessment
  • Grand Test
  • Competitive benchmarking
  • Leaderboards
  • Review
  • Results
Practice
Ongoing learning
Diagnostic assessment
Establish a starting picture
Exam simulation
Examination-oriented conditions
Review
Understand performance after an attempt
Benchmarking
Comparative assessment experiences

Knowing the material and performing under examination conditions are related but different problems.

IDRAAK includes a dedicated exam-oriented experience rather than treating preparation purely as knowledge acquisition.

STUDY PLANNING

From activity to plan

Performance intelligence is designed to feed preparation recommendations and study planning.

Study planning is accessible via /study-plan within the application.

SUBSCRIPTIONS

CAPABILITIES, NOT JUST PLAN LABELS.

Runtime entitlements are based on active student subscriptions and subscription_plan_capabilities. The database is the runtime authority for access.

Foundation

basic

Core learning

Momentum

test

Practice/testing capabilities

Mastery

premium

Expanded assessment capabilities

Apex

complete

Full capability set including AI Tutor

Plan labels map to capability sets — access is enforced from subscription state, not UI visibility alone.

Entitlement security

Protected functionality uses server-side guards. The AI Tutor API independently verifies entitlement before an AI request is made.

PAYMENTS

PAYMENT STATE IS VERIFIED SERVER-SIDE.

  • Server-authoritative checkout intents
  • Database/catalog pricing
  • Stripe Checkout
  • Webhook signature verification
  • Server-side Stripe session verification
  • Payment tracker matching
  • Idempotent fulfillment
  • Database-controlled entitlements

Stripe currency engineering

The public catalogue uses whole PKR values (e.g. PKR 4,999). Stripe expects amounts in minor units. The implementation converts when creating Stripe Checkout line items and normalises Stripe's returned amount when verifying payment. A mismatch was identified and fixed; the production build subsequently passed.

DATABASE & AUTH

AUTHENTICATION AND DATA LAYER.

  • Supabase Postgres
  • Row Level Security
  • PostgreSQL functions / RPCs
  • SECURITY DEFINER where required
  • Server-side authentication
  • Entitlement queries
  • Protected payment mutations

Supabase Auth + SSR

  • Registration
  • Login
  • Authenticated sessions
  • Protected learning pages
  • Protected assessment pages
  • Protected AI functionality
  • Subscription-aware access

CONTROL CENTRE

THE OPERATING SYSTEM BEHIND THE LEARNING PRODUCT.

IDRAAK is not only a student-facing application — operational tooling supports subscriptions, assessments, intelligence and configuration.

  • Students
  • Subscriptions
  • Payments
  • Checkout
  • Plans
  • Assessments
  • Intelligence
  • Teachers
  • System health
  • Audit logs
  • Configuration

Intelligence areas

  • Adaptive Practice
  • Adaptive Difficulty
  • Learning DNA
  • Mistake DNA
  • Exam Readiness
  • Personalised Preparation
  • Weakness Attack
  • AI Tutor

ENGINEERING

CONNECTING THE SYSTEMS.

Engineering work focused on connecting learning, intelligence, entitlements, payments and AI context into one coherent product.

  1. 01Connecting intelligence to learning

    Question → Topic → Performance → Mastery → Weakness → Preparation

  2. 02Entitlement security

    Access must be enforced beyond frontend UI.

  3. 03Payment integrity

    Server-authoritative checkout, catalogue validation, Stripe verification, webhook verification and idempotent fulfillment.

  4. 04AI context

    How can an AI tutor understand where the student currently is in preparation?

  5. 05Product complexity

    Learning, assessments, intelligence, subscriptions, payments, AI and operations became interconnected.

ROVIK / CONTRIBUTION

TURNING THE PRODUCT IDEA INTO CONNECTED SYSTEMS.

ROVIK contributed to the product's design and engineering across the application architecture, learning experience, student intelligence, subscription system, payment infrastructure and AI-assisted learning layer.

  • Application architecture
  • Student learning flows
  • Assessment architecture
  • Performance intelligence
  • Entitlement architecture
  • Subscription implementation
  • Stripe payment integration
  • Production deployment
  • AI Tutor architecture
  • Contextual AI integration
  • Administrative / control-centre tooling
  • Production debugging and verification

TECHNOLOGY

THE STACK BEHIND IDRAAK.

Next.js 16.3 · React 19 · TypeScript · PostgreSQL / Supabase · Supabase Auth · Next.js App Router · Stripe · Vercel · OpenAI provider architecture · npm

The documented production build contains approximately 176 API route handlers.

CURRENT STATE

A PRODUCTION EDUCATION PLATFORM, NOT A LANDING PAGE.

Documented current application areas span learning, assessment, intelligence, subscriptions and operations.

  • Authentication
  • Student dashboard
  • Structured learning
  • Practice
  • Performance
  • Study planning
  • Exam Hall
  • Exam Pressure
  • Diagnostics
  • Leaderboards
  • Subscription management
  • Capability-based access
  • Stripe payments
  • Webhooks
  • Payment verification
  • Control Centre
  • Student intelligence
  • Learning DNA
  • Personalised preparation
  • AI Tutor architecture

The documented production build has been successfully compiled and deployed to idraak.pk.

Don't assume a feature works because the UI looks correct. Verify the underlying state and workflow.
  • Subscriptions
  • Payment status
  • Stripe fulfillment
  • Entitlements
  • AI access
  • Database state
  • Production configuration

The UI once displayed a stale payment-pending state even though membership was already active. The fix corrected the underlying state relationship rather than simply hiding the message.

DELIVERY & EVIDENCE

FROM QUESTION BANK TO LEARNING INTELLIGENCE

IDRAAK began with the familiar problem of examination preparation: students need content, practice questions and tests. The engineering challenge was connecting those pieces. The resulting architecture allows learning activity to feed performance intelligence, performance intelligence to inform preparation, and preparation to become context for further learning and AI assistance.

What did I score?

What does my performance tell me, what should I work on next, and how can the platform help me get there?

Have somethingworth building?