Overview
FitTrack คืออะไร
หัวข้อที่มีชื่อว่า “FitTrack คืออะไร”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 & Tooling | Python toolchain (uv), โปรเจกต์ FastAPI และโปรเจกต์ Supabase | Python |
| 2 · Supabase Foundation | schema, migration ของ Postgres และ Auth บน managed Supabase | Supabase |
| 3 · FastAPI Foundation | แอป FastAPI แบบ async, config, โครงสร้าง และการเข้าถึง DB | Python / Python for TS Devs |
| 4 · Auth (Supabase JWT) | verify JWT ของ Supabase และ dependency get_current_user | Supabase / Python |
| 5 · Domain Model | exercise, workout และ set แบบ Pydantic + SQLAlchemy + repository | Python |
| 6 · Exercises API | CRUD ของ exercise catalog ทั้ง shared และที่ user สร้างเอง | Python / REST |
| 7 · Workouts API | บันทึก workout session พร้อม set และอ่าน history | Python |
| 8 · Progress & Stats | personal record, volume และ aggregation ต่อ exercise | Python / SQL |
| 9 · Flutter — Foundation | แอป Flutter: Riverpod, Supabase auth, API client | Flutter |
| 10 · Flutter — Tracking | UI สำหรับ tracking บน mobile: บันทึก set, ดู history | Flutter |
| 11 · Svelte Web Companion | dashboard บน SvelteKit ที่อ่าน API เดียวกัน | Svelte |
| 12 · Testing | pytest สำหรับ backend, widget test สำหรับ Flutter | Python |
| 13 · Deployment | containerize API, hosted Supabase, ship ทั้งสอง client | Docker |
ตรวจสอบผล
หัวข้อที่มีชื่อว่า “ตรวจสอบผล”คุณพร้อมไปต่อเมื่อตอบคำถามพวกนี้ด้วยคำพูดของตัวเองได้:
- ทำไม FitTrack ถึงวาง FastAPI backend ไว้หน้า Supabase แทนที่จะให้ client คุยกับ Supabase ตรง ๆ?
- แต่ละ client ทั้งสอง — Flutter และ Svelte — ทำอะไร และมีอะไรที่ใช้ร่วมกัน?
- feature สามอย่างไหนที่เป็นแกนหลักของ FitTrack และแนวคิดไหนบ้างที่ตั้งใจตัดออกไป?
ต่อไป architecture จะแสดงว่าแต่ละชิ้นต่อกันยังไง