Inspiration

As university students ourselves, we constantly felt like we were studying hard but not studying smart. We'd spend hours at different locations, such as the library, a café or at home, without any real sense of which environment actually produced our best focus. And burnout would creep up without warning; sessions getting shorter, breaks getting more frequent, motivation dropping, until it was suddenly too late. We tried (for many semesters) to manually track our study locations and hours by hand, on a spreadsheet; however, it was messy, tedious and hard to keep track of. We wanted a tool that turned those invisible patterns into data, and that data into actionable coaching. Nothing like that existed for students in a simple, accessible form, so we built it.

What it does

RIACT - Record, Insight, Analyze, Coach, Track - is an AI-powered study habit tracker built for university students. Users log study sessions by location and time, recording breaks mid-session so RIACT can calculate net study time versus total time at each location. After just 3 sessions, the AI unlocks:

  • AI Insights: GPT-4o-mini analyses session patterns and surfaces personalized recommendations: your best study location, your peak focus window and how your habits compare to healthy study behaviour.
  • Burnout Detection: a rule-based signal monitor tracks early warning signs (shorter sessions, more frequent breaks, late-night cramming, declining goal completion) and surfaces a warning before burnout hits.
  • AI Study Coach: a live chat interface where students can ask anything about their study habits, with full context of their last 30 days of sessions and active goals fed to the model with every message.
  • AI Weekly Study Plan: generates a personalized Monday-Sunday study schedule based on the user's actual historical patterns, with location suggestions, recommended hours and a focus tip per day.
  • Goals and Progress Tracking: students set daily or weekly study hour targets, optionally tied to a specific location, and watch progress bars fill in real time.
  • Dashboard: weekly and daily reports with charts, location breakdowns and AI recommendations inline.

How we built it

  • Frontend: Next.js 16 (App Router, TypeScript) with Tailwind CSS for styling, Recharts for data visualization and Lucide React for icons.
  • Backend: Supabase for authentication (email and password) and a PostgreSQL database with row-level security; every query is scoped to the authenticated user so no one can access another user's data. - - Three Next.js serverless API routes handle all AI functionality:
  • /api/analyze: gathers the user's session history and calls GPT-4o-mini to generate insight bullet points
  • /api/chat - powers the AI Study Coach with the last 30 days of sessions and active goals as context
  • /api/weekly-plan: generates a structured JSON study plan using response_format: json_object
  • Authentication pattern: Rather than relying on cookies (which proved unreliable on Vercel's edge runtime), we switched to JWT Bearer token authentication. The server decodes the JWT locally (no extra network round-trip) verifies the user, then queries Supabase as that user so RLS applies server-side.
  • Hosting: Vercel, with client-side AbortControllers capping AI requests at 9 seconds to stay within the serverless function timeout.

Challenges we ran into

  • Vercel's 10 second timeout was the biggest technical challenge. Early versions of the AI insight calls were timing out before OpenAI responded. We solved this by shortening prompts, capping max_tokens and adding a client-side 9-second AbortController to fail naturally before the hard cutoff.
  • Cookie-based authentication on the end runtime kept causing false logouts; users would complete a session and get redirected to the login page. After multiple attempts to fix middleware-based authentication, we rearchitected the entire authentication flow to use Bearer tokens instead, which proved far more reliable on Vercel.
  • Burnout detect design required real thought. A simple, more naive implementation might have used the AI to assess burnout risk; however, that creates a model making false, quasi-medical claims. We deliberately separated burnout detection from AI entirely, building a deterministic rule-based signal checker instead.
  • Supabase duplicate email handling was subtle; the API silently "succeeds" on duplicate signups without returning an error, instead of sending another confirmation email. We detected this by checking whether data.user.identities returned an empty array and surfaced a clear message with a password reset option.

Accomplishments that we're proud of

  • Building a fully functional, deployed AI product in under a week, with very little prior coding experience (we are both life science majors). Every technical decision, from database architecture to serverless API design, was learned and implemented during the build window itself.
  • Designing a responsible burnout detection system that explicitly separates AI recommendations from rule-based warnings; no model ever tells a student they are burned out.
  • The AI Study Coach delivers genuine personalized responses grounded in real session data, not simply generic advice.
  • A fully responsive UI that works on mobile and desktop.
  • Solving non-trivial production issues (edge runtime auth, serverless timeouts) that don't show up in local development.

What we learned

  • Production AI apps have constraints that tutorials and Youtube videos don't mention; timeouts, cold starts and edge runtime limitations all require real engineering solutions.
  • Responsible AI design is an architectural design, not an afterthought; the choice to keep burnout detection deterministic had to be made early and shaped how the whole feature was built.
  • Prompt engineering matters at scale; shorter, more focused prompts with explicit output constraints produced faster, more reliable responses than open-ended ones.
  • User-facing AI needs simple, graceful failure states; a spinner that never resolves is worse than a clear error message.

What's next for RIACT (Record, Insight, Analyze, Coach, Track)

  • Streak tracking and study consistency scores: rewarding consistent habits, not just total hours.
  • Calendar integration: syncing study goals with Google / Apple Calendars, notably for allowing users to enter their school schedules to integrate into weekly study plans.
  • Cohort insights: anonymized, opt-in comparisons so students can see how their habits compare to peers in similar programs.
  • Mobile app: a native iOS/Android version for logging sessions on the go.
  • Smarter burnout prediction: moving from rule-based signal detection to a lightweight ML model trained on anonymized session data over time, with full user content.

Built With

Share this project:

Updates