<?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>Forem: Peetiphat</title>
    <description>The latest articles on Forem by Peetiphat (@peetiphat1).</description>
    <link>https://forem.com/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>Forem: Peetiphat</title>
      <link>https://forem.com/peetiphat1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/peetiphat1"/>
    <language>en</language>
    <item>
      <title>Building 'The Endurance Log' 🏃‍♂️: A Full-Stack Next.js Strava Dashboard (Updated)</title>
      <dc:creator>Peetiphat</dc:creator>
      <pubDate>Tue, 07 Apr 2026 15:56:10 +0000</pubDate>
      <link>https://forem.com/peetiphat1/building-the-endurance-log-a-full-stack-nextjs-strava-dashboard-updated-5gce</link>
      <guid>https://forem.com/peetiphat1/building-the-endurance-log-a-full-stack-nextjs-strava-dashboard-updated-5gce</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 comprehensive &lt;strong&gt;User Guide&lt;/strong&gt; (detailing how the app works for runners) and an in-depth &lt;strong&gt;System Document&lt;/strong&gt; (breaking down the architecture, schemas, and structural choices).&lt;/p&gt;




&lt;h2&gt;
  
  
  Part 1: Comprehensive 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 interactive features:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Smart Dashboard &amp;amp; Seamless 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 natively integrated into a settings modal, the app continuously syncs your recent activities. It fetches exact distances, elevation gains, and activity times, dynamically plotting them directly in a personalized dashboard.&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%2F3c0usxvmxyljyu82356m.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%2F3c0usxvmxyljyu82356m.png" alt=" " width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Running shoes have a lifespan—usually around 300 to 500 miles. Our Gear Tracker lets you input your current shoe roster, tag their brand/model, establish a starting mileage, and set a custom "target lifespan". As you log kilometers (via Strava or manually), you can visualize progressive wear-and-tear of your favorite pairs before they cause injuries, with detailed visual health bars.&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%2Fhwamux1rfwlp8kl1ev8i.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%2Fhwamux1rfwlp8kl1ev8i.png" alt=" " width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Using the OpenWeather API, the application pulls live weather data into your dashboard to help coordinate outdoor activities. The app also features a dedicated Route Tracker that converts complex Strava polyline data into beautiful, smooth SVG map routes to catalog your favorite paths.&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%2Fyutuhgzlsidlbdz98r4r.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%2Fyutuhgzlsidlbdz98r4r.png" alt=" " width="388" height="156"&gt;&lt;/a&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%2Fduqe8sb0i7nprlxrlba8.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%2Fduqe8sb0i7nprlxrlba8.png" alt=" " width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Consolidated Settings System (New Update)
&lt;/h3&gt;

&lt;p&gt;System configurations, including the Strava API tokens (Client ID, Secret, and Refresh Token) are now administered entirely via a "System Settings &amp;amp; Integrations" UI. Environment variables for user keys are a thing of the past!&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%2Fil2ra6komm6rhl2eyhe6.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%2Fil2ra6komm6rhl2eyhe6.png" alt=" " width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;




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

&lt;p&gt;Under the hood, &lt;strong&gt;The Endurance Log&lt;/strong&gt; utilizes a bleeding-edge JavaScript ecosystem. The development principles focus on modularity, high performance, and rapid UI development.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Technology Stack (System Dependencies)
&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 for a highly responsive brutalist aesthetic, Lucide React (for iconography).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend:&lt;/strong&gt; Next.js API Routes (&lt;code&gt;/app/api/*&lt;/code&gt;) securely handle internal logic, webhook processing, and external communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database &amp;amp; ORM:&lt;/strong&gt; PostgreSQL schema powered by Prisma ORM (&lt;code&gt;@prisma/client&lt;/code&gt;) running on a local or remote server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrations:&lt;/strong&gt; Strava API (OAuth 2.0 &amp;amp; Webhooks), OpenWeatherMap, with advanced geometry parsing by Mapbox (&lt;code&gt;@mapbox/polyline&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Relational Data Models (Prisma Schema Docs)
&lt;/h3&gt;

&lt;p&gt;The database is strictly typed and relationship-driven:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Activity&lt;/strong&gt;: Unifies synced Strava runs and manual entries. It avoids duplicates natively using the &lt;code&gt;stravaId&lt;/code&gt; unique constraint and handles relation links to Gear.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gear&lt;/strong&gt;: The underlying tracking model for shoe lifecycle, integrating image links and Boolean toggles for &lt;code&gt;isDefault&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Route&lt;/strong&gt;: Persists encoded polyline strings and elevation checkpoints, allowing quick rendering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UserSettings&lt;/strong&gt;: Securely holds Strava OAuth tokens to maintain a persistent connection without enforcing daily logins. It securely isolates API keys away from &lt;code&gt;.env&lt;/code&gt; files.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Architectural Flow: Database-Driven Settings &amp;amp; OAuth Integration
&lt;/h3&gt;

&lt;p&gt;Instead of hardcoding sensitive user tokens or using inflexible &lt;code&gt;.env&lt;/code&gt; parameters, The Endurance Log now handles dynamic credentials natively. &lt;br&gt;
Users paste their API details into the dashboard. On execution, the application runs an OAuth redirect to &lt;code&gt;https://www.strava.com/settings/api&lt;/code&gt;. Authorized refresh tokens are automatically updated in the Postgres database via dedicated Next.js server actions, guaranteeing reliable background synchronization loops without application downtime. &lt;/p&gt;




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

&lt;p&gt;The Endurance Log represents more than just a typical data wrapper—it’s an end-to-end framework translating raw user paths into functional athletic insights. Whether mapping out custom workflows, evaluating precise database schemas, or extending the shoe lifecycle logic, the application remains scalable across both the front and back end.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have you built fitness tech or integrated with Strava? Feel free to ask questions about the architecture or dive into the codebase!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>webdev</category>
      <category>database</category>
    </item>
    <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://forem.com/peetiphat1/building-the-endurance-log-a-full-stack-nextjs-strava-dashboard-lm3</link>
      <guid>https://forem.com/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>
