Smart fitness and nutrition partner to track meals, workouts, and progress.
A modern, responsive web application that helps users track meals, log workouts, view progress analytics, and receive motivational AI feedback β all in a sleek, animated interface with modern design aesthetics.
React 18 β’ TypeScript 5 β’ Tailwind 3 β’ Vite 5 β’ Zustand β’ Recharts
- Purpose: Landing experience and quick navigation to core flows.
- Features: Animated hero, CTAs (Get Started, Track Meal, Log Workout), feature highlights, testimonials, gradient visuals.
- Purpose: Log meals with text or images and get instant nutrition analysis.
- Features: Photo upload, description input, simulated AI analysis (calories/macros), suggestions, todayβs summary, recent meals list.
- Purpose: Record workouts and estimate calories burned.
- Features: Exercise selection, duration/intensity inputs, MET-based calorie calc, progress visuals, workout history.
- Purpose: View progress analytics and insights at a glance.
- Features: AI motivational message, key metrics (meals, workouts, streak, net calories), weekly calories chart, macro pie chart, goal progress, badges.
- Purpose: Conversational fitness and nutrition guidance.
- Features: Chat UI with typing/quick prompts, simulated responses for meals, workouts, nutrition, weight loss, hydration.
- Purpose: Manage personal info and goals to personalize insights.
- Features: User info, body metrics, daily calorie goal, goal selection, dietary preferences, personalized tips, stats cards.
- Animated Hero Section with catchy tagline and gradient text
- CTA Buttons for quick navigation (Get Started, Track Meals, Log Workout)
- Smooth Scroll Animations to features and testimonials sections
- Responsive Design with mobile-first approach
- Photo Upload for meal images
- Text/Voice Input for meal descriptions
- AI-Powered Analysis (simulated - ready for Nutritionix API integration)
- Estimates calories, protein, carbs, and fat
- Provides nutritional suggestions
- Animated Meal Cards displaying nutrition breakdown
- Today's Progress Summary with real-time calorie tracking
- Meal History with visual meal cards
- Exercise Type Selection with popular workout quick-select
- Duration & Intensity Input (low, medium, high)
- MET-Based Calorie Calculation using standard fitness formulas
- Calories = MET Γ weight(kg) Γ duration(hours)
- Animated Progress Bars showing workout trends
- Weekly Progress Visualization
- Workout History with detailed activity logs
- AI Motivational Messages with typing animation
- Key Metrics Cards:
- Total meals logged
- Total workouts completed
- Current streak (days)
- Net calories (consumed vs burned)
- Interactive Charts (Recharts):
- Weekly calories overview (Bar chart)
- Macronutrient breakdown (Pie chart)
- Goal Progress Tracking with visual progress bars
- Badges & Achievements system with gamification
- Chat Interface with typing animations
- Quick Prompts for common questions
- AI Responses for:
- Meal suggestions and recipes
- Workout routines
- Nutrition advice
- Weight loss/gain tips
- Hydration guidelines
- Simulated AI (ready for OpenAI API integration)
- Message History with timestamps
- User Profile Management
- Personal information (name, email)
- Body metrics (current weight, target weight)
- Daily calorie goals
- Health Goal Selection:
- Weight Loss
- Weight Gain
- Maintenance
- Dietary Preferences:
- Vegetarian, Non-Vegetarian, Vegan, Keto, Paleo
- Personalized Tips based on selected goals
- Stats Overview cards
- Modern Pastel Gradients (teal, purple, coral)
- Smooth Framer Motion Animations:
- Page transitions
- Card hover effects
- Button interactions
- Loading states
- Dark/Light Mode Toggle with theme persistence
- Shadcn/UI Components for consistent design
- Lucide Icons throughout the app
- Responsive Grid Layouts
- Glass-morphism Effects
- Typography: Inter, Poppins, Nunito fonts
- Badge System:
- π₯ 7-Day Streak
- π₯ Healthy Eater
- πͺ Workout Warrior
- π Calorie Champion
- π Early Bird
- Confetti Celebrations on milestones
- Streak Tracking for consistency
- Progress Animations
- React 18.2 - UI library
- TypeScript 5.2 - Type safety
- Vite 5.0 - Build tool & dev server
- Tailwind CSS 3.3 - Utility-first styling
- Framer Motion 10.16 - Animation library
- React Router DOM 6.20 - Client-side routing
- Shadcn/UI - Accessible component library
- Radix UI - Headless UI primitives
- Lucide React - Icon library
- Recharts 2.8 - Chart library
- Zustand 4.4 - Lightweight state management
- Zustand Persist - Local storage persistence
- React Hot Toast - Toast notifications
- Canvas Confetti - Celebration animations
- Axios - HTTP client (ready for API calls)
- clsx & tailwind-merge - Class name utilities
- FastAPI (Python) or Express.js (Node.js)
- Firebase - Authentication & database
- MongoDB - Alternative database option
- Nutritionix API - Meal nutrition analysis
- OpenAI GPT API - AI chat responses
- Google Vision API - Image recognition
- Node.js 18+ and npm/yarn
- Git
- Clone the repository
git clone <repository-url>
cd fitfusion- Install dependencies
npm install- Run development server
npm run dev- Open in browser
http://localhost:5173
npm run build
npm run previewfitfusion/
βββ src/
β βββ components/
β β βββ ui/ # Shadcn UI components
β β β βββ button.tsx
β β β βββ card.tsx
β β β βββ input.tsx
β β β βββ progress.tsx
β β β βββ label.tsx
β β βββ Navbar.tsx # Navigation component
β βββ pages/
β β βββ Home.tsx # Landing page
β β βββ MealLogging.tsx # Meal tracking
β β βββ WorkoutTracking.tsx # Workout logging
β β βββ Dashboard.tsx # Analytics dashboard
β β βββ AIChat.tsx # AI chat interface
β β βββ Profile.tsx # User profile
β βββ store/
β β βββ useStore.ts # Zustand state management
β βββ types/
β β βββ index.ts # TypeScript types
β βββ lib/
β β βββ utils.ts # Utility functions
β βββ App.tsx # Main app component
β βββ main.tsx # Entry point
β βββ index.css # Global styles
βββ public/ # Static assets
βββ index.html # HTML template
βββ package.json # Dependencies
βββ tailwind.config.js # Tailwind configuration
βββ tsconfig.json # TypeScript config
βββ vite.config.ts # Vite configuration
// src/services/nutritionix.ts
import axios from 'axios';
const NUTRITIONIX_API_KEY = process.env.VITE_NUTRITIONIX_API_KEY;
const NUTRITIONIX_APP_ID = process.env.VITE_NUTRITIONIX_APP_ID;
export const analyzeMeal = async (query: string) => {
const response = await axios.post(
'https://trackapi.nutritionix.com/v2/natural/nutrients',
{ query },
{
headers: {
'x-app-id': NUTRITIONIX_APP_ID,
'x-app-key': NUTRITIONIX_API_KEY,
},
}
);
return response.data;
};// src/services/openai.ts
import axios from 'axios';
const OPENAI_API_KEY = process.env.VITE_OPENAI_API_KEY;
export const getChatResponse = async (message: string) => {
const response = await axios.post(
'https://api.openai.com/v1/chat/completions',
{
model: 'gpt-3.5-turbo',
messages: [
{
role: 'system',
content: 'You are a helpful fitness and nutrition coach.',
},
{ role: 'user', content: message },
],
},
{
headers: {
Authorization: `Bearer ${OPENAI_API_KEY}`,
},
}
);
return response.data.choices[0].message.content;
};// src/lib/firebase.ts
import { initializeApp } from 'firebase/app';
import { getAuth } from 'firebase/auth';
import { getFirestore } from 'firebase/firestore';
const firebaseConfig = {
apiKey: process.env.VITE_FIREBASE_API_KEY,
authDomain: process.env.VITE_FIREBASE_AUTH_DOMAIN,
projectId: process.env.VITE_FIREBASE_PROJECT_ID,
storageBucket: process.env.VITE_FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.VITE_FIREBASE_APP_ID,
};
const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
export const db = getFirestore(app);Create .env file in root:
VITE_NUTRITIONIX_API_KEY=your_api_key
VITE_NUTRITIONIX_APP_ID=your_app_id
VITE_OPENAI_API_KEY=your_api_key
VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_domain
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id// Calories = MET Γ weight(kg) Γ duration(hours)
const calculateCalories = (met: number, weight: number, duration: number) => {
return Math.round(met * weight * (duration / 60));
};// Check consecutive days
const checkStreak = (meals: Meal[]) => {
const today = new Date().toISOString().split('T')[0];
const yesterday = new Date(Date.now() - 86400000).toISOString().split('T')[0];
const hasYesterdayMeal = meals.some(m =>
new Date(m.timestamp).toISOString().split('T')[0] === yesterday
);
if (hasYesterdayMeal) incrementStreak();
};import confetti from 'canvas-confetti';
confetti({
particleCount: 100,
spread: 70,
origin: { y: 0.6 },
colors: ['#14b8a6', '#a855f7', '#fb923c'],
});Edit tailwind.config.js:
colors: {
teal: { /* custom teal shades */ },
coral: { /* custom coral shades */ },
purple: { /* custom purple shades */ },
}Update src/index.css:
@import url('https://fonts.googleapis.com/css2?family=Inter&family=Poppins&family=Nunito&display=swap');- Mobile: Bottom navigation bar
- Tablet: Optimized grid layouts
- Desktop: Full sidebar navigation
- Breakpoints: sm (640px), md (768px), lg (1024px), xl (1280px)
- AI responses are simulated (not connected to real APIs)
- No actual authentication (Firebase ready but not implemented)
- Meal analysis uses mock data (Nutritionix integration pending)
- No backend database (data stored in localStorage)
- Real-time Firebase authentication
- Backend API integration (FastAPI/Express)
- Actual AI meal recognition using Google Vision
- Real OpenAI GPT integration
- Push notifications for reminders
- Social features (share progress, challenges)
- Export data (PDF reports)
- Meal planning calendar
- Water intake tracking
- Sleep tracking integration
MIT License - feel free to use this project for learning or commercial purposes.
Contributions are welcome! Please feel free to submit a Pull Request.
- Shadcn/UI for beautiful components
- Framer Motion for smooth animations
- Recharts for data visualization
- Lucide for icon library
- Tailwind CSS for styling system
For issues or questions, please open an issue on GitHub.
Built with β€οΈ for the MET Hackathon
Transform your health journey with FitFusion! πͺβ¨