Vibe Code

AI Running Coach

LINE-First AI Running & Strength Coaching Platform

A personal project I designed and built myself. The work is shown here for portfolio purposes only.

Built with

Tools behind the build

The core stack used to shape the product experience, interface, and implementation.

ClaudeAI Model
LINE OfficialMessaging Platform
Next.jsFramework
SupabaseDatabase & Auth
OpenAIAI Model

AI Running Coach is a personal running and strength coaching platform that runs entirely inside LINE no extra app to install. Users add the LINE Official Account, describe their goal in plain text, and the system builds a personalized program for both running and strength. It pushes a plan card every morning, lets you log results by chat, watch-face photo, or automatic Strava sync, and continuously re-shapes the plan around how training actually goes.

The Problem

  • Off-the-shelf plans don't adapt to the individual typical apps hand out level-based templates without computing pace from each person's real stats, and never adjust when actual sessions run harder or easier than planned.
  • Personal coaches are expensive and hard to reach having someone review your training and adjust the plan daily is a high-cost service.
  • Letting AI invent the numbers risks injury if an LLM guesses distance, pace, and load, the plan can ramp too fast and cause injury.
  • Logging results is a chore opening a separate app and filling in forms makes people quit tracking halfway.
  • People who already have a coach can't use most apps most apps force their own plan and won't let you carry over a schedule your coach wrote.

What It Does

Add the LINE OA, tell the coach your goal in everyday language, and the system designs a personalized running and strength program. Every morning at 06:00 it pushes a Flex card summarizing today's session with a coach message that follows on from yesterday's result.

You can log workouts three ways typing in natural language, photographing your watch face for AI vision to read, or automatic Strava sync the moment an activity ends. The plan then re-resolves against your real training load, day after day.

Core Features

  • Daily Push at 06:00 a Flex card summarizing today's session with an AI coach note that carries over from yesterday's result, plus fatigue-signal alerts when detected.
  • Personalized pace via VDOT pace zones computed from Daniels' VDOT based on real race results, auto-recalibrated after every time-trial or race so the whole plan is re-paced.
  • Load-aware adaptation (ACWR) aerobic days stretch or shrink volume ±10% based on the acute:chronic workload ratio computed from real running data at the moment each day is resolved.
  • Three ways to log natural-language chat ("done, 7k in 53 min, avg HR 158"), a photo of a watch face/app for AI vision to read, or automatic Strava sync via webhook the instant an activity finishes.
  • Edit plans in natural language, with undo type "move strength to today" / "skip tomorrow" / "ease off this week" and the plan actually changes; every edit is journaled and reversible with "undo the last change".
  • Bring-Your-Own-Plan photograph or type the schedule your coach gave you, AI converts it into a structured plan, the engine auto-detects risk points (ramp >10%, long run >30%, no deload, >3 hard days), and you import as-is or let the system smooth the risks first.
  • Strength module auto-generates a strength program from the running plan's phase, focus, available equipment, and injury history; shows exercises with sets×reps/rest/tempo and logs sessions via web form, chat, or automatic Strava sync.
  • Fatigue & injury watch asks RPE after every session on every channel, checks for pain each Monday (offers to cut that week's load on report), and detects fatigue signals (consecutive high RPE, pace drift, abnormally high HR on easy days).
  • A coach you can actually talk to Thai Q&A with full context (next week's plan, goals, personal stats, chat history) that answers like a friend, and every Sunday compares your prediction against the goal (Riegel formula) with a one-tap target adjustment.
  • No race required a personal-goal mode sizes the program length by distance, ends with a "goal proof day", and celebrates with a summary plus a prompt to set the next goal when the program finishes.
  • Web dashboard plan calendar, training-volume and RPE-trend charts, workout history, automatic personal-best detection, achievements unlocked from real data, and web chat with the coach.

Architecture Highlights

  • Separate "the brain that computes numbers" from "the mouth that speaks" — everything that protects the athlete (periodization, Daniels-based quality caps like long run 30%, taper, deload every 4 weeks, fatigue-based adjustment) is deterministic, fully unit-tested TypeScript. The LLM only communicates and parses messy input; it's never allowed to invent numbers that could cause injury.
  • LLM reads engine validates human confirms everything AI extracts (watch photos, coach schedules, chat messages) passes deterministic sanitization and requires user confirmation before it is ever written to the database.
  • Works under LINE's 3-second limit the webhook acknowledges immediately, then heavy work (LLM, plan generation) runs in the background with a typing indicator while you wait.
  • Multi-tenant from day one via Postgres Row-Level Security bound to a JWT claim not permission checks written by hand in application code.
  • Serious testing 150+ tests including e2e against a real, self-cleaning database (spins up a temp user, tests, then deletes itself), with chat features verified against real user sentences before merge.

Tech Stack

  • Framework Next.js 16 (Turbopack), React 19, TypeScript
  • Styling Tailwind CSS v4, a custom dark-first design system
  • Database Supabase (Postgres + Row-Level Security, multi-tenant from day one)
  • Messaging LINE Messaging API, LINE Login (OAuth), LIFF, Rich Menu, Flex Message
  • AI OpenAI (gpt-4o-mini for coach text + image reading, gpt-5-mini for Q&A and text/schedule parsing), used only for language and reading never for training-load decisions
  • Fitness data Strava API (OAuth + real-time webhook + cron sync)
  • Infra Vercel (cron jobs, background tasks)
  • Testing Vitest with 150+ tests, Zod validation
Let's work together

Have a project in mind?

nattee.krao@gmail.com