Inspiration

Math practice apps usually stop at "wrong answer, try again" where they tell you that you're wrong but not the step of doing it. I wanted to build something that actually taught on mathematical steps like the way a real tutor would (breaking a missed problem down step by step). I also wanted math practice to feel less like a worksheet and more like something people actually want to open so I framed it as an RPG battle against math dragons where each level is a boss guarding a different topic.

What it does

Nexora is a math battle game where players fight through progressively harder levels, where level 1 is addition and subtraction, second level is multiplication and division, third level is linear regression, fourth level is quadratic algebra, and final level is probability and each guarded by a math dragon. The questions are generated live by AI (Gemini) according to the topic and difficulty of that level. If a player answers wrong, the AI generates a personalized step-by-step breakdown showing exactly how to reach the correct answer which turns every mistake into a mini-lesson instead of a dead end. When player answer correctly, the warrior attack the dragon and deal 25 damage, if answer wrongly, the dragon deal the player 30 damage. There's also a global leaderboard (Hall of Heroes) so players can see how their level and progress stack up against others.

How we built it

The frontend is built in React and Vite and handles battle screen and handling question display with answer checking as well as boss dialogue. React and Vite also handle for the main page when enter the game link. Gemini powers three distinct AI functions, generating the actual battle questions per level, generating step-by-step explanations for wrong answer questions, and display short in-character dragon dialogue depending on whether the player won or lost. Supabase handles the leaderboard backend which stores usernames, levels and XP, when duplicate-username checks run against the full table so no two players with same name will happen. To keep the game playable even if the AI API is rate-limited or fails, I built a fallback system where sample questions (with pre-written steps) that the game silently swaps in if the live AI call fails so a failed API response never breaks gameplay.

Challenges we ran into

The biggest challenge was working within the free tier's daily API quota which is Gemini's free tier caps out at 20 requests/day which is easy to blow through during active testing and demoing. This pushed me to lean heavily on the fallback system I built, and made me think more about caching or reducing redundant AI calls in a production version. I also had to handle inconsistent AI output carefully like keep asking Gemini to return clean, parseable JSON every time (for questions, steps, and answers) and it took some prompt iteration to get reliable, especially for structured answer types like decimals from linear regression problems.

Accomplishments that we're proud of

I'm proud that the game degrades gracefully if the AI is down or rate-limited, players still get a full, playable experience with pre-written questions and explanations rather than a broken app. This is also the first time I'm solo on building an AI game and I successfully complete this which makes me proud of myself on the first time building game solo and success development.

What we learned

Building this solo taught me a lot about designing around external API limitations where I need to treat the AI as an enhancement layer rather than a single point of failure completely changed how I structured the app. I also learned how much small UX details matter in an educational tool as even simple things like consistent leaderboard alignment or clear duplicate-name handling affect whether the app feels trustworthy and polished, especially for younger users (children).

What's next for Nexora

I'd like to add adaptive difficulty that adjusts based on a player's real-time performance rather than static per-level questions, plus more levels covering topics like statistics. Multiplayer battles (real-time PvP warrior fights) or maybe collaborate to defeat the final boss as well as make a record for their own missed-question history, these are also on the roadmap.

Built With

Share this project:

Updates

Submission history