This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle
What I Built
Well, at times learning is hard for some people, especially Mathematics (and maybe Physics π οΈ or History because I cannot seem to remember years correctly ) but we'll focus on some math ( before I start complaining about my memory during History exams π οΈ). Most people would love to learn with visuals in order to make it easier and maybe after a while they will pay for it with our local currency ( Kenya ). Three Dimensional models help interactivity and learners can get detailed experience especially for spheres and 3d shapes. 3D artists can also get some coffee( payment appreciation) for their contribution to better models. Learners can explore these models through Augmented Reality devices for it to be fun and understand the concepts. My motto in this website is that
Math does not need to be textbook serious to be understood. Learning should be a fun and interactive experience.
Math Quest is a mobile-first web app that teaches geometry through interactive 3D solids, like spheres, cylinders, cones, pyramids, hemispheres, cubes and some geometrical calculations on three dimensional models.
Learners read a short explanation ( there's also a voice narrator ), explore a diagram and a rotatable model (with optional AR on supported phones), answer a quick check, and request tutor hints when stuck.
Ten lessons are free; extra content unlocks after a confirmed M-Pesa payment. Accounts use email OTP ( One Time Password ) to reduce fake sign-ups ( there are many bots these days and also fake mail generators , we don't want our database to be filled with those).
An admin dashboard tracks users, verified payments, revenue, voice-service errors and approvals.
A public artists gallery lets 3D creators submit model links and share PayPal or M-Pesa details for tips.
The website is built with Next.js, MongoDB Atlas as a database , Safaricom Daraja for payment which is a local means of payment because I would first start locally although Stripe payment is also not available for local developers and deployed on Render.
Currently I am using publicly available three dimensional models from here but I have credited the authors within the website as per their licenses.
Note for any developer who uses public resources just like me: For these public models , licenses should be checked in order to use resources because some creators prohibit using their resources for commercial purposes and also most of them require crediting for their work. There are different types of licenses out here so it will only take approximately 20 minutes to learn about them and the different media that use them (even GitHub uses them btw). This will save you from any lawsuits if you have a website especially one you are using to gain income. Let's not make a small hustling website bring you losses because you do not check for licenses. Every media you use should be carefully analyzed and credited if it's not yours. Last but not least it is polite to credit an artist.
The problem
- Learners Of any age ( we learn every day, no age limit ) need geometry they can See and Move β not only flat textbook diagrams. They need to be able to visualize the concepts to get a better understanding
- 3D artists need a way to showcase their skills. There are little opportunities for three Dimensional artists especially locally and this provides a way of making their talent known and be able to provide 3D art or AR (Augmented reality) in a fun and learning manner. There are few public geometric models out here and it was hard for me to find what to embed but with this, many artists can create their art to be used for learning.
- 3D artists also need a hustling website or gig so this might be a good start for them to show case their skills and they would be able to get paid and sign a contract with the admin if they want more job security than just a
buy me coffeebutton
Who's using it
- Pupils & parents - inspect cubes, spheres, and related shapes through on-page diagrams and optional AR-capable models, then answer questions and get hints.
- Teachers / tutors - analytics surface for registrations, revenue, voice failures , and a moderated artist registry that stores metadata and tip contacts
- 3D artists - Submit models and get tips (PayPal / Mpesa)
Features map
Math Quest Landing page
β
βββ Learning
β βββ 10 free 3D geometry lessons
β βββ 2 paid advanced lessons
β βββ Interactive diagrams
β βββ GLB models + AR (where supported)
β βββ Quiz + mastery progress
β βββ Step-by-step tutor hints
β
βββ Access & trust
β βββ Email OTP registration
β βββ Session auth (JWT cookie)
β βββ M-Pesa unlock (confirmed only)
β
βββ Community
β βββ Artists submit model links
β βββ Buy-me-a-coffee (PayPal / M-Pesa)
β
βββ Ops
βββ Admin: users, revenue, payments
βββ Failure analytics
βββ Artist approve / reject
Demo
Here is a link from Render : https://mathquest-hlil.onrender.com/
Code
Here is my code, I have included an example of what is in my .env (with no real secrets of course) file for anyone to try out and run on local to at least view the admin dashboard on local . My email is the only admin on Render and adding anyone else is not recommended so it's better to run on local. The instructions to run are on the GitHub repo but feel free to ask questions , raise issues and try to make pull requests if you need a feature request. I would like to try to add a feature request from someone.
taylorhelene
/
Mathquest
Week 2 submission
Math Quest
Interactive 3D geometry lessons in the browser β rotate models, optional AR, tutor hints, email OTP sign-up, M-Pesa unlock, and an admin dashboard with Gemma briefing.
| Route | What |
|---|---|
/ |
Landing page |
/learn |
Lessons |
/artists |
3D artist gallery + tips (PayPal / M-Pesa) |
/admin |
Analytics, payments, AI logs, approvals |
Stack: Next.js 14 Β· TypeScript Β· MongoDB Atlas Β· Safaricom Daraja Β· Render
Install
Fork the repo
git clone <your-repo-url>
cd math-quest
cp .env.example .env.local
# fill in at least JWT_SECRET (and MONGODB_URI for accounts/payments)
npm install
npm run dev
Open http://localhost:3000.
| Command | Purpose |
|---|---|
npm run dev |
Local development |
npm run build |
Production build |
npm start |
Run production build |
Environment
Copy .env.example β .env.local (local) or set the same keys on Render.
Add your keys.
Admin
Sign in with an email listed in ADMIN_EMAILS, then open /admin.
Gemma (if configured) summarises highlights, what toβ¦
How I Built It
- I used Ollama in locally and installed Gemma model
- I used local Gemma for improving my local project files
- I used Gemma to provide hints for learners in the project using API from Google AI studio.
- I used ElevenLabs text-to-speech free credit for audio for the readers who also need articulation. Some other educational voice ID was not free so I used the free one provided in Developers dashboard
- I used Gemma-powered admin briefing that summarizes highlights, issues to check, and pending approvals using API from Google AI studio.
- I use MongoDB to preserve lesson history , API errors and user data
- I hosted the project on Render and used AI insights to check build errors
Project Tech stack
Layer | Choice
--------------------------------------------------------------
Frontend | "Next.js 14 (App Router), TypeScript, CSS", Gemma
3D / AR | Google <model-viewer> + .glb
Backend | Next.js API routes
Database | MongoDB Atlas
Payments | Safaricom Daraja (STK Push + Query + callback)
Auth | Email OTP + JWT cookie
Audio | ElevenLabs + browser fallback
Hosting | Render
_______________________________________________________________
List of screens and controls
Landing page
- Header β top bar of the site
- Start learning β opens the learning page
- π¨ Artists gallery β opens the artists page
- Feature cards β information only
- Footer β links and site info at the bottom
Header
- Theme button β switches light / dark theme
- Sign in β opens the auth modal
- Sign out β ends the session; progress no longer saves to the cloud
- Unlock with M-Pesa β opens the M-Pesa payment modal
- Admin (admin users only) β opens the admin dashboard
Lessons list
- Free lesson row β opens that lesson (content, diagram, 3D model, quiz)
- Paid / locked lesson row β asks for M-Pesa unlock if not paid; opens the lesson if paid or admin
- Progress marks β show saved attempts / mastery when signed in
Lessons workspace
- Lesson title & summary β topic overview
- Lesson body text β teaching content
- Diagram (LessonVisual) β SVG preview of the solid
- 3D model viewer β drag to rotate, scroll to zoom (background always dark)
- View in your space β opens AR on supported phones
- Model credit line β shows 3D model author / licence
- Play audio β speaks lesson text (ElevenLabs, or browser voice if the API fails)
- Answer options β choose one multiple-choice answer
- Check answer β marks right/wrong, shows explanation, saves progress if signed in
- Get a hint β Gemma tutor hint (up to 3 levels)
Footer
- Home β go to home
- Lessons β lessons page
- Artists gallery β go to artists gallery
- Admin β go to admin dashboard
- Submit a 3D model β go to artists submit form
Auth modal
- Sign in β log in with email + password (if email is verified)
- Need an account? Register β switch to the registration form
- Name / Email / Password β account fields
- Send verification code β saves the account and sends a 6-digit OTP email (or logs the OTP if Resend is not set)
- Verification code (OTP) β enter the 6-digit code
- Verify & continue β confirms OTP, signs you in, closes the modal
- Resend code β sends a new OTP (expires in 10 minutes)
- Back to sign in β return to the login form
- Already registered? Sign in β switch to the login form
Pay modal (M-Pesa)
- M-Pesa phone number β number that receives the STK PIN prompt
- Pay with M-Pesa β starts STK Push; order stays pending until success
- Iβve paid β check status β checks Daraja/DB; unlocks only if payment completed
- Close β closes the modal without unlocking
Artists page β gallery
- β Back to Math Quest β go to home
- Open 3D model β opens the model URL in a new tab
- β Buy me a coffee (PayPal) β opens PayPal donate / paypal.me for that artist
- π± M-Pesa β copies the M-Pesa number for Send Money
Artists page β submit form
- Display name β public artist name
- Email β contact for moderation
- Model title β name of the model
-
Model URL β public https link to
.glbor model page - Bio (optional) β short description
- License (optional) β e.g. CC-BY, CC0
- PayPal β email or paypal.me for tips
- M-Pesa number β phone for tips (at least one of PayPal or M-Pesa required)
- Submit for review β saves as pending until an admin approves
Admin β Gemma briefing
- Summary β short overview of platform health
- Highlights β key stats (users, revenue, AI)
- What to check β issues to review (pending pay, OTP, errors)
- Approvals pending β artist queue status
- Open Artists & tips β switches to the Artists tab
Admin β tabs
- Overview β KPI cards + metrics table
- Payments β confirmed M-Pesa payments table
- Users β recent users (verified / paid)
- AI services β Gemma + ElevenLabs event log table
- Artists & tips β submissions + PayPal/M-Pesa + approve/reject
Admin β artist actions
- Approve β publishes models to the public gallery
- Reject β keeps the model off the public gallery
- β Home β go to home
- Lessons β go to the lessons page
Why Does Open Innovation Matter?
Open Innovation is the general concept of the project as I am using the open source AI to build a project from scratch and to ensure it runs smoothly and tries to solve a current problem which is providing financial ease for 3D artists who need jobs and also making it easier for learners to get key concepts. The product is designed for real-world constraints in East Africaβmobile browsers, intermittent connectivity to external APIs, and MPesa as the primary payment . Free content lowers the barrier to entry; paid lessons unlock only after Mpesa payment.
The project is created based on open source models and it makes these possible :
Access: Runs in the browser on shared or low-end phonesβno app install.
Local payments: M-Pesa matches how families in Kenya already pay.
Pedagogy: 3D + hints support spatial thinking better than static notes alone.
Integrity: OTP reduces bot sign-ups; only confirmed payments unlock content.
Creators: Artists can share better models and receive tips without the app storing huge binary files.
Challenges faced
I did face some challenges during the project development which was solved by Gemma locally:
- User paid, but the dashboard still showed pending and paid lessons stayed locked.This was because I was treating
ResponseCode: "0"as βpaidβ β that only means the prompt was sent, not that PIN succeeded. Weak handling of final codes caused a problem and Gemma was using a wrong reference so I updated the current documentation reference:
ResultCode: "0" β real success β unlock
1032 β cancelled by user β failed
1037 β timeout / user unreachable β failed
ElevenLabs voice lesson audio failed at first; within the analytics tab in the developer dashboard in the ElevenLabs website : https://elevenlabs.io/app/developers , it showed 402 error. The cause was missing credits / plan limits on the educator's voice ID I wanted and I did not realize it needed to be paid for. I used the free voice ID that was in the Developer's dashboard.
Register modal sent a code to my email when testing, but the interface didnβt clearly show an OTP modal that was supposed to pop up. The cause was a pop up extension blocker was preventing the modal from showing
next build failed on Render with:
@typescript-eslint/no-namespace
@typescript-eslint/no-explicit-any
Cause was strict next/typescript rules treat many normal patterns as errors, which fail the build.
Gemma relaxed rules. Strict ESLint + next build will block shipping unless rules or ignoreDuringBuilds are set.
- My render website is not loading the models as fast as I want, I have not solved this yet because it may be a platform issue
Finally answering why why open innovation matters
The business is low cost due to running Gemma as a hint provider instead of getting an actual tutor. The customer's data is not shared on any platform , it is private and stored on MongoDB Atlas. I can always change references to my local model for precise answers. I am using Gemma as a tutor ,hint provider and dashboard summarizer and it is a free API so I am not locked on prices currently.
My Agent Session
It is not possible to add logging for a free API in Google AI studio
My First User
I am the only tester currently and I paid while testing π οΈ. But no real user currently though, I will try to get one within the week.
Prize Categories
- Best Use of Render
- Best Use of Gemma
- Best Use of ElevenLabs
- Best Use of MongoDB Atlas
Top comments (0)