Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Next.js React TailwindCSS Supabase AI Powered

🍽️ PlateX - AI-Powered Nutrition & Diet Analyzer

Transform the way you eat with intelligent food analysis, personalized meal planning, and gamified health tracking.


✨ Features Overview

PlateX is a comprehensive, AI-powered nutrition platform that combines cutting-edge vision AI with personalized diet tracking to help users achieve their health goals.

πŸ€– AI-Powered Food Analysis

  • Smart Image Analysis: Upload a photo of your meal and get instant nutritional breakdown using Google Gemini Vision AI
  • Ingredient Detection: Automatically identifies ingredients with portion estimates
  • Barcode Scanner: Quick food logging by scanning product barcodes (OpenFoodFacts integration)
  • Blood Sugar Impact: Visual chart showing predicted glycemic response

πŸ“Š Comprehensive Nutrition Tracking

  • Macro Tracking: Real-time tracking of calories, protein, carbs, and fat with visual progress rings
  • Health Score: Each meal receives an AI-generated health score (1-10)
  • Historical Logs: View past meals with full nutritional details
  • Weekly Reports: Generate downloadable PDF/image reports of your nutrition stats

πŸ₯— Intelligent Meal Planning

  • AI Diet Planner: Generate personalized meal plans based on your profile and goals
  • Weekly Meal Prep: Get a full week of meal suggestions with automated shopping list generation
  • Chef AI ("Clean the Fridge"): Input ingredients you have, and AI suggests recipes to use them up
  • Recipe Generation: Get detailed recipes with prep time, ingredients, and step-by-step instructions

πŸ’§ Wellness Tracking

  • Hydration Tracker: Track daily water intake with animated progress visualization
  • Streak Counter: Maintain logging streaks with motivational tracking
  • Food Mood Tracker: Log how foods make you feel for personalized insights
  • Body Progress Photos: Secure gallery for weekly progress photos with comparison view

πŸ† Gamification & Engagement

  • Trophy Room: Unlock achievement badges for healthy habits
    • πŸŒ… Early Bird - Log breakfast before 9 AM
    • πŸ’§ Hydration Hero - Maintain water logging streak
    • πŸ”₯ Streak Master - Maintain consecutive day logging streak
  • Level System: Progress through levels as you maintain healthy habits
  • Streak Bonuses: Earn bonus points for maintaining streaks
  • Challenges & Quests: Daily and weekly health challenges

πŸ’¬ AI Assistant

  • Floating Chat Widget: 24/7 AI nutrition assistant powered by Groq
  • Diet Advice: Get personalized answers to nutrition questions
  • Meal Suggestions: Ask for meal ideas based on dietary restrictions

πŸ‘€ User Profile & Personalization

  • Health Profile: Set age, weight, height, activity level, and goals
  • Allergy Management: Track food allergies and sensitivities
  • Medical Conditions: Account for conditions like diabetes, PCOS, thyroid issues
  • Custom Macro Targets: Auto-calculated or manually set daily goals
  • Water Goals: Personalized daily hydration targets

πŸ‘¨β€βš•οΈ Professional Support

  • Nutritionist Directory: Browse and connect with certified nutritionists
  • Consultation Booking: Schedule video consultations (Premium feature)
  • Expert Ratings & Reviews: See nutritionist ratings and specialties

πŸ’Ž Premium Features

  • Unlimited meal analysis
  • Advanced AI meal planning
  • Priority nutritionist access
  • Detailed analytics and insights
  • Ad-free experience

πŸ› οΈ Tech Stack

Category Technologies
Frontend Next.js 16 (App Router), React 19, TypeScript
Styling TailwindCSS v4, Framer Motion, Glassmorphism UI
3D Graphics Three.js, React Three Fiber, React Three Drei
Backend Next.js API Routes, Server Components
Database Supabase (PostgreSQL), Row Level Security
File Storage Supabase Storage
AI/ML Google Gemini Vision (gemini-1.5-flash), Groq (LLaMA)
Charts Recharts
Barcode html5-qrcode, OpenFoodFacts API
Utilities html2canvas (screenshots), lucide-react (icons)

πŸ“ Project Structure

PlateX/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                          # Next.js App Router pages
β”‚   β”‚   β”œβ”€β”€ api/                      # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ analyze/              # Food image analysis (Gemini)
β”‚   β”‚   β”‚   β”œβ”€β”€ barcode/              # Barcode lookup (OpenFoodFacts)
β”‚   β”‚   β”‚   β”œβ”€β”€ chat/                 # AI chat assistant (Groq)
β”‚   β”‚   β”‚   β”œβ”€β”€ planner/              # Diet plan generation
β”‚   β”‚   β”‚   β”œβ”€β”€ suggest-recipe/       # Recipe suggestions
β”‚   β”‚   β”‚   β”œβ”€β”€ weekly-meal-plan/     # Weekly meal prep generation
β”‚   β”‚   β”‚   β”œβ”€β”€ weekly-report/        # Report generation
β”‚   β”‚   β”‚   β”œβ”€β”€ save-recipe/          # Save recipes to DB
β”‚   β”‚   β”‚   └── log-voice/            # Voice logging (future)
β”‚   β”‚   β”œβ”€β”€ fridge/                   # Chef AI - ingredient-based recipes
β”‚   β”‚   β”œβ”€β”€ login/                    # Authentication
β”‚   β”‚   β”œβ”€β”€ signup/                   # User registration
β”‚   β”‚   β”œβ”€β”€ meal-prep/                # Weekly meal preparation
β”‚   β”‚   β”œβ”€β”€ nutritionist/             # Nutritionist directory
β”‚   β”‚   β”œβ”€β”€ planner/                  # Diet planner
β”‚   β”‚   β”œβ”€β”€ premium/                  # Premium subscription
β”‚   β”‚   β”œβ”€β”€ profile/                  # User profile & settings
β”‚   β”‚   β”œβ”€β”€ progress/                 # Progress photos & tracking
β”‚   β”‚   β”œβ”€β”€ report/                   # Weekly reports
β”‚   β”‚   β”œβ”€β”€ settings/                 # App settings
β”‚   β”‚   β”œβ”€β”€ shopping-list/            # Shopping list management
β”‚   β”‚   β”œβ”€β”€ layout.tsx                # Root layout
β”‚   β”‚   └── page.tsx                  # Dashboard/Home
β”‚   β”‚
β”‚   β”œβ”€β”€ components/                   # React components
β”‚   β”‚   β”œβ”€β”€ AIChatAssistant.tsx       # Floating AI chat widget
β”‚   β”‚   β”œβ”€β”€ AnalyticsChart.tsx        # Analytics visualizations
β”‚   β”‚   β”œβ”€β”€ AuthProvider.tsx          # Authentication context
β”‚   β”‚   β”œβ”€β”€ BarcodeScanner.tsx        # Barcode scanning modal
β”‚   β”‚   β”œβ”€β”€ BloodSugarChart.tsx       # Glycemic response chart
β”‚   β”‚   β”œβ”€β”€ CalendarView.tsx          # Meal calendar
β”‚   β”‚   β”œβ”€β”€ ChallengesQuests.tsx      # Gamification challenges
β”‚   β”‚   β”œβ”€β”€ ChatAssistant.tsx         # Alternative chat UI
β”‚   β”‚   β”œβ”€β”€ ComparisonView.tsx        # Progress photo comparison
β”‚   β”‚   β”œβ”€β”€ FoodMoodTracker.tsx       # Food-mood correlation
β”‚   β”‚   β”œβ”€β”€ HistoryList.tsx           # Food log history
β”‚   β”‚   β”œβ”€β”€ HydrationTracker.tsx      # Water intake tracker
β”‚   β”‚   β”œβ”€β”€ LevelSystem.tsx           # User leveling system
β”‚   β”‚   β”œβ”€β”€ LoginBackground.tsx       # Animated login background
β”‚   β”‚   β”œβ”€β”€ MacroDonut.tsx            # Donut chart for macros
β”‚   β”‚   β”œβ”€β”€ MacroProgressRings.tsx    # Circular progress rings
β”‚   β”‚   β”œβ”€β”€ ResultsCard.tsx           # Food analysis results
β”‚   β”‚   β”œβ”€β”€ Sidebar.tsx               # Navigation sidebar
β”‚   β”‚   β”œβ”€β”€ StreakBonus.tsx           # Streak bonus display
β”‚   β”‚   β”œβ”€β”€ StreakCounter.tsx         # Streak tracking UI
β”‚   β”‚   β”œβ”€β”€ ThemeToggle.tsx           # Dark/light mode toggle
β”‚   β”‚   β”œβ”€β”€ ThreeBackground.tsx       # 3D animated background
β”‚   β”‚   β”œβ”€β”€ TrophyRoom.tsx            # Achievement badges
β”‚   β”‚   β”œβ”€β”€ UploadCard.tsx            # Image upload component
β”‚   β”‚   └── WeeklyReportCard.tsx      # Weekly report summary
β”‚   β”‚
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   └── supabaseClient.ts         # Supabase client config
β”‚   β”‚
β”‚   β”œβ”€β”€ types/
β”‚   β”‚   └── index.ts                  # TypeScript types
β”‚   β”‚
β”‚   └── middleware.ts                 # Auth middleware
β”‚
β”œβ”€β”€ public/                           # Static assets
β”œβ”€β”€ supabase_schema.sql              # Main database schema
β”œβ”€β”€ supabase_progress.sql            # Progress photos schema
β”œβ”€β”€ supabase_saved_recipes.sql       # Saved recipes schema
β”œβ”€β”€ supabase_shopping_list.sql       # Shopping list schema
β”œβ”€β”€ supabase_water.sql               # Water logs schema
└── ...

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Supabase account
  • Google AI API key (Gemini)
  • Groq API key

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/PlateX.git
    cd PlateX
  2. Install dependencies

    npm install
  3. Configure environment variables

    Copy .env.example to .env.local:

    cp .env.example .env.local

    Fill in your credentials:

    # Supabase
    NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
    SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
    
    # AI APIs
    GEMINI_API_KEY=your_google_gemini_api_key
    GROQ_API_KEY=your_groq_api_key
  4. Set up Supabase database

    Run these SQL scripts in your Supabase SQL Editor (in order):

    • supabase_schema.sql - Main schema (profiles, food_logs)
    • supabase_water.sql - Water tracking
    • supabase_progress.sql - Progress photos
    • supabase_saved_recipes.sql - Saved recipes
    • supabase_shopping_list.sql - Shopping list
  5. Set up Supabase Storage

    Create the following storage buckets:

    • scans - For food photos (enable public access)
    • progress - For progress photos (private)
  6. Run the development server

    npm run dev
  7. Open in browser

    Navigate to http://localhost:3000


πŸ“‘ API Routes

Endpoint Method Description
/api/analyze POST Analyze food image with Gemini AI
/api/barcode GET Lookup product by barcode
/api/chat POST AI chat assistant (Groq)
/api/planner POST Generate personalized diet plan
/api/suggest-recipe POST Get recipe suggestions
/api/weekly-meal-plan POST Generate weekly meal plan
/api/weekly-report POST Generate weekly nutrition report
/api/save-recipe POST Save recipe to database

πŸ—„οΈ Database Schema

Core Tables

  • profiles - User profiles with health data, goals, allergies
  • food_logs - All food entries with nutritional data
  • water_logs - Hydration tracking entries
  • progress_photos - Body progress photo metadata
  • saved_recipes - User's saved recipes
  • shopping_list - Shopping list items

🎨 UI/UX Features

  • Dark Mode First: Premium dark theme with glassmorphism effects
  • 3D Animated Background: WebGL-powered particle animations
  • Responsive Design: Fully mobile-responsive with slide-out navigation
  • Micro-animations: Smooth transitions powered by Framer Motion
  • Skeleton Loading: Elegant loading states throughout
  • Toast Notifications: Non-intrusive feedback for user actions

πŸ”’ Security

  • Row Level Security (RLS): All Supabase tables protected with RLS policies
  • Authenticated Routes: Protected pages require authentication
  • Secure File Uploads: Signed URLs for file access
  • API Rate Limiting: Built-in protection against abuse

πŸ“± Screenshots

Dashboard Food Analysis Meal Prep
Main dashboard with macro tracking AI-powered food analysis results Weekly meal planning
Profile Progress Trophy Room
Health profile settings Progress photo tracking Achievement badges

πŸ—ΊοΈ Roadmap

  • Voice-based food logging
  • Apple Health / Google Fit integration
  • Social features (share meals, challenges)
  • Restaurant menu scanning
  • AI-powered grocery recommendations
  • Mobile app (React Native)

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments


Made with ❀️ by PlateX Team

About

PlateX is a responsive web application that uses AI to analyze food images, estimate nutrition (calories, macros), and track your diet.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages