Inspiration
Fa Zhi was a Mathematics Tutor for H2 GCE Math and found that most students just needed a little nudge in order to get the correct answers. He also realise that many students do not deploy scientific-backed study techniques such as spaced-repetition. Hence, this lead to the creation of ProjectMath which aims to use AI to nudge students and creates spaced-repetition mistakes for students so that they can remember their mistakes
What it does
ProjectMath is an AI Math Trainer. It splits the H2 Math syllabus into topics and each topic consists of questions from all the top schools in Singapore as well as Cambridge A-level questions. In each question, student can ask AI for help and can take a picture of their working and upload to the website for AI to transcribe their working for AI to have a better understanding of their though process. Additionally, ProjectMath stores the user mistakes and allow students to re-do questions that they previously got wrong. The questions re-appear on a algorithm that follows Anki's spaced repetition, allowing students to remember their mistakes.
How we built it
We built using Leetcode system design as a reference. The main programming language used is TypeScript. For the frontend, we mainly used React, Tailwindcss. On top of that, for the math-specific questions, we used KaTeX, MathLive for the input as well as a home-grown 2D graph engine to graph out the solution graph for students. For Authentication, we used Firebase web SDK. Lastly, for the backend, we used SQL migration to supabaseDB. We used Google Cloud Run to deploy the website, Stripe for Payment and Resend for automatic receipt generation.
Challenges we ran into
We used mainly used AI such as Claude Code and Gemini to generate code for this proejct. However, as we began to add more features to our project, it gradually took on a Brownfield developmental process, where we were constantly modifying, adding and testing new features on top of Leetcode system design base. As a result, the Large Language Models took longer times and more tokens to contextualise our project along the way, even generating conflicting code that introduced bugs into our codebase at some points, resulting in scattering of our project to a certain extent. Secondly, we found it difficult to generate marketing prowess in this industry to have more users to pay for our website.
Accomplishments that we're proud of
Firstly, we managed to successfully integrate Gemini's API our AI hints chatbot and solution grader, leveraging on Gemini's capacity to provide users with assistance in weakness-targeted problem solving. Users will be able to receive targeted feedback on the specific area that they struggled with, allowing for more effective review of challenging questions.
Another accomplishment was our photo grading flow. When a photograph of handwritten working is submitted, the working is graded against the model solution step-by-step, pinning errors to the exact line of working where they occurred. It also transcribes handwritten working into editable LaTeX, such that if the AI makes mistakes in interpretating handwriting, it can be fixed manually on the question page itself, instead of having to upload another photo, allowing for flexibility in student submissions.
Lastly, we also created our own graph compiler, such that while converting the past year papers into SQL migrations, any graphs associated with the question part(s) would be generated in the question page itself, with the appropriate labels, asymptotes, points, etc. This sped up our paper conversion process, as there was no need to manually copy and display the graph from the paper itself in the question page.
What we learned
As it was our first time creating a project of such a scale, we learnt many things about system design along the course of the project. We learnt about the design for our authentication, payment and automatic receipt email system. We also learnt more about which variables should persist and which should have its state reset, such as solved/unsolved questions, which should retain and display their progress, as well as QR pairing tokens for the AI solution grader, which had to be reset each time.
Another aspect we learned about was the need to rate limit Gemini API request. Given that we were working with Gemini's free models, we needed to find a way for all users to be able to make use of the chatbot and solutions grader functions without going over the rate limit. As such, we designed a few layers of failsafe; per-minute limit to prevent request spamming, per-user cooldown system and daily per-tier quota. This ensures that each user will be able to make use of the AI features to the fullest extent of their subscription plans.
What's next for ProjectMath
In terms of urgency, what we need right now is greater visibility. We plan to do more advertising so as to get the product in front of more students. Alongside the feedback system within our website, it would provide user feedback that would assist us in improving the features and quality of our website. In terms of scalability, should the project eventually gain traction, we would be considering upgrading the Gemini model from a free to a paid tier, such that the platform be able to serve more requests submitted from a larger concurrent user base. We also plan to supplement our database with more SQL migrations by utilizing more open-sourced Junior College Past Year Papers, so as to exposure students to a more diverse selection of questions and build on their pattern recognition. This could be implemented through a semi-automated pipeline, so that the process of converting the paper to SQL migration becomes less tedious.
Built With
- cloud-build
- docker
- express.js
- firebase-authentication
- google-cloud-run
- google-gemini
- helmet
- katex
- mathlive
- node.js
- postgresql
- react
- react-router
- resend
- socket.io
- sql
- stripe
- supabase
- tailwind-css
- typescript
- vite
- vitest
Log in or sign up for Devpost to join the conversation.