<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: M Kashif Iqbal</title>
    <description>The latest articles on DEV Community by M Kashif Iqbal (@m_kashifiqbal_9589140133).</description>
    <link>https://dev.to/m_kashifiqbal_9589140133</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4263718%2F24c9d8e7-511c-480a-b52d-1b4ff391c7bf.png</url>
      <title>DEV Community: M Kashif Iqbal</title>
      <link>https://dev.to/m_kashifiqbal_9589140133</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/m_kashifiqbal_9589140133"/>
    <language>en</language>
    <item>
      <title>What I learned building an AI study app with Next.js 16, Supabase and FSRS</title>
      <dc:creator>M Kashif Iqbal</dc:creator>
      <pubDate>Wed, 25 Nov 2026 03:07:53 +0000</pubDate>
      <link>https://dev.to/m_kashifiqbal_9589140133/what-i-learned-building-an-ai-study-app-with-nextjs-16-supabase-and-fsrs-2mfm</link>
      <guid>https://dev.to/m_kashifiqbal_9589140133/what-i-learned-building-an-ai-study-app-with-nextjs-16-supabase-and-fsrs-2mfm</guid>
      <description>&lt;p&gt;I'm Kashif, and for the last few months I've been building &lt;a href="https://studycove.pro" rel="noopener noreferrer"&gt;StudyCove&lt;/a&gt;, an app that turns lecture PDFs into flashcards, practice quizzes, timed mock exams, mind maps and a daily study plan.&lt;/p&gt;

&lt;p&gt;This isn't a launch post. It's the handful of things that bit me while building it, in case they save you a weekend.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Next.js 16 + React 19&lt;/strong&gt; (App Router, Server Actions)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supabase&lt;/strong&gt; for Postgres, auth (Google OAuth) and row-level security&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;unpdf&lt;/strong&gt; to pull text out of uploaded PDFs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ts-fsrs&lt;/strong&gt; for spaced-repetition scheduling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mind Elixir&lt;/strong&gt; for the editable mind maps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Run&lt;/strong&gt; for the app, &lt;strong&gt;Cloudflare&lt;/strong&gt; in front&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. Don't write your own spaced-repetition scheduler
&lt;/h2&gt;

&lt;p&gt;My first version used a hand-rolled SM-2 variant. It "worked", but intervals drifted in weird ways once people skipped a few days. Switching to FSRS via &lt;code&gt;ts-fsrs&lt;/code&gt; fixed it, and the library handles the awkward cases (lapses, relearning, overdue cards) better than I would have. Store the full card state, not just the next due date, so you can re-schedule if you ever change parameters.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Validate every AI-generated question strictly
&lt;/h2&gt;

&lt;p&gt;LLMs will happily return a multiple-choice question with two correct answers, an answer that isn't in the options, or a duplicate of question 3. I now validate each question against a strict schema and drop or regenerate anything that fails, instead of trusting the response. Users notice one broken question far more than they notice ten good ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Long jobs don't belong in a request
&lt;/h2&gt;

&lt;p&gt;Generating a 40-question mock exam from a 90-page PDF can take a while. Doing it inside a request meant timeouts and stuck spinners. Moving generation to a job table with a claim/dispatch pattern in Postgres (and an index on the dispatch query) made it reliable, and lets the UI poll for progress.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Server Actions can hang, so give them a deadline
&lt;/h2&gt;

&lt;p&gt;I hit cases where a Server Action promise never settled after a network blip, leaving buttons disabled forever. Wrapping UI-side calls in a small "settle within N seconds or show a retry" helper made the app feel far more solid on bad connections, which is exactly where students are (library Wi-Fi, buses).&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Mind maps: use a library, then fight the save loop
&lt;/h2&gt;

&lt;p&gt;Rendering mind maps on a canvas myself was a time sink. Mind Elixir gave me editing, drag and keyboard shortcuts for free. The catch: its change events plus my autosave created a save loop. An &lt;code&gt;inFlight&lt;/code&gt; guard and a revision number on every save fixed it, and revision numbers also stopped two tabs from overwriting each other.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;I'm working on making mock exams feel closer to real papers (sections, marks, time per question). If you've built something similar, or you're a student with opinions, I'd love to hear what you'd do differently.&lt;/p&gt;

&lt;p&gt;You can try it at &lt;a href="https://studycove.pro" rel="noopener noreferrer"&gt;studycove.pro&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>supabase</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
