<?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: Peetiphat</title>
    <description>The latest articles on DEV Community by Peetiphat (@peetiphat1).</description>
    <link>https://dev.to/peetiphat1</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%2F3863607%2Fa624355c-4949-4f23-8492-4320b6e88e35.jpg</url>
      <title>DEV Community: Peetiphat</title>
      <link>https://dev.to/peetiphat1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/peetiphat1"/>
    <language>en</language>
    <item>
      <title>Building 'The Endurance Log' 🏃‍♂️: A Full-Stack Next.js Strava Dashboard</title>
      <dc:creator>Peetiphat</dc:creator>
      <pubDate>Mon, 06 Apr 2026 10:34:44 +0000</pubDate>
      <link>https://dev.to/peetiphat1/building-the-endurance-log-a-full-stack-nextjs-strava-dashboard-lm3</link>
      <guid>https://dev.to/peetiphat1/building-the-endurance-log-a-full-stack-nextjs-strava-dashboard-lm3</guid>
      <description>&lt;h1&gt;
  
  
  Introduction: The Runner's Dilemma
&lt;/h1&gt;

&lt;p&gt;If you're a passionate runner, you likely use Strava to track your activities. But what about tracking the wear and tear on your favorite shoes? Or visualizing your long-term milestones in a custom dashboard alongside your local weather? &lt;/p&gt;

&lt;p&gt;Enter &lt;strong&gt;The Endurance Log&lt;/strong&gt;, a dynamic, full-stack application built to give you total control over your running analytics.&lt;/p&gt;

&lt;p&gt;This article serves as both a &lt;strong&gt;User Guide&lt;/strong&gt; (how the app works) and a &lt;strong&gt;System Document&lt;/strong&gt; (how the app is built), breaking down the architecture choices and the underlying tech stack.&lt;/p&gt;




&lt;h2&gt;
  
  
  Part 1: The User Guide 🚀
&lt;/h2&gt;

&lt;p&gt;The Endurance Log is designed to be your pre- and post-run command center. Here are its core features:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Smart Dashboard &amp;amp; Strava Sync
&lt;/h3&gt;

&lt;p&gt;The heart of the app automatically connects to your Strava account. By navigating through a seamless OAuth flow, the app continuously syncs your recent activities. It fetches exact distances, elevation gains, and activity times, displaying them in interactive user interfaces.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6j1lcoajmb4rbfb5asny.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6j1lcoajmb4rbfb5asny.png" alt=" " width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Gear &amp;amp; Shoe Tracker
&lt;/h3&gt;

&lt;p&gt;Running shoes have a lifespan—usually around 300 to 500 miles. The Gear Tracker lets you input your current shoe roster, log their brand/model, set starting milage, and establish a "target lifespan". As you log kilometers (via Strava or manually), you can visualize the progressive wear-and-tear of your favorite pairs before they cause injuries.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftpisxs3d3dfcbzr667wi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftpisxs3d3dfcbzr667wi.png" alt=" " width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Dynamic Weather &amp;amp; Route Visualization
&lt;/h3&gt;

&lt;p&gt;Using the OpenWeather API, the application pulls live weather data directly into your dashboard, helping you decide whether to grab a windbreaker or sunscreen. &lt;br&gt;
Additionally, the Route Tracker converts complex Strava polyline data into beautiful, smooth SVG maps showing your favorite custom runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fainduqmdabnn9o1oymno.png" alt=" " width="800" height="404"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Part 2: System Architecture 🛠️
&lt;/h2&gt;

&lt;p&gt;Under the hood, &lt;strong&gt;The Endurance Log&lt;/strong&gt; relies on a modern, robust JavaScript ecosystem. Let's look at the system architecture.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Technology Stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend:&lt;/strong&gt; Next.js (App Router), React 19, Tailwind CSS v4, Lucide React (for iconography).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend:&lt;/strong&gt; Next.js API Routes handle server-side logic and third-party API communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database &amp;amp; ORM:&lt;/strong&gt; PostgreSQL managed flawlessly by Prisma ORM (@prisma/client). &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3rd Party Integrations:&lt;/strong&gt; Strava API (OAuth 2.0 &amp;amp; Webhooks) and OpenWeatherMap, with mapping utilities by Mapbox (@mapbox/polyline).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Data Models &amp;amp; Prisma Schema
&lt;/h3&gt;

&lt;p&gt;The database architecture is centered around four main entities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Activity&lt;/strong&gt;: Unifies synchronized Strava runs and manual entries. It avoids duplicates by enforcing unique constraints on the stravaId.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gear&lt;/strong&gt;: Tracks shoe lifecycle, including images and default status.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Route&lt;/strong&gt;: Stores saved paths using encoded polyline strings. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UserSettings&lt;/strong&gt;: Securely holds Strava OAuth tokens (Client ID, Secret, and Refresh Token) to maintain a persistent connection with the Strava API without forcing the user to log in daily.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Strava OAuth Flow integration
&lt;/h3&gt;

&lt;p&gt;Instead of storing sensitive User passwords, The Endurance Log redirects users to &lt;a href="https://www.strava.com/settings/api" rel="noopener noreferrer"&gt;https://www.strava.com/settings/api&lt;/a&gt;. Once authorized, Strava returns a refresh token. The backend securely saves this inside the Postgres database, allowing background data syncing via Next.js server actions. &lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The Endurance Log isn't just a data wrapper—it’s a highly tailored dashboard bridging the gap between raw GPS data and actionable training insights. Whether you want to prevent overusing your shoes, map out your best routes, or simply admire your lifetime mileage, the system is built to scale alongside your fitness goals!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have you built fitness tech or integrated with Strava? Drop a comment below!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>webdev</category>
      <category>database</category>
    </item>
  </channel>
</rss>
