Skip to content

IramBashir/fittrack-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FitTrack AI

AI-Powered Fitness & Nutrition Tracker

A full-stack mobile app built with React Native + Expo

React Native Expo TypeScript Groq AI


πŸ“± Screenshots

Onboarding

Welcome & Personal Info Body Measurements Goals Setup

Dashboard

Home β€” Calorie Ring & Macros Home β€” Water & Steps

Meal Logging

Food Search & Browse Food Selected

Progress & Profile

Progress & Charts Profile & BMI

AI Coach

AI Coach β€” Quick Prompts AI Coach β€” Conversation

Features

Dashboard

  • Animated SVG calorie progress ring
  • Real-time macro tracking (protein, carbs, fat)
  • Daily streak badge with color progression
  • Recovery mode β€” smart tip when calorie goal exceeded
  • Water intake tracker with visual glass indicators
  • Steps tracker with distance + calorie burn estimates

Meal Logging

  • Search from 80+ Pakistani foods database with accurate calories
  • Browse by category (Roti, Rice, Dal, Chicken, Snacks, etc.)
  • Manual entry for custom foods
  • Macronutrient breakdown per food item
  • Quick category tagging (Breakfast / Lunch / Dinner / Snack)

AI Coach (Powered by Groq + Llama 3)

  • Personalized advice using your real health data
  • Quick prompts: meal suggestions, weekly analysis, meal plans
  • Full conversation history within session
  • Context-aware β€” AI knows your BMI, calories, streak, meals

Progress Tracking

  • 7-day weight trend chart (custom SVG, no library)
  • Weekly calorie bar chart with goal comparison
  • Consistency percentage and average calorie stats
  • Smart AI insights about eating patterns

Profile & Body Stats

  • BMI calculator with color-coded health category
  • TDEE (Total Daily Energy Expenditure) calculator
  • Calorie deficit/surplus analysis with weekly projection
  • Mifflin-St Jeor BMR formula for accuracy
  • Achievement badges (On Fire, Week Win, Consistent, Dedicated)
  • Editable goals β€” calories, water, steps

Data Persistence

  • Full offline support via AsyncStorage
  • Data survives app close and reopen
  • Automatic daily reset at midnight
  • Streak calculation based on previous day's performance

Tech Stack

Category Technology
Framework React Native 0.74 + Expo SDK 51
Language TypeScript
Navigation Expo Router v3 (file-based routing)
State Management React Context + useReducer
Storage AsyncStorage (offline-first)
AI Integration Groq API β€” Llama 3.1 8B Instant
Charts react-native-svg (custom, no charting library)
Icons @expo/vector-icons (Ionicons)
Date Handling Day.js

Getting Started

Prerequisites

Installation

# Clone the repository
git clone https://github.com/IramBashir/fittrack-ai.git
cd fittrack-ai

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Add your Groq API key to .env

# Start the development server
npx expo start

Scan the QR code with Expo Go on your phone.

Environment Variables

# .env
EXPO_PUBLIC_GROQ_API_KEY=your_groq_api_key_here

Get your free Groq API key at console.groq.com β€” no credit card required.


Project Structure

fittrack-ai/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (tabs)/
β”‚   β”‚   β”œβ”€β”€ _layout.tsx
β”‚   β”‚   β”œβ”€β”€ index.tsx
β”‚   β”‚   β”œβ”€β”€ progress.tsx
β”‚   β”‚   β”œβ”€β”€ ai-coach.tsx
β”‚   β”‚   └── profile.tsx
β”‚   β”œβ”€β”€ _layout.tsx
β”‚   β”œβ”€β”€ index.tsx
β”‚   β”œβ”€β”€ onboarding.tsx
β”‚   └── add-meal.tsx
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ Card.tsx
β”‚   β”œβ”€β”€ CalorieRing.tsx
β”‚   β”œβ”€β”€ MealItem.tsx
β”‚   β”œβ”€β”€ WaterTracker.tsx
β”‚   └── StepsTracker.tsx
β”œβ”€β”€ context/
β”‚   └── AppContext.tsx
β”œβ”€β”€ constants/
β”‚   β”œβ”€β”€ theme.ts
β”‚   └── pakistaniFoods.ts
β”œβ”€β”€ screenshots/
β”œβ”€β”€ .env.example
└── README.md

Technical Highlights

Custom SVG Charts β€” Built weight trend and calorie bar charts from scratch using react-native-svg without any charting library. Handles dynamic scaling, gradient fills, and axis labels.

AI Context Injection β€” Before every Groq API call, the app injects the user's real health data (BMI, calories, meals, streak) into the system prompt. This makes responses genuinely personalized rather than generic.

Offline-First Architecture β€” All data persists via AsyncStorage with parallel read/write using Promise.all. The app works fully offline β€” AI is the only feature requiring internet.

Automatic Daily Reset β€” App compares today's date with last opened date on every launch. If it's a new day, daily trackers reset and streak is evaluated based on yesterday's calorie performance.

BMR/TDEE Calculation β€” Implements the Mifflin-St Jeor formula (most clinically accurate for general use) to calculate basal metabolic rate, then applies an activity multiplier for TDEE estimation.

About The Developer

Iram Bashir MSCS Student @ FAST NUCES Islamabad Cybersecurity Minor | Software Engineer


License

MIT License β€” feel free to fork and build on this!


Built with Love in Islamabad, Pakistan

About

AI-powered fitness & nutrition tracking app built with React Native + Expo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors