Next.js 15TypeScriptMongoDB AtlasTailwind CSS 4.0NextAuth.jsRechartsFramer MotionPWAApp RouterServer Actions

FitTrack Fitness Tracker

A premium, mobile-first workout companion built for serious lifters — not a step counter. Plan your training, execute sessions, track every set, and turn raw gym data into actionable insights.

PR lookups

O(1)

logging modes

3

heatmap grid

52-wk

DB calls for warmups

0

FitTrack Technical Overview

Technical Highlights

Materialized View Pattern

ExerciseRecords acts as a denormalized cache for current PRs — eliminates full WorkoutLog scans on every set completion.

MongoDB Aggregation Pipelines

Complex $unwind → $group → $sort pipelines for analytics. Zero-weight sets filtered at the DB layer, never client-side.

Server-first Data Fetching

All sidebar data fetched in page Server Components via Promise.all. No client-side useEffect waterfalls. Each fetch independently try/catch'd.

Glassmorphism Design System

GlassCard primitive with consistent backdrop-filter, dark surface tokens, and orange-500 accent throughout. Mobile-first, one-hand usable between sets.

PWA + Service Workers

Background rest timer notifications via Web Notifications API. Offline-resilient architecture planned for gym environments with no signal.

Custom useSessionStats Hook

Unified live session state — volume, sets, estimated time remaining, PR feed — shared between sidebar and mobile variants via a single hook.

Epley 1RM (Server-only)

weight × (1 + reps/30) always computed in a Server Action. Architecture rule enforced to avoid stale client-side estimates in charts.

Work-based Calorie Estimation

Custom algorithm using total volume moved + sets completed. Accurate regardless of rest duration or timer fluctuations — not a generic MET calculation.

Core Features

Built for Performance

🏋️

Three-Mode Workout Logging

Live Session with real-time rest timers, Manual History Log for past sessions, and Plan Designer for programming. Each mode has distinct behavior — rest timer only fires in Live Session, warm-up sets never persist.

Intelligent PR Detection

Automated detection of Weight PRs and Rep PRs using a materialized ExerciseRecords collection. O(1) lookups on the gym floor — no scan, no lag. Atomic $max/$set updates preserve data integrity.

📊

PR Timeline & 1RM Tracking

Per-exercise progress chart with max weight line, Epley estimated 1RM curve (server-side), and volume bars. Time-range selector: 1M / 3M / 6M / 1Y / Custom — filtered client-side after a single fetch.

🔥

Warm-up Set Generator

Rep-aware scheme selection: STRENGTH (4 sets at 30–90%) down to ENDURANCE (1 set at 60%). Pure client-side calculation — zero DB calls. Warm-up sets are never saved to WorkoutLog.

📅

Plan vs Actual Adherence

Weekly schedule tracking with real adherence scores. Missed workouts are only flagged for past days — future planned sessions stay open. Sessions matched to plans by date, not foreign key.

📸

Shareable Workout Snapshots

Custom image generation via html2canvas creates Instagram-ready cards with PR badges, volume stats, and session highlights — ready to share directly from the completion screen.

🧱

Consistency Heatmap

GitHub-style 52-week training frequency grid with sticky day labels and auto-scroll to current week. High visual impact — turns habit data into a motivating, at-a-glance streak visualization.

⏱️

Smart Rest Timer

Auto-starts after each completed set with useRef-based interval (never inside useState). Custom rest duration per exercise in Plan Designer. Haptic + audio alerts at countdown end.

Roadmap

🤖

AI Session Debrief

After completing a workout, the Anthropic API synthesizes WorkoutLog + ExerciseRecords to generate a post-session summary — PRs hit, volume compared to last session, and a focused recommendation for what to improve next time.

Anthropic APIWorkoutLogExerciseRecords
📋

AI Program Generator

Input your goal (strength / hypertrophy / endurance), training days per week, and available equipment — the model generates a full multi-week periodized plan, directly saved to the Plans collection.

Anthropic APIPlan DesignerPeriodization