Platform guide · for engineers, admins and technical partners

How MockPrepAI works under the hood

Who uses it, every feature area, the exam and institute flows, the architecture and data model, and how it ships to production, with diagrams and real screens.

mockprepai.in
Admin control center with platform KPIs

01 · Overview

An online mock-exam platform for Indian competitive exams

Aspirants take full-length timed papers that follow the official syllabus and marking scheme, then get a scored breakdown, a notebook of their mistakes and targeted drills. Coaching institutes run their own proctored exam sessions for their batches on the same engine.

Screens in the web app

49

API endpoints

183

Database tables

55

Automated tests

329

208 backend · 121 end-to-end

Seeded exam

Kerala PSC LDC 2026–27

Questions
100
Duration
75 min
Correct
+1.00
Wrong
−0.33

The platform is multi-exam: UPSC, SSC, Banking, Railways and state PSCs can each be configured with their own sections, blueprint and marking. It runs at mockprepai.in (web app) and api.mockprepai.in (API), in English and Malayalam, with light, soft and dark themes.

02 · Who uses it

Three audiences, one engine

Every account has a platform role. Institute members also have an institute role, which is separate: a student of a coaching centre is an ordinary candidate account linked to that institute.

Candidates

Aspirant · Pro aspirant

Practise, review and track progress.

Coaching institutes

Institute admin · Content manager · Exam controller · Student

Run branded, proctored exams for batches.

MockPrepAI team

Content editor · Exam manager · Admin · Super admin

Build exams, manage accounts and the platform.

Platform roleWhat it can do
AspirantBrowse exams, take mocks, results and history, mistake notebook, saved questions, analytics and Mock Duels. Limited to each exam's free-mock quota unless Pro or the exam bundle is owned.
Content editorBackoffice access: edit mock-exam questions, upload documents, list and resolve reported questions.
Exam managerEverything above, plus exams, sections and topics, mock papers, AI exam skills and AI generation.
AdminEverything above, plus user management (create, edit, reset passwords, grant Pro) and Excel/JSON imports.
Super adminEverything, plus institutes, platform settings and maintenance tools. Only a super admin can create or promote another super admin.
Institute roleWhat it can do
Institute adminFull institute console, including adding staff, bulk importing students from Excel and editing or removing members.
Content manager, exam controllerBranding, batches, member list, institute mock papers, scheduled sessions and reports.
StudentTheir scheduled exams, the exam lobby, history and answer keys, performance and batch details.

03 · Candidate features

What an aspirant gets

The candidate portal is organised into Practice (dashboard, exams, duels) and Review (history, mistakes, saved questions, analytics). All diagnostic tools are free; the paid limits are the per-exam mock quota and the printable answer-key booklet.

Exam catalogue

Search and filter by authority, conducting body, category and qualification. Exams with no ready papers show as Coming Soon.

/exams

Exam room

Server-timed paper with question palette, mark for review, clear answer, autosave, pause and resume, fullscreen and question reporting.

/attempt/[id]

Scorecard

Score, accuracy, time-pacing breakdown, section results and full solution review by correct, incorrect or unanswered.

/results/[id]

Attempt history

Every past attempt is kept, with retake and PDF download. History is unlimited for everyone.

/dashboard/history

Mistake notebook

Wrong answers are logged automatically with how often each was missed. Add notes, mark mastered or launch a drill.

/dashboard/mistakes

Saved questions

Bookmark any question from the scorecard. Questions marked for review are saved automatically on submit.

/dashboard/saved-questions

Analytics

Readiness score, score trend, and topic, section and difficulty mastery, overall or per exam.

/dashboard/analytics

Mock Duels

Challenge a friend by email to the same paper at a set time, then compare results. Free for all.

/dashboard/challenges

mockprepai.in/exams
Exam catalogue

Exam catalogue with search and filters

mockprepai.in/exams/kerala-psc-ldc-2026
Exam page with mocks

Exam page: key facts and the mock series

mockprepai.in/dashboard/history
Attempt history

Attempt history with retakes and scorecards

mockprepai.in/dashboard/challenges
Mock Duels

Mock Duels: challenge a friend to the same paper

04 · Taking an exam

From Start to scorecard

The server is the source of truth for time and scoring. The browser saves answers as the candidate goes and keeps a local backup until the submission succeeds, so a dropped connection doesn't lose work.

Scoring

Each question carries its own marks and penalty from the paper. Negative marking applies only when the exam version enables it.

score = Σ marks(correct) − Σ penalty(wrong)

Readiness score

One 10–98.5 figure on the dashboard that blends average score, accuracy and how many mocks were taken.

clamp(10, 98.5, 0.5·score + 0.4·accuracy + volume)

Time pacing spectrum

The scorecard sorts every answered question by how long it took.

Quickunder 30 s
Optimal30–75 s
Time sinkover 75 s

05 · Practice & duels

Turning mistakes into practice

Launch Mistake Drill builds a short personal paper from up to 20 unresolved mistakes. Drills are private and never appear in anyone else's mock list. A Mock Duel moves through these states:

  1. Pending

    Challenge sent by email

  2. Scheduled

    Accepted; a new time can be proposed

  3. In progress

    A player joins within 5 min of the start

  4. Completed

    Both submitted, results compared

Can also end asRejectedby the recipientCancelledbefore it startsForfeitedjoin window passed

Finished duels (completed or forfeited) are locked and can't be cancelled, rejected or rescheduled. Only the two players and admins can see a duel's result.

06 · Institute platform

Proctored exams for coaching centres

A super admin creates an institute and its first admin. The institute then manages its own courses, batches, members, private mock papers and scheduled sessions, with its own branding and login page. Each institute only ever sees its own data.

  1. Scheduled

    Staff set date, time, batch and rules

  2. Lobby open

    Students wait in the waiting room

  3. Live

    First student starts at the start time

  4. Ended

    Start + duration has passed

Can also end asCancelledbefore it goes live

Reports

Rank list and proctoring audit

When a session ends, every student's best attempt is ranked automatically. Ties share a rank, and the proctoring audit shows who was flagged or disqualified.
  • Export as CSV
  • Print a branded A4 rank sheet
  • Pardon or disqualify from the audit
mockprepai.in/institute/reports
Institute rank list report

Session rules

  • Optional strict time lock: no entry more than 15 minutes after the start.
  • Entry closes once the session's duration has passed.
  • Attempt limit per student, with staff retake grants.
  • Optional batch filter and per-session pass-mark and penalty overrides.

Proctoring

  • The exam room reports tab switches and leaving the window.
  • With a limit of N (default 3), a student is flagged at N−1 and disqualified at N.
  • Staff can review the log and pardon or disqualify. After a pardon the count starts again.

The session report ranks each student by their best attempt, and tied scores share a rank (1, 1, 3). It exports as CSV or prints as an A4 rank sheet with the institute's branding. When an admin adds members, the app shows each new account's one-time password, with a CSV download for Excel imports.

07 · Backoffice

How content gets made

The admin console is grouped into Content (exams, mock exams, exam identity, reported issues) and Business (pricing, accounts, institutes, platform settings). A mock paper can be created four ways:

  1. 1

    Exam blueprint

    Sections, topics and question quotas

  2. 2

    Create the paper

    Blank, Excel / CSV / JSON import, or AI

  3. 3

    Edit questions

    Inline editor with answers and explanations

  4. 4

    Publish

    Status READY, shown to candidates

  5. 5

    Reported issues

    Students flag a question; staff fix it in one step

mockprepai.in/admin/mock-exams
Admin mock exams list

Mock Exams: create, import, generate with AI and publish

mockprepai.in/admin/monetization
Exam pricing page

Exam Pricing: free mocks per user and bundle price per exam

Reported questions flow back to the editor: staff correct the question and resolve the report in one step (Quick Fix).

08 · Business model

Free to start, pay per exam

There is no recurring subscription. Each exam has its own free-mock allowance and bundle price, set on the Exam Pricing page.

LeverHow it works today
Free-mock quotaEach exam allows a set number of free attempts per user (10 by default). After that, starting a new mock shows the quota is used up, with the bundle price.
Exam bundleUnlocks every mock for one exam, for life. Free (₹0) bundles unlock with one click.
ProUnlocks the printable exam booklet with its answer key. Admins can grant Pro to a user.
Institutes (B2B)Seat capacity and a per-student rate are recorded per institute. Institute sessions and Mock Duels never count against the free quota.

How a pack is paid for

