Inspiration

One of our team members happens to be a Duolingo user. He realized how learning a new language, even in a busy college life, has become easier through small sessions of answering a few questions. We wanted to have a similar implementation for general studying, but to add our uniqueness to it, we knew exactly how: by applying "spaced repetition" (a method to recall concepts about a subject over increasing intervals of time) through AI-generated flashcards and short quizzes.

What it does

CogQuiz transforms traditional studying materials into dynamic, personalized spaced-repetition sessions. Users can upload their lecture PDFs or notes, and the app automatically extracts the core concepts to generate tailored flashcards and quizzes. Over time, the app tracks performance and prioritizes cards that are due for review based on a built-in cognitive algorithm, ensuring long-term retention.

How we built it

We utilized a modern Next.js (App Router) architectural pattern paired with Node.js and a Supabase backend to bring CogQuiz to life. Our project file system breaks down as follows:

  • Frontend & Navigation (app/): We structured the user journey from a calming dashboard showing personalized stats and due cards, into a categories_deck view, and finally the actual quiz taking interface dynamically handled by /quiz/[id]/page.jsx.
  • Generative AI Integration (lib/gemini.js): When users hit the upload route with a PDF, our backend pipes the text to the Google Gemini (gemini-2.5-flash) API with a strict JSON schema to generate targeted question-answer flashcard objects grouped dynamically.
  • Database & State (lib/api.js, lib/db.js, lib/supabase-*.js): We used Supabase as our unified database, managing profiles, categories, decks, and cards. We implemented an SM-2 spaced repetition algorithm directly tied into the database that calculates interval_days, easiness_factor, and due_date whenever a user submits a card review score.

Challenges we ran into

Handling the complex routing endpoints and aligning them perfectly with the Supabase database schema objects was initially a significant hassle. Furthermore, ensuring the Gemini API consistently returned strictly formatted JSON for our data structure without errors required constant prompt engineering and validation before we finally nailed the generation reliability.

Accomplishments that we're proud of

  • Successfully integrating the SM-2 spaced repetition math engine to algorithmically filter and sort due flashcards globally.
  • Building a seamless, high-end "calm UI" (glassmorphism layouts, responsive dashboards) that makes the learning process feel less like a chore and more rewarding.

What we learned

  • Deepened our knowledge of building robust, dynamic schemas in Supabase and mapping them to React components via our custom api.js wrapper.
  • Learned the intricacies of the SM-2 algorithm: balancing easiness_factor decay against interval_days based on the user's cognitive recall score (0-5).
  • Mastered advanced file-system based routing and state management with the Next.js App router.

What's next for CogQuiz

  • Adding a color-coded tagging system for subject categories.
  • Implementing a visual progress bar during the quiz session.
  • Introducing an upload date tracker that will visually indicate when a specific deck/quiz will eventually "expire" or require a major refresh.

Built With

Share this project:

Updates

posted an update

Heads up — this warning is expected

You may see a "Google hasn't verified this app" screen when signing in. This is completely normal for apps in early development and does not mean anything is wrong.

To continue signing in:

Click "Advanced" at the bottom-left of the warning screen Click "Go to app name" — the link that appears below Proceed with your Google account sign-in as usual This screen appears because the app hasn't gone through Google's formal verification process yet. We're aware of it and working on it. Your data is safe.

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