FJ Database Relationships

Senior Level 1 — Relational Model

5 Entities, Clear Hierarchy
Primary Key
Foreign Key (relation)
Linked reference
📋
PROGRAM PLAN
The master 30-day blueprint. Dictates what happens each day — which workout, which test, which education.
Program IDSEN-L1-001
Name (EN)text
Name (TH)text
Duration30 days
Difficultyselect
Goalmulti-select
→ Weekly Plansrelation × 4
has 4
📅
WEEKLY PLAN
7-day rolling block (not Mon-Sun). Each week has a theme and progressive difficulty. User can start any day.
Week Number1-4
Theme (EN)text
Theme (TH)text
Difficulty Notetext
→ Program Planrelation
→ Workoutsrelation × 7
contains 7
🏋️
WORKOUT
One day's exercise session. Contains exercise table with reps, sets, rest. Links to EXERCISE entries.
Workout IDe.g. W1-D1
Day Number1-30
Title (EN/TH)text
Category🔴🟡🟢
Exercise Tableembedded
RPE Targettext
→ Exercisesrelation × 3-5
→ Weekly Planrelation
links to
📝
ACTION & INPUT
Daily user dashboard. Bundles education, workout reference, completion tracking, and test input. One record per day per user.
Day Number1-30
Education Videourl (if any)
→ Workoutrelation
Did Workout?checkbox
Test Inputnumber (if any)
Test Typeselect (if any)
Notestext
💪
EXERCISE
Reference library. Each exercise has a name (TH/EN) and a video link. Shared across workouts and programs.
Exercise IDe.g. chair-stand
Name (EN)text
Name (TH)text
Video Linkurl
Equipmentmulti-select
Muscle Groupmulti-select
Categoryselect
How they connect:
PROGRAM PLAN → owns 4 WEEKLY PLANs → each owns 7 WORKOUTs → each links to 3-5 EXERCISEs
ACTION & INPUT → references one WORKOUT per day + collects user data (completion, test scores)

Key insight: EXERCISE is a shared library — the same "Chair Stand" exercise can appear in Day 1, Day 8, Day 22 with different reps/sets. The WORKOUT table holds the specific prescription (reps, sets, rest) while EXERCISE holds the identity (name, video).
What the User Sees: 30 Days
Each day, ACTION & INPUT tells the user what to do. It pulls from WORKOUT for exercises and shows education + tracker.
WEEK 1
ปลุกกล้ามเนื้อ / Wake Up
Day 1
📚 Education: ทำไมกล้ามขาสำคัญ 🔴 Workout: ยืนให้แข็งแรง ✅ Did workout?
Day 2
📚 Education: ระบบทรงตัว 🟡 Workout: หาจุดทรงตัว ✅ Did workout?
Day 3-6
🔴🟢🔴🟡 Alternating categories ✅ Daily tracking
Day 7
🔵 Light workout 📊 Assessment: Chair Stand, Arm Curl, Step Test... ✅ + test scores
WEEK 2
สร้างพื้นฐาน / Build Foundation ↑ more reps, + 1 set
Day 8-13
Progressive exercises 📚 New topics each day ✅ Daily
Day 14
📊 Mid-program assessment ✅ + test scores
WEEK 3
ฝึกทรงตัว / Balance Training ↑ complexity, new movements
Day 15-20
Advanced variations ✅ Daily
Day 21
📊 Week 3 assessment
WEEK 4
รวมร่าง / Bring It Together ↑ combine all skills
Day 22-29
Combined workouts 📚 Wrap-up education ✅ Daily
Day 30
📊 FINAL Assessment ✅ Compare Day 1 vs Day 30 🎉 Program Complete
What Each Database Entry Looks Like

📋 PROGRAM PLAN

Name (EN): 30 Days Senior Level 1 Challenge
Name (TH): เริ่มขยับ ฟิตร่างผู้สูงอายุ 30 วัน
Duration:   30 days
Difficulty: Beginner
Goal:       Senior Fitness, Fall Prevention
→ Weekly Plans: [Week 1, Week 2, Week 3, Week 4]

📅 WEEKLY PLAN (Week 1)

Week:       1
Theme (EN): Wake Up
Theme (TH): ปลุกกล้ามเนื้อ
Note:       เริ่มต้นเบาๆ RPE 2-3/10
→ Program:  Senior Level 1
→ Workouts: [Day 1, Day 2, ..., Day 7]

🏋️ WORKOUT (Day 1)

Day:        1
Title (EN): Stand Strong
Title (TH): ยืนให้แข็งแรง
Category:   🔴 Strength
RPE:        2-3/10

| Exercise         | Reps      | Sets | Rest  |
|------------------|-----------|------|-------|
| ลุก-นั่ง         | 8 ครั้ง    | 1    | 45s   |
| ยกปลายเท้า       | 10 ครั้ง   | 1    | 30s   |
| ยืดข้อเท้า        | 6/ข้าง    | 1    | 0s    |

→ Exercises: [chair-stand, toe-raises, wall-ankle]

📝 ACTION & INPUT (Day 1)

Day:            1
Education:      📚 ทำไมกล้ามขาสำคัญ (3 min video)
→ Workout:      Day 1 — ยืนให้แข็งแรง
Did Workout?:   ☐ (user checks)
Test Input:     — (no test today)
Notes:          — (user can add)

📝 ACTION & INPUT (Day 7 — Assessment)

Day:            7
Education:      📚 วิธีวัดผลด้วยตัวเอง
→ Workout:      Day 7 — Week 1 Check-in
Did Workout?:   ☐
Test Input:     Chair Stand: __ ครั้ง
                Arm Curl: __ ครั้ง
                Step Test: __ ก้าว
                Sit & Reach: __ ซม.
Notes:          —

💪 EXERCISE

ID:          chair-stand
Name (EN):   Chair Stand
Name (TH):   ลุก-นั่งจากเก้าอี้
Video:       Chair Stand up (ลุกนั่ง).MP4
Equipment:   Chair
Muscle:      Legs, Hip
Category:    Strength
Data flow: When a user opens Day 1, the app reads ACTION & INPUT for Day 1 → shows the education video → renders the WORKOUT table (which pulls exercise names + video links from EXERCISE) → provides the "Did workout?" checkbox → stores the response back into ACTION & INPUT.

On assessment days (7, 14, 21, 28, 30): ACTION & INPUT also shows test input fields. The user enters their scores, which get stored for before/after comparison.