Skip to content

Repository files navigation

💪 FitTrack

Sports & nutrition tracking — workouts, macros, stats and social, in one PWA.

English · 🇫🇷 Français

Demo Next.js TypeScript Supabase Tailwind PWA

▶ Live: fit-track-chi-nine.vercel.app

A complete fitness app to track your workouts, nutrition and performance. Built with Next.js, Supabase and Tailwind CSS.


✨ Features

Workouts

  • Real-time session creation and tracking
  • Customisable workout templates
  • Built-in rest timer
  • Set logging (weight, reps, RPE)
  • Automatic 1RM calculation

Nutrition

  • Multi-source food search (local database, FatSecret, OpenFoodFacts)
  • Barcode scanner
  • Macro tracking (calories, protein, carbs, fat)
  • Custom recipe creation
  • Daily food journal

Statistics

  • Per-exercise progression charts
  • Training-volume tracking
  • Personal records (PR)
  • Body measurements (weight, waist, etc.)
  • Training frequency

Social

  • Friend system (requests, accept, reject)
  • User search by name
  • Friends activity feed
  • Automatic sharing of workouts and records

Profile

  • Editable profile page (name, age, weight, height)
  • Goal selection (bulk, cut, strength, maintenance)
  • Customisable target macros
  • Auto-generated DiceBear avatar

PWA

  • Installable on mobile (Progressive Web App)
  • Offline mode with sync

🧰 Tech stack

Layer Technology
Framework Next.js 14 (App Router)
UI Tailwind CSS + Lucide Icons
Database Supabase (PostgreSQL + Auth + RLS)
Validation Zod
State Zustand
Charts Recharts
PWA next-pwa
Language TypeScript

🏛 Architecture

src/
├── app/
│   ├── (app)/              # Authenticated pages (sidebar layout)
│   │   ├── dashboard/      # Home / workouts
│   │   ├── nutrition/      # Nutrition tracking
│   │   ├── stats/          # Statistics and charts
│   │   ├── social/         # Community and friends
│   │   ├── settings/       # User profile
│   │   └── workout/        # Active session
│   ├── (auth)/             # Login / signup pages
│   └── api/                # API Routes (REST)
│       ├── profiles/  ·  workouts/  ·  nutrition/  ·  social/  ·  stats/
├── components/             # Reusable UI components
├── hooks/                  # Custom React hooks
├── lib/
│   ├── services/           # Business logic (Supabase queries)
│   ├── validations/        # Zod schemas
│   ├── calculators/        # 1RM, macros, plates
│   ├── supabase/           # Supabase clients (server/client)
│   └── sync/               # Offline sync
├── stores/                 # Zustand stores
└── types/                  # TypeScript types + DB schema

🚀 Installation

Prerequisites

  • Node.js 18+
  • npm or yarn
  • A Supabase project with the tables configured

Setup

  1. Clone the repo and cd into it
  2. Install dependencies: npm install
  3. Configure environment variables — create .env.local at the root:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-public-anon-key

# Optional: FatSecret food search
FATSECRET_CLIENT_ID=your-client-id
FATSECRET_CLIENT_SECRET=your-client-secret
  1. Configure the Supabase database — required tables are defined in src/types/database.ts: profiles, workouts / workout_sets, exercises / workout_templates, foods / meal_logs / recipes, body_measurements / personal_records, friendships / social_feed / social_comments. Enable Row Level Security (RLS) on every table.

  2. Run the dev server: npm run devhttp://localhost:3000

📜 Scripts

Command Description
npm run dev Development server
npm run build Production build
npm run start Production server
npm run lint ESLint

🔒 Security

  • Authentication handled by Supabase Auth
  • Row Level Security (RLS) on every table
  • Zod input validation on every API route
  • No hardcoded secrets in the source
  • FatSecret API keys server-side only

📄 License

MIT


Built with care by Nathan Fernandes — Founder of SYNN-IA · Dijon, France

🌐 Portfolio · 💼 LinkedIn · 🐙 GitHub

About

Sports & nutrition tracking web app — authentication, database and personal-data management. Next.js / TypeScript / Supabase. Live demo: fit-track-chi-nine.vercel.app

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages