Skip to content

Repository files navigation

πŸ’ͺ FitnessPro - The Ultimate Fitness Companion

A production-ready, enterprise-grade fitness tracking application built with Next.js 15, TypeScript, and modern web technologies. This comprehensive platform rivals industry leaders with cutting-edge features and exceptional user experience.

FitnessPro Next.js TypeScript Tailwind Prisma

πŸš€ Features Overview

πŸ‹οΈ Live Workout Mode

  • Real-time Exercise Tracking: Track sets, reps, and weight with an intuitive interface
  • Smart Rest Timer: Audio cues and visual countdown between sets
  • Voice Commands: "Complete set", "Next exercise", "Log 12 reps" - hands-free operation
  • Auto-progression: Intelligent weight increases based on performance
  • Exercise Library: 17+ built-in exercises with instructions and tips
  • Drag-and-drop: Reorder exercises on the fly
  • Workout Templates: Save and reuse your favorite workouts

🍎 Nutrition Tracking

  • Barcode Scanner: Scan food products with device camera
  • Food Database: Comprehensive nutrition information
  • Macro Tracking: Real-time progress rings for calories, protein, carbs, fats
  • Water Intake: Visual tracking with daily goals
  • Meal Planning: Breakfast, lunch, dinner, and snack categorization
  • Quick Add: Recent foods and favorites for easy logging

πŸ“Š Advanced Analytics

  • Progress Charts: Strength progression, volume trends, frequency heatmaps
  • Muscle Balance: Radar charts showing muscle group distribution
  • Body Metrics: Weight, body fat %, measurements tracking
  • AI Insights: Automatic plateau detection and recommendations
  • Personal Records: Timeline of achievements with celebrations
  • Export Reports: PDF progress reports with charts

🎀 Voice & Audio System

  • Voice Commands: 15+ natural language commands
  • Audio Feedback: Exercise announcements, countdown timers, celebrations
  • Motivational Phrases: "Great job!", "One more set!", "New personal record!"
  • Customizable Sounds: Volume controls, mute options, sound themes
  • Multi-language Support: Starting with English

πŸ‘₯ Social Features

  • Workout Buddy Sync: Real-time workout sharing with friends
  • Live Reactions: Send πŸ”₯πŸ’ͺπŸ‘ during buddy workouts
  • Community Templates: Share and discover workout templates
  • Creator Profiles: Follow fitness experts and trainers
  • Achievements: Unlock badges and share milestones
  • Leaderboards: Friendly competition with workout stats

πŸ”’ Enterprise Features

  • Authentication: JWT-based secure authentication system
  • Data Privacy: GDPR-compliant with full data export
  • Monitoring: Comprehensive logging and analytics dashboard
  • Performance: Optimized queries, caching, lazy loading
  • PWA Support: Install as app, offline functionality
  • Responsive Design: Works on all devices

πŸ’Ύ Data Management

  • Export Options: JSON, CSV, PDF formats
  • Import Functionality: Restore from backups
  • Automatic Backups: Smart reminder system
  • GDPR Compliance: Download all data, delete account
  • Cloud Integration: Ready for Google Drive, Dropbox

πŸ› οΈ Tech Stack

  • Frontend: Next.js 15, React 19, TypeScript
  • Styling: Tailwind CSS v3, Framer Motion
  • Database: Prisma ORM with SQLite (dev) / PostgreSQL (prod)
  • State Management: React Query (TanStack Query)
  • Forms: React Hook Form with Zod validation
  • Charts: Recharts for data visualization
  • Voice: Web Speech API
  • Camera: React Webcam + jsQR for barcode scanning
  • Real-time: Server-Sent Events (SSE)
  • Testing: Jest, React Testing Library (ready)
  • Monitoring: Custom logging system with analytics

πŸš€ Quick Start

# Clone the repository
git clone https://github.com/yourusername/fitness-pro.git
cd fitness-pro

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env.local

# Set up database
npx prisma migrate dev
npm run db:seed

# Start development server
npm run dev

Visit http://localhost:3000 and login with:

πŸ“± Core Routes

  • /login - Authentication
  • /register - Create new account
  • /dashboard - Main dashboard with stats and activities
  • /workouts - Workout management and templates
  • /workouts/[id]/live - Live workout mode with timer
  • /nutrition - Food tracking with barcode scanner
  • /progress - Analytics and insights
  • /community - Browse and share templates
  • /buddies - Manage workout partners
  • /settings - Preferences and data export
  • /admin/analytics - Monitoring dashboard (admin only)

🎯 Key Features in Detail

Live Workout Experience

1. Start workout β†’ Timer begins
2. Voice command: "Complete set" β†’ Rest timer starts
3. Audio countdown: "3, 2, 1, rest complete"
4. Swipe to mark sets done
5. Real-time buddy sync shows friend's progress
6. Auto-detect personal records with celebrations

Nutrition Tracking Flow

1. Click "Add Food" β†’ Camera opens
2. Scan barcode β†’ Nutrition data appears
3. Adjust serving size β†’ Macros update
4. Save to meal β†’ Progress rings animate
5. Water intake β†’ Visual glass fills

Community Engagement

1. Browse templates β†’ Filter by your needs
2. Preview exercises β†’ One-click copy
3. Rate and review β†’ Help others
4. Share your workout β†’ Gain followers
5. Get verified β†’ Blue checkmark

πŸ—οΈ Project Structure

fitness-pro/
β”œβ”€β”€ app/                    # Next.js 15 app directory
β”‚   β”œβ”€β”€ (auth)/            # Auth pages (login, register)
β”‚   β”œβ”€β”€ (authenticated)/    # Protected pages
β”‚   β”‚   β”œβ”€β”€ dashboard/     # Main dashboard
β”‚   β”‚   β”œβ”€β”€ workouts/      # Workout features
β”‚   β”‚   β”œβ”€β”€ nutrition/     # Nutrition tracking
β”‚   β”‚   β”œβ”€β”€ progress/      # Analytics
β”‚   β”‚   β”œβ”€β”€ community/     # Social features
β”‚   β”‚   β”œβ”€β”€ buddies/       # Workout partners
β”‚   β”‚   └── settings/      # User settings
β”‚   └── api/               # API routes
β”œβ”€β”€ components/            # Reusable UI components
β”‚   β”œβ”€β”€ ui/               # Base UI components
β”‚   β”œβ”€β”€ workout/          # Workout-specific
β”‚   β”œβ”€β”€ nutrition/        # Nutrition-specific
β”‚   β”œβ”€β”€ community/        # Community features
β”‚   └── settings/         # Settings components
β”œβ”€β”€ lib/                   # Utilities and helpers
β”‚   β”œβ”€β”€ api-client.ts     # API client
β”‚   β”œβ”€β”€ logger.ts         # Logging system
β”‚   β”œβ”€β”€ audio-manager.ts  # Audio system
β”‚   └── utils.ts          # Helper functions
β”œβ”€β”€ providers/             # React context providers
β”‚   β”œβ”€β”€ AuthProvider.tsx   # Authentication
β”‚   β”œβ”€β”€ VoiceProvider.tsx  # Voice commands
β”‚   └── MonitoringProvider.tsx # Analytics
β”œβ”€β”€ prisma/               # Database schema and migrations
└── public/               # Static assets
    └── sounds/           # Audio files

πŸ” Security Features

  • JWT token authentication
  • Secure password hashing with bcrypt
  • Rate limiting on APIs
  • Input validation and sanitization
  • XSS protection
  • CSRF protection
  • Secure headers
  • Data isolation per user

πŸ“ˆ Performance Optimizations

  • Code splitting with dynamic imports
  • Image optimization with Next.js Image
  • API response caching with React Query
  • Database query optimization with indexes
  • Lazy loading for components
  • Service worker for offline support
  • Debounced search inputs
  • Virtual scrolling for large lists

🎨 Design System

  • Consistent color palette with primary/secondary colors
  • Dark mode support throughout
  • Accessible components with ARIA labels
  • Smooth animations with Framer Motion
  • Responsive breakpoints for all screens
  • Glass morphism effects
  • Custom Tailwind configuration

πŸš€ Deployment

Vercel (Recommended)

npm run build
vercel

Docker

docker build -t fitness-pro .
docker run -p 3000:3000 fitness-pro

Traditional Hosting

npm run build
npm start

πŸ“ Environment Variables

# Database
DATABASE_URL="file:./dev.db"  # SQLite for dev
# DATABASE_URL="postgresql://..."  # PostgreSQL for prod

# Authentication
JWT_SECRET="your-secret-key-here"

# Application
NEXT_PUBLIC_APP_URL="http://localhost:3000"

# Optional
NEXT_PUBLIC_GA_ID="UA-XXXXXXXXX-X"

πŸ§ͺ Testing

# Run unit tests
npm test

# Run e2e tests
npm run test:e2e

# Run with coverage
npm run test:coverage

πŸ“Š Database Schema

The app uses Prisma ORM with the following main models:

  • User - User accounts and profiles
  • Workout - Workout sessions
  • Exercise - Exercise definitions
  • WorkoutSet - Individual sets within workouts
  • NutritionEntry - Food and nutrition logs
  • Goal - User fitness goals
  • Achievement - Unlockable achievements
  • CommunityTemplate - Shared workout templates
  • WorkoutBuddy - Social connections

🀝 Contributing

This is a showcase project demonstrating full-stack development capabilities. Feel free to:

  • Report bugs
  • Suggest features
  • Submit pull requests
  • Use as inspiration for your own projects

πŸ“„ License

MIT License - Feel free to use this code for learning and inspiration.

πŸ™ Acknowledgments

Built with passion using:

  • Next.js team for the amazing framework
  • Vercel for hosting and deployment
  • Tailwind CSS for the utility-first CSS framework
  • Prisma for the excellent ORM
  • All the open-source contributors

Built with ❀️ in PSYCHO MODE! This fitness app demonstrates enterprise-grade development with a focus on user experience, performance, and scalability. Every feature has been crafted to provide the best possible fitness tracking experience.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages