Skip to content

Case study

Turning 15,000 scanned pages into 540,000 exam questions

Kerala PSC aspirants mostly study from scanned Malayalam papers. For Mathematica LLP, we turned more than 15,000 of those pages into a 540,000-question mock-test app that runs without any servers of its own.

Client
Mathematica LLP
Year
Service
Product engineering, AI content pipeline, Deployment and launch
PSC Mocklab’s home screen on a phone

The brief

Kerala PSC exams are competitive, and most of what aspirants study from is scanned Malayalam: old question papers, guides and notes. You can read a scan, but you can’t search it, practise against it or sort it by topic.

Mathematica LLP, the company behind Speedego, wanted a mock-test app built from that material. It needed thousands of questions per subject, organised so learners could practise one topic at a time and then test themselves on a whole lesson. The audience is price-sensitive, so running costs had to stay close to zero until usage grew, and a handful of engineers had to be able to build and run it without anyone dedicated to DevOps.

Turning scans into questions

The source material ran to more than 15,000 scanned pages, far more than a team could type up or check by hand, so we built a tool to do it.

Each PDF is split into page images with PyMuPDF, and Tesseract reads them with Malayalam and English switched on together, since PSC papers mix the two scripts. Gemini then works through the extracted text at its highest thinking level and writes each question with its answer and an explanation. Google Search grounding is switched on, so the explanations are based on real sources found by search.

Answer keys needed their own handling, because every paper lays them out differently. The operator picks the layout for each paper before answers are matched to questions, which avoids a whole class of mismatched answers. Every question then comes out in the same CSV format, with the question, options, answer and explanation, and is imported into Supabase under its category, lesson and sublesson.

We packaged the pipeline as a single Windows program with the prompt built in, so people without a development setup can run it and new content doesn’t have to wait for an engineer. It has turned more than 15,000 pages into 540,000 questions, about 36 a page, covering economics, Kerala and Indian history and the other core PSC subjects.

The app

PSC Mocklab is built with Expo and React Native and organises its content into categories, lessons, sublessons and questions. Learners work through a sublesson, then take a Full Lesson Test that pulls together the questions from every sublesson in the lesson. Scores go to a leaderboard, and monthly, yearly and three-year subscriptions through Razorpay unlock the full question bank. The admin panel and the website are built with Next.js.

The app started as a fork of Chatterbox, an English-learning app we built for a client, so its sign-in, payments, admin tools and release setup had already been proven in production.

No servers to run

Given the budget and the size of the team, we decided early that PSC Mocklab wouldn’t have application servers of its own.

Clerk handles sign-in and syncs users to Supabase through webhooks. Supabase holds the data and Razorpay takes payments, while push notifications go out through Expo’s push service and Firebase. The only custom backend code is a set of small Supabase Edge Functions for the Clerk and Razorpay webhooks, session claiming and sending notifications, and they cost nothing when nobody is using them.

Some of the logic lives in Postgres itself. When the questions in a sublesson change, database triggers rebuild the Full Lesson Test for that lesson, so there’s no scheduled job or background worker to look after.

Paid accounts also had to be kept to one device at a time. Each sign-in claims the account’s session, and the decision about which session wins happens inside a single atomic Postgres function that compares Clerk session creation times. A phone that wakes up with an old session can’t take over from a newer login, which is a race a stateless function couldn’t rule out on its own. The app listens to Supabase Realtime, so the older device is signed out straight away, and we don’t run a WebSocket server to make that happen.

Generating questions with AI is the most expensive work in the product, and it never happens while someone is using the app. Learners only get questions that were generated and reviewed in advance and stored in Postgres, so the cost per user stays flat and responses stay quick. A Gemini outage or rate limit can’t reach them either. On the phone, TanStack Query caches reads to save trips to the backend, and EAS builds and over-the-air updates let us ship fixes without any release infrastructure of our own.

Results

PSC Mocklab is live on the App Store and Google Play, and more than 400 users enrolled in its first two weeks. Its 540,000 questions are organised by subject and come from material that couldn’t be used for practice before. It has subscriptions, leaderboards, push notifications and one-device sessions. There are no servers to maintain and its costs follow real usage. People who aren’t developers can add new content.

What’s next

We’re now building a daily live quiz. It opens at 7pm and starts at 7.30pm. Players compete in real time, and ties go to whoever has the fastest total time. Promo codes for specific plans are on the way too, along with onboarding questions about district, education level and date of birth to personalise practice.

What we did

  • AI content pipeline (Gemini, Tesseract, PyMuPDF)
  • Mobile app (Expo, React Native, TanStack Query)
  • Backend (Supabase: Postgres, Edge Functions, Realtime)
  • Sign-in (Clerk)
  • Subscriptions (Razorpay)
  • Push notifications (Expo, FCM)
  • Releases (EAS, over-the-air updates)
  • Admin panel and website (Next.js)
Questions in the bank
540,000+
Scanned pages processed
15,000+
Users enrolled in the first two weeks
400+
Servers to maintain
0

More case studies

You bring the problem. We take it to production.

Our office

  • Perinthalmanna
    MEAEC, State Highway 39
    Library & Information Centre, Nellikunnu
    Vengoor, Perinthalmanna
    Kerala 679325, India