NextLevel You
Inspiration
This idea comes from a common experience many students face.
Late at night, everything is set up to study — textbook open, distractions minimized — yet getting started still feels difficult. The issue is not always a lack of knowledge or discipline, but often a mental barrier shaped by comparison, pressure, and self-doubt.
Most productivity tools assume users are already ready to be productive. They focus on schedules, timers, and task management, treating productivity as an organizational problem. However, the real challenge is often the mindset at that moment.
Sometimes, what is needed is not another system, but a small nudge — something that makes it feel okay to begin, even for a few minutes.
That gap is what led to the idea of StudyCoach.
Motivation isn’t constant. Some days require a push, while others simply require permission to start.
The goal is to create a platform that meets students where they are, supporting them based on their current state rather than expecting consistency at all times.
What we Learned
1. Psychology first, features second
The biggest lesson was that the most powerful feature in the app isn't the AI, the leaderboard, or the charts. It's the framing.
Changing a streak display from:
"5 day streak 🔥"
to:
"You showed up 5 times even when it was hard"
…is the difference between a number and a feeling. Small copy changes carry enormous emotional weight for students already feeling behind.
2. The mathematics of motivation decay
I modelled motivation as a function that decays exponentially when students face repeated failure — similar to the Ebbinghaus Forgetting Curve:
$$ M(t) = M_0 \cdot e^{-\lambda t} $$
Where:
- \( M(t) \) = motivation at time \( t \)
- \( M_0 \) = baseline motivation
- \( \lambda \) = decay rate (increases with perceived failure / social comparison)
This is why a student at Level 1 can't simply be given harder tasks — their \( \lambda \) is high, and the system needs to reduce friction, not increase it. The level recovery system in StudyCoach is directly inspired by this model.
3. Real-time systems require careful state design
Integrating Firebase Firestore with real-time listeners taught me that reactive data flows require you to think about who owns what state at every step. The leaderboard ranking had to be computed client-side from raw Firestore data, because Firestore doesn't support multi-field compound ordering with dynamic ranking out of the box.
4. AI prompt engineering is product design
The quality of the Gemini AI responses depended entirely on how precisely I described the level system inside the prompt. Vague prompts gave generic motivation quotes. Precise, level-aware prompts produced responses that genuinely felt like a mentor who understood the student's situation.
How we Built It
Tech Stack
| Layer | Technology |
|---|---|
| Frontend | React 18 + Vite |
| Styling | CSS Modules (dark-first design system) |
| AI | Gemini API |
| Backend / DB | Firebase Firestore |
| Auth | Firebase Anonymous Auth |
| Deployment | Vercel |
Architecture
User selects mood
↓
React sends mood + level to Gemini API
↓
Gemini returns { coachMessage, nextStep, tasks, affirmation }
↓
User completes tasks → streak + score update
↓
Firebase Firestore syncs score to leaderboard in real time
↓
All friends' browsers receive the update instantly (onSnapshot)
The 5-Level Adaptive Engine
The core innovation is the Level Recovery System — an adaptive engine that reconfigures the entire app based on the student's current mental state:
$$ \text{Level}(u, t) = \text{clamp}\left(\text{Level}{t-1} + \Delta{\text{mood}},\ 1,\ 5\right) $$
Where \( \Delta_{\text{mood}} \) is derived from the mood input:
| Mood Input | \( \Delta_{\text{mood}} \) | Target Level |
|---|---|---|
| "I can't do anything" | \(-2\) | 1 |
| "Feeling very low" | \(-1\) | 1–2 |
| "Can't focus" | \(0\) | 2–3 |
| "Doing okay" | \(0\) | 3 |
| "Ready to focus" | \(+1\) | 4 |
| "Peak mode" | \(+2\) | 5 |
Each level maps to a distinct AI coaching mode, task size, and emotional tone:
Level 1 — Very Low
→ AI mode: Breakdown support
→ Task size: 2 minutes
→ Tone: "You don't need to do everything today"
Level 5 — Peak
→ AI mode: Deep challenge
→ Task size: 45-minute sessions
→ Tone: "This is where the gap opens"
Breakdown Mode
The most emotionally sensitive feature — triggered when a user selects "I can't do anything." Instead of tasks, the app delivers a 3-step human-first response:
- Calm — normalise the feeling without dismissing it
- Reframe — separate the emotion from the identity
- Micro action — one 2-minute task, nothing more
// Prompt engineering for Breakdown Mode
if (mood.id === 'breakdown') {
// Skip AI call entirely — use curated human response
// AI-generated empathy for crisis states risks feeling hollow
return <BreakdownMode />
}
This was a deliberate product decision: for the lowest emotional states, a carefully written static response outperforms a dynamically generated one.
Real-Time Leaderboard
The leaderboard uses Firebase's onSnapshot listener — every score update propagates to all connected clients in under 500ms:
const q = query(
collection(db, 'leaderboard'),
orderBy('streak', 'desc'),
orderBy('tasks', 'desc'),
limit(20)
)
return onSnapshot(q, (snap) => {
const rows = snap.docs.map((d) => ({ uid: d.id, ...d.data() }))
callback(rows)
})
Combined with Anonymous Auth, users join the leaderboard in seconds with no signup friction — just enter a display name and you're ranked.
Challenges we Faced
1. The "motivation paradox"
The hardest design challenge: how do you motivate someone who is too demotivated to engage with a motivation app?
My first versions required too many taps before the student got any support. I kept stripping the UI back until a student at Level 1 could receive emotional support in a single tap from the home screen. Every extra step is abandonment risk.
2. Making AI responses feel human, not hollow
Early Claude API responses were technically correct but emotionally flat — they used clichés like "You've got this!" and "Believe in yourself!"
The fix was specificity in the system prompt. Instead of asking for "motivational messages," I described the exact psychological state of each level, the language register to use, and explicit examples of what not to say. Response quality improved dramatically.
3. Firebase real-time + React state conflicts
When Firestore's onSnapshot fired rapidly (multiple users updating simultaneously), React's state updates batched in unexpected ways — causing the leaderboard rank numbers to flash or briefly show incorrect positions.
The fix was introducing a prevRows reference to compute rank change deltas only after a stable update, not on every snapshot event.
4. Anonymous auth and data persistence
Anonymous users lose their data if they clear their browser. For a hackathon this is acceptable, but a production version would need a lightweight account linking flow — letting users optionally attach an email to preserve their streak.
What's Next
- Pomodoro integration — session timer that automatically logs study minutes to the progress dashboard
- AI quiz generator — Claude generates topic-specific questions based on what the student studied that day
- Account linking — preserve streaks across devices with optional email/Google sign-in
- Streak insurance — one "free pass" per month that protects a streak when life happens
The One Thing
If StudyCoach does one thing well, it's this:
It doesn't judge you for having a bad day. It just makes the next 2 minutes possible.
And sometimes, that's all you need.
$$ \text{Progress} = \sum_{t=1}^{n} \epsilon_t \quad \text{where } \epsilon_t > 0 \text{ even when } \epsilon_t \ll 1 $$
Every small action, on every hard day, still counts.

Log in or sign up for Devpost to join the conversation.