ข้ามไปยังเนื้อหา

Overview

FitTrack คือ แอปบันทึกการออกกำลังกาย user เข้าสู่ระบบ บันทึก workout เป็นชุดของ set — แต่ละ set คือ exercise บวกกับจำนวน reps และน้ำหนัก — แล้วดู progress ของตัวเองสะสมขึ้นเรื่อย ๆ: personal record, total volume ต่อสัปดาห์ และ trend ของแต่ละ exercise คอร์สนี้ตั้งใจโฟกัสแคบ ๆ: exercise catalog, workout logging และ progress ไม่มี social feed, ไม่มี training program, ไม่มี nutrition — ของพวกนั้นอยู่ใน where to go next

จุดสำคัญของโปรเจกต์ไม่ใช่เรื่อง domain ของ fitness — แต่คือ การสร้างหนึ่ง product ให้สอง client บน backend เดียวที่แชร์กัน คุณเขียน FastAPI service ตัวเดียว ต่อหลังบ้านด้วย Supabase (managed Postgres และ Auth) แล้วเรียกใช้จากทั้งแอป mobile บน Flutter (ตัวหลัก ประสบการณ์แบบ mobile-first) และ web companion บน Svelte (dashboard ที่เบากว่า) API เดียวกัน แต่ front end สองแบบที่ต่างกันมาก

  • Auth — สมัครและเข้าสู่ระบบผ่าน Supabase Auth; ทุก API call ยืนยันตัวตนด้วย JWT ที่ Supabase ออกให้
  • Exercise catalog — library ของ exercise ที่ shared ร่วมกัน บวกกับที่ user สร้างเอง
  • Workout logging — เริ่ม session, เพิ่ม set (exercise, reps, weight), จบ session
  • History — ดู workout ที่ผ่านมา
  • Progress & stats — personal record, volume รายสัปดาห์, trend ต่อ exercise คำนวณฝั่ง server
  • Two clients — แอป mobile บน Flutter และ web companion บน Svelte ทั้งคู่ต่อกับ FastAPI backend เดียวกัน

แต่ละ build module ดัดแปลงคอร์สจาก Learn Hub มาใช้กับ FitTrack ทีละส่วน

โมดูลสิ่งที่คุณสร้างคอร์สใน Learn Hub ที่อ้างอิง
1 · Setup & ToolingPython toolchain (uv), โปรเจกต์ FastAPI และโปรเจกต์ SupabasePython
2 · Supabase Foundationschema, migration ของ Postgres และ Auth บน managed SupabaseSupabase
3 · FastAPI Foundationแอป FastAPI แบบ async, config, โครงสร้าง และการเข้าถึง DBPython / Python for TS Devs
4 · Auth (Supabase JWT)verify JWT ของ Supabase และ dependency get_current_userSupabase / Python
5 · Domain Modelexercise, workout และ set แบบ Pydantic + SQLAlchemy + repositoryPython
6 · Exercises APICRUD ของ exercise catalog ทั้ง shared และที่ user สร้างเองPython / REST
7 · Workouts APIบันทึก workout session พร้อม set และอ่าน historyPython
8 · Progress & Statspersonal record, volume และ aggregation ต่อ exercisePython / SQL
9 · Flutter — Foundationแอป Flutter: Riverpod, Supabase auth, API clientFlutter
10 · Flutter — TrackingUI สำหรับ tracking บน mobile: บันทึก set, ดู historyFlutter
11 · Svelte Web Companiondashboard บน SvelteKit ที่อ่าน API เดียวกันSvelte
12 · Testingpytest สำหรับ backend, widget test สำหรับ FlutterPython
13 · Deploymentcontainerize API, hosted Supabase, ship ทั้งสอง clientDocker

คุณพร้อมไปต่อเมื่อตอบคำถามพวกนี้ด้วยคำพูดของตัวเองได้:

  • ทำไม FitTrack ถึงวาง FastAPI backend ไว้หน้า Supabase แทนที่จะให้ client คุยกับ Supabase ตรง ๆ?
  • แต่ละ client ทั้งสอง — Flutter และ Svelte — ทำอะไร และมีอะไรที่ใช้ร่วมกัน?
  • feature สามอย่างไหนที่เป็นแกนหลักของ FitTrack และแนวคิดไหนบ้างที่ตั้งใจตัดออกไป?

ต่อไป architecture จะแสดงว่าแต่ละชิ้นต่อกันยังไง