StudyBuddy AI

Real-time study partner matching with live video sessions


The Problem

It's common to feel stuck when you are studying alone late at night, especially when you're staring at a problem set and have no idea if you're even on the right track. Discord exists. Zoom exists. But neither was built for the moment when you just need someone studying the same thing as you, right now.

We wanted to build the Omegle of studying: instant matching, live video, no friction.


What It Does

StudyBuddy AI matches students with compatible study partners and drops them straight into a live video/audio session.

Smart Matching Select what you're studying and get paired with another student based on subject, school, major, and academic year using a weighted Jaccard similarity algorithm. No free-text ambiguity; standardized dropdowns mean "Georgia Tech" and "Georgia Institute of Technology" are always the same school.

Live Video Sessions WebRTC via LiveKit powers the actual call. Mic/camera controls, partner mute, in-session text chat with real-time notifications, everything you'd expect, without the setup overhead of scheduling a Zoom.

Skip & Re-queue Not clicking with your current partner? Hit skip. A 5-minute cooldown prevents immediately re-matching with the same person.

Friend System Add your study partner after a session, message them anytime, and call them directly for future sessions. Good study partners are hard to find, and the friend system makes sure you don't lose them.

Profile System 4,300+ US colleges and 94 majors in searchable dropdowns. Matching is only as good as the input data; we normalized at the source instead of cleaning it up later.


How We Built It

Layer Stack
Frontend React 19 + TypeScript + Vite + CSS Modules
Backend Next.js 15 App Router (API routes)
Database PostgreSQL
Video/Audio LiveKit (WebRTC)
Deployment Railway

Matching Algorithm

We implemented a weighted Jaccard similarity system across multiple dimensions and normalized fields like school and major at input using dropdowns instead of during comparison. This improves match quality by making user comparisons more consistent and accurate across shared attributes. We built an AI model to contextualize user bios to better match those with similar personality types.

$$J(A, B) = \frac{|A \cap B|}{|A \cup B|}$$

Each dimension (subject, school, major, academic year) gets its own weight and scores are summed to rank candidates.

Real-time Without WebSockets

We used polling: match status every 2s, chat every 3s, incoming calls every 3s, friend requests every 10s to make a streamlined user experience.

LiveKit JWT Tokens

We generate LiveKit auth tokens manually using HMAC-SHA256 rather than the official SDK. The official SDK caused Next.js compilation to hang for several minutes during development, so we just wrote it ourselves.

Single-App Deployment

Serving a Vite SPA from a Next.js backend required custom rewrites in next.config.ts to route non-API paths to index.html while keeping API routes functional.


Challenges

LiveKit Audio Autoplay Browsers block autoplay audio by default. To fix this, we added a RoomAudioRenderer and an useAudioPlayback function

Infinite Re-render Loops Inline arrow functions as props + .filter() results as useEffect dependencies = cascading re-renders that froze the UI. We fixed with useCallback, useRef, and strategic use of key props to force clean remounts.


What We Learned

Prioritize normalization at the point of data entry rather than during comparison; structured inputs such as dropdown menus are more reliable than free-text fields for ensuring accurate matching. Additionally, polling remains an effective and often overlooked approach, as many user experiences labeled as “real-time” do not actually require the complexity of WebSocket implementations. Finally, when working with browser APIs, including WebRTC, autoplay policies, and media permissions, it is important to anticipate edge cases, as these systems tend to exhibit more variability and exceptions than initially expected.


What's Next

  • WebSocket upgrade for true real-time messaging and instant match notifications
  • Shared whiteboards and AI tutoring within sessions
  • Group sessions (3-4 students for collaborative problem solving)
  • Study streaks and gamification to encourage consistent habits

Built With

Share this project:

Updates