The browser asks the API for an order (the price always comes from the exam), opens Razorpay Checkout with the returned public key, and sends Razorpay's signed confirmation back to the API, which verifies the signature against that order before unlocking the pack. Buying a pack the user already owns is refused. Needs RAZORPAY_KEY_ID and RAZORPAY_KEY_SECRET set on the backend.

09 · Architecture

How the pieces fit

A Next.js web app talks to a FastAPI backend over JSON. The API stores everything in PostgreSQL and uses Redis for caching and as the queue for background workers.

Scheduled jobWhenWhat it does
Replenish mock poolsEvery 5 minutesQueues AI generation for exams running low on ready papers
Update performance statsDaily, 02:00 UTCRecomputes each user's analytics
Clean up expired attemptsDaily, 03:00 UTCCloses attempts whose time ran out

10 · Data model

The core tables

55 tables in total. These are the ones the main flows run on: an exam's structure, a candidate's activity, purchases, duels and institutes.

Exams and candidate activity

Purchases, duels and institutes

11 · Tech stack

What it's built with

LayerTechnologyNotes
Web appNext.js 16 (App Router), React 19, TypeScript, Tailwind CSS v4TanStack Query, Zustand, Recharts, Radix UI, Geist font
Design systemSemantic colour tokens, light / soft / dark themesShared page header, stat card, empty state and dialog components keep every screen consistent
APIPython 3.11, FastAPI, SQLAlchemy 2.0 (async), Pydantic v2JWT access and refresh tokens, bcrypt passwords, request IDs, security headers
DatabasePostgreSQL 16 with pgvector; SQLite locallyAlembic migrations (head f3a7c2d1e9b4)
JobsCelery worker and beat on Redis 7Mock generation, analytics, notifications
AIOpenAI, Anthropic, or a built-in mock providerExam skills drive AI paper generation from the blueprint
EmailBrevo SMTP (console in development)Verification and password-reset emails
Testingpytest (208), Playwright (121 end-to-end)End-to-end suite runs on a freshly seeded local database

12 · Deployment

Shipping to production

Pushing to main deploys through Coolify, which builds and runs docker-compose.prod.yml.

  1. 1

    Push to main

    Code merged on GitHub

  2. 2

    GitHub Actions

    Calls the Coolify deploy webhook

  3. 3

    Build images

    Backend and frontend Docker images

  4. 4

    Start 7 services

    Database, Redis, MinIO, API, workers, web

  5. 5

    Live

    Migrations run, then mockprepai.in serves

SymptomUsual causeWhere to look
CORS error in the browserThe API is down; the proxy's 503 page has no CORS headersCoolify → backend container logs
503 “no available server”Backend container stopped, crashing or unhealthyBackend logs, last 30–50 lines
Deploy fails pulling MinIO (401)MinIO stopped publishing imagesCompose now uses chainguard/minio
“greenlet” ImportError on startSQLAlchemy 2.1 pulled in by an unpinned buildPinned to <2.1 with greenlet listed

13 · Quality & security

How quality and security are handled

Every change is checked by 208 backend tests and 121 end-to-end browser tests that run the real app on a freshly seeded database.

Payments

Access is only granted from the server, priced from the exam itself, and checked against the buyer's own order.

Accounts

Passwords are hashed, sign-in tokens expire for every role, password-reset links work once, and only a super admin can create another super admin.

Institute isolation

Each institute can only see and act on its own members, sessions, reports and proctoring logs.

Exam integrity

The server keeps the clock, scores every paper, and holds back answer keys until the attempt is submitted.

Exam room resilience

Answers are saved as the candidate goes and kept on the device until the submission succeeds.

Private practice

A candidate's personal mistake drills are visible only to that candidate.

14 · Gaps & next steps

What isn't built yet

AreaStatusDetail
Pro subscription checkout
Not built
Pro is granted by admins; exam packs can be bought online
Document processing
Not built
Uploaded PDFs are stored but not extracted or indexed for AI generation
File storage
Provisioned
MinIO runs, but no code reads or writes to it yet
AI jobs console
Hidden
The backend module exists but isn't connected; the page redirects
Translation coverage
Partial
English and Malayalam switch, but many labels are still English-only
Proctoring signals
Partial
Tab switches and window blur are reported; leaving fullscreen is not
Core exam flow, analytics, institutes, duels
Live
Covered by the automated test suites

Source: docs/ARCHITECTURE_AND_FEATURES.md and docs/API_DOCUMENTATION.md in the repository, checked against the code in October 2026.