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 calmingdashboardshowing personalized stats and due cards, into acategories_deckview, and finally the actualquiztaking interface dynamically handled by/quiz/[id]/page.jsx. - Generative AI Integration (
lib/gemini.js): When users hit theuploadroute 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, managingprofiles,categories,decks, andcards. We implemented an SM-2 spaced repetition algorithm directly tied into the database that calculatesinterval_days,easiness_factor, anddue_datewhenever 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.jswrapper. - Learned the intricacies of the SM-2 algorithm: balancing
easiness_factordecay againstinterval_daysbased 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
- google-calendar-api
- google-gemini-api
- javascript
- next.js
- node.js
- react
- sm-2-algorithm
- supabase
- tailwind-css
Log in or sign up for Devpost to join the conversation.