<?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: Run_Dev</title>
    <description>The latest articles on DEV Community by Run_Dev (@dev2681).</description>
    <link>https://dev.to/dev2681</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3904582%2F6eef8b42-2d52-42e7-beca-864c6bdd8139.png</url>
      <title>DEV Community: Run_Dev</title>
      <link>https://dev.to/dev2681</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dev2681"/>
    <language>en</language>
    <item>
      <title>How I built a self-adapting training plan in Next.js (no AI, just logic)</title>
      <dc:creator>Run_Dev</dc:creator>
      <pubDate>Thu, 30 Apr 2026 07:13:48 +0000</pubDate>
      <link>https://dev.to/dev2681/how-i-built-a-self-adapting-training-plan-in-nextjs-no-ai-just-logic-4e1c</link>
      <guid>https://dev.to/dev2681/how-i-built-a-self-adapting-training-plan-in-nextjs-no-ai-just-logic-4e1c</guid>
      <description>&lt;h1&gt;
  
  
  How I built a self-adapting training plan in Next.js (no AI, just logic)
&lt;/h1&gt;

&lt;p&gt;When I started building RunAdapt, I had one goal: a running plan that doesn't fall apart when you miss sessions.&lt;/p&gt;

&lt;p&gt;No machine learning. No LLMs. Just deterministic logic that runs every time you mark a session as MISSED or PARTIAL.&lt;/p&gt;

&lt;p&gt;Here's exactly how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core idea
&lt;/h2&gt;

&lt;p&gt;Most training apps are static. You get a plan, and if life gets in the way, you're on your own. RunAdapt runs 4 rules in sequence every time you miss a session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 1 — Reschedule
&lt;/h2&gt;

&lt;p&gt;Finds the next available slot in your calendar and creates a new session there.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;MISSED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nextSlot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;findNextAvailableSlot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;availableDays&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;createSession&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;session&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;nextSlot&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rule 2 — Reduce intensity
&lt;/h2&gt;

&lt;p&gt;If you have 2 or more consecutive missed sessions, the intensity factor drops by 0.15 (minimum 0.60). No point pushing hard if you're already struggling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;consecutiveMisses&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;intensityFactor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;intensityFactor&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.15&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rule 3 — Adjust target date
&lt;/h2&gt;

&lt;p&gt;If your failure rate exceeds 20%, the race date moves forward up to 8 weeks. Better to adjust the goal than to pretend you're on track.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;failureRate&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;0.20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;adjustedTargetDate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;addWeeks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;targetDate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;weeksNeeded&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rule 4 — Micro session
&lt;/h2&gt;

&lt;p&gt;If you have less than 30 minutes available, instead of skipping entirely, the plan creates a 20 min / 3 km session. Something is always better than nothing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;availableMinutes&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;createMicroSession&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;distance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why deterministic logic instead of AI?
&lt;/h2&gt;

&lt;p&gt;I considered using an LLM to make the adaptation smarter. But for this use case, deterministic rules have real advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Predictable&lt;/strong&gt; — the user knows exactly what will happen&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast&lt;/strong&gt; — no API calls, no latency&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cheap&lt;/strong&gt; — no token costs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trustworthy&lt;/strong&gt; — no hallucinations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sometimes simple is better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Next.js 14 (App Router)&lt;/li&gt;
&lt;li&gt;Supabase (auth + database)&lt;/li&gt;
&lt;li&gt;Vercel Hobby (free)&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;I'm currently looking for my first real users to validate whether these 4 rules are actually enough — or if I'm missing something obvious.&lt;/p&gt;

&lt;p&gt;If you're a runner, I'd love your feedback: runadapt.vercel.app&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>javascript</category>
      <category>nextjs</category>
      <category>showdev</category>
    </item>
    <item>
      <title>I built a running app in 13 days because I kept quitting my training plans</title>
      <dc:creator>Run_Dev</dc:creator>
      <pubDate>Wed, 29 Apr 2026 14:49:27 +0000</pubDate>
      <link>https://dev.to/dev2681/13-days-y-kept-quitting-5ag9</link>
      <guid>https://dev.to/dev2681/13-days-y-kept-quitting-5ag9</guid>
      <description>&lt;h1&gt;
  
  
  I built a running app in 13 days because I kept quitting my training plans
&lt;/h1&gt;

&lt;p&gt;I've been running on and off for years. My biggest problem was never motivation — it was that I'd miss two sessions and the whole plan would fall apart.&lt;/p&gt;

&lt;p&gt;Every. Single. Time.&lt;/p&gt;

&lt;p&gt;I'd look at the plan, see I was already 3 sessions behind, and just... stop. Sound familiar?&lt;/p&gt;

&lt;h2&gt;
  
  
  So I built RunAdapt
&lt;/h2&gt;

&lt;p&gt;RunAdapt is a training plan that adapts automatically when you miss sessions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Miss a session? It reschedules it.&lt;/li&gt;
&lt;li&gt;Miss two in a row? It lowers the intensity.&lt;/li&gt;
&lt;li&gt;Too far behind? It moves your race date instead of pretending you're still on track.&lt;/li&gt;
&lt;li&gt;Less than 30 min available? It creates a shorter session so you don't skip entirely.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No AI, no black magic. Just smart logic that keeps your plan relevant no matter what life throws at you.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;Vercel (Hobby plan — free)&lt;/li&gt;
&lt;li&gt;Supabase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Built in 13 days from scratch.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;The hardest part wasn't the code — it was figuring out who the app is actually for. After two days of Reddit feedback I landed on this: &lt;strong&gt;people who have been starting and quitting running plans for years, not because they're lazy, but because the plan never forgives you for being human.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Still looking for my first real users and brutal feedback.&lt;/p&gt;

&lt;p&gt;runadapt.vercel.app&lt;/p&gt;

&lt;h1&gt;
  
  
  showdev #beginners #webdev #running
&lt;/h1&gt;

</description>
      <category>productivity</category>
      <category>showdev</category>
      <category>sideprojects</category>
      <category>softwaredevelopment</category>
    </item>
  </channel>
</rss>
