Skip to content

πŸ₯ AI-powered nutrition management app for medical conditions. Personalized meal plans via Gemini API, health tracking, and premium UI. Built with React Native & Expo. πŸ½οΈπŸ“Š

License

Notifications You must be signed in to change notification settings

niksbanna/medidiet-app

MediDiet AI πŸ₯🍽️

MediDiet AI React Native Expo TypeScript GitHub stars

AI-Powered Personalized Nutrition Management for Medical Conditions

Features β€’ Installation β€’ Usage β€’ Tech Stack β€’ Contributing


⭐ If you find MediDiet AI helpful, please give it a star! ⭐

Your support helps us grow and improve this project. Stars motivate us to add new features and maintain the app.

⭐ Star this repository to show your support!


πŸ“– Overview

MediDiet AI is a cutting-edge mobile application designed to help individuals manage their nutrition in relation to specific medical conditions such as diabetes and hypertension. Leveraging AI-powered meal planning through Google's Gemini API, the app provides personalized dietary recommendations, meal logging, and adherence tracking to support better health outcomes.

🎯 Key Objectives

  • Personalized Nutrition: AI-generated meal plans tailored to individual medical conditions
  • Easy Tracking: Simple meal logging with nutrition information
  • Health Insights: Real-time analytics and adherence monitoring
  • Medical Compliance: Guidelines aligned with medical best practices
  • Beautiful UX: Premium, modern interface with smooth animations

✨ Features

πŸ€– AI-Powered Meal Planning

  • Gemini API Integration: Utilizes Google's advanced AI for intelligent meal suggestions
  • Medical Condition Support: Specialized plans for diabetes, hypertension, and other conditions
  • Weekly Meal Plans: Complete 7-day meal schedules with breakfast, lunch, dinner, and snacks
  • Nutritional Analysis: Detailed breakdown of calories, macros, fiber, sodium, and more
  • Offline Fallback: Local meal generation when internet is unavailable

πŸ“Š Health Tracking

  • Daily Progress Dashboard: Visual overview of calories, meals logged, and adherence rates
  • Meal Logging: Quick and easy meal entry with portion tracking
  • Adherence Rating: Self-assessment of how well meals fit dietary plans
  • Health Insights: AI-powered recommendations based on tracking data
  • Weekly Trends: Historical data visualization and progress monitoring

πŸ‘€ User Profile Management

  • Comprehensive Profiles: Age, weight, height, activity level, and medical conditions
  • BMI Calculator: Automatic BMI calculation with health categorization
  • Editable Information: Easy updates to personal and medical data
  • Secure Storage: Local data persistence with AsyncStorage

🎨 Premium UI/UX

  • Modern Design: Gradient backgrounds, rounded corners, and elegant shadows
  • Smooth Animations: 400ms transitions with fade and slide effects
  • Color-Coded Elements: Intuitive visual hierarchy (breakfast=orange, lunch=green, etc.)
  • Dark Mode Ready: Adaptive color schemes for different lighting conditions
  • Responsive Layout: Optimized for various screen sizes

πŸ”” Smart Notifications

  • Non-Blocking Toasts: Success, error, warning, and info messages
  • Medical Reminders: Hydration and medication timing alerts
  • Plan Updates: Notifications when new meal plans are generated

πŸš€ Installation

Prerequisites

  • Node.js: v18 or higher
  • pnpm: v8 or higher
  • Expo CLI: Latest version
  • iOS Simulator (Mac only) or Android Studio (for emulator)
  • Physical Device: iOS or Android smartphone (optional)

Setup Steps

  1. Clone the repository

    git clone https://github.com/niksbanna/medidiet-app.git
    cd medidiet-app
  2. Install dependencies

    pnpm install
  3. Set up Gemini API key (Optional)

    • Skip this step during setup
    • After launching the app, go to Profile β†’ Settings β†’ Gemini API Key
    • Enter your API key directly in the app
  4. Start the development server

    pnpm start
  5. Run on your device

    • iOS: Press i in the terminal or scan the QR code with the Expo Go app
    • Android: Press a in the terminal or scan the QR code with the Expo Go app
    • Web: Press w in the terminal

πŸ“± Usage

First Time Setup

  1. Welcome Screen: Launch the app to see the beautiful welcome screen with feature highlights
  2. Login/Sign Up: Enter your credentials or use social login (Google, Apple, Facebook)
  3. Onboarding: Complete the 6-step onboarding process:
    • Basic information (name, age)
    • Physical metrics (height, weight)
    • Medical condition selection
    • Activity level
    • Dietary preferences
    • Goal setting

Daily Workflow

  1. Dashboard: View your daily progress, quick stats, and health insights
  2. Meal Plan: Check your AI-generated weekly meal plan
  3. Log Meals: Track what you eat throughout the day
  4. Profile: Update your information and track BMI changes

Generating a Meal Plan

  1. Navigate to the Meal Plan tab
  2. Tap the refresh icon to generate a new plan
  3. Wait for the AI loader (typically 5-10 seconds)
  4. Browse through 7 days of personalized meals
  5. View detailed nutrition information for each meal

Logging a Meal

  1. Navigate to the Log tab
  2. Tap Log New Meal
  3. Select meal type (breakfast, lunch, dinner, snack)
  4. Choose food items from the quick list
  5. Rate adherence (1-10)
  6. Add optional notes
  7. Tap Save

πŸ› οΈ Tech Stack

Frontend

  • React Native: 0.79.3 - Cross-platform mobile framework
  • Expo: ~53.0.9 - Development platform and build tools
  • TypeScript: ~5.8.3 - Type-safe JavaScript
  • Expo Router: File-based navigation system

UI Components

  • expo-linear-gradient: Gradient backgrounds
  • expo-blur: iOS-style blur effects
  • @expo/vector-icons: Material Design icons
  • React Native Animated API: Smooth animations

State Management

  • React Context API: Global state (HealthContext)
  • React Hooks: Local component state

Data & Storage

  • AsyncStorage: Local data persistence
  • TypeScript Interfaces: Type-safe data models

AI & Services

  • Google Gemini API: AI meal plan generation
  • Custom AI Service: Wrapper for Gemini integration
  • Fallback System: Offline meal generation

Development Tools

  • ESLint: Code linting
  • Prettier: Code formatting
  • TypeScript: Static type checking
  • Expo CLI: Build and deployment

πŸ“‚ Project Structure

medidiet-app/
β”œβ”€β”€ .github/                  # GitHub configuration
β”‚   └── workflows/           # GitHub Actions workflows
β”‚       β”œβ”€β”€ ai-pr-review.yml # AI code review automation
β”‚       └── README.md        # Workflow documentation
β”œβ”€β”€ app/                      # App screens (Expo Router)
β”‚   β”œβ”€β”€ (tabs)/              # Tab navigation screens
β”‚   β”‚   β”œβ”€β”€ index.tsx        # Dashboard screen
β”‚   β”‚   β”œβ”€β”€ plan.tsx         # Meal plan screen
β”‚   β”‚   β”œβ”€β”€ log.tsx          # Meal logging screen
β”‚   β”‚   └── profile.tsx      # User profile screen
β”‚   β”œβ”€β”€ index.tsx            # Welcome/login screen
β”‚   β”œβ”€β”€ onboarding.tsx       # Onboarding flow
β”‚   └── _layout.tsx          # Root layout
β”œβ”€β”€ components/              # Reusable components
β”‚   └── ui/
β”‚       β”œβ”€β”€ AILoader.tsx     # AI loading animation
β”‚       β”œβ”€β”€ MedicalDisclaimer.tsx
β”‚       └── NutrientBar.tsx  # Nutrition progress bars
β”œβ”€β”€ contexts/                # React contexts
β”‚   └── HealthContext.tsx    # Global health state
β”œβ”€β”€ hooks/                   # Custom React hooks
β”‚   β”œβ”€β”€ useHealth.tsx        # Health data hook
β”‚   β”œβ”€β”€ useColorScheme.ts    # Theme hook
β”‚   └── useThemeColor.ts     # Color utilities
β”œβ”€β”€ services/                # External services
β”‚   β”œβ”€β”€ geminiService.ts     # Gemini API wrapper
β”‚   └── aiDietService.ts     # Diet planning logic
β”œβ”€β”€ types/                   # TypeScript definitions
β”‚   └── health.ts            # Health data types
β”œβ”€β”€ utils/                   # Utility functions
β”‚   └── toast.ts             # Toast notifications
β”œβ”€β”€ constants/               # App constants
β”‚   └── Colors.ts            # Color scheme
β”œβ”€β”€ assets/                  # Static assets
β”‚   β”œβ”€β”€ fonts/              # Custom fonts
β”‚   └── images/             # Images and icons
β”œβ”€β”€ app.json                 # Expo configuration
β”œβ”€β”€ package.json             # Dependencies
β”œβ”€β”€ tsconfig.json            # TypeScript config
└── README.md               # This file

🎨 Design System

Color Palette

  • Primary Blue: #0066CC - Main brand color
  • Dark Blue: #0052A3 - Gradient end
  • Success Green: #4CAF50 - Success states
  • Warning Orange: #FF9800 - Warnings
  • Error Red: #FF6B6B - Errors
  • Background: #F5F7FA - Light gray background
  • Text: #1A1A1A - Primary text

Meal Type Colors

  • Breakfast: #FF9800 (Orange)
  • Lunch: #4CAF50 (Green)
  • Dinner: #9C27B0 (Purple)
  • Snacks: #FF5722 (Red/Orange)

Typography

  • Headers: 28px, Bold
  • Titles: 20px, Bold
  • Body: 15px, Medium
  • Small: 13px, Regular

πŸ” API Key Configuration

Gemini API Key

  • Navigate to Profile tab
  • Tap on Settings β†’ Gemini API Key
  • Enter your API key from Google AI Studio
  • The key is securely stored in your device's local storage

πŸ§ͺ Testing

# Run linting
pnpm lint

# Type checking
npx tsc --noEmit

# Run on iOS simulator
pnpm ios

# Run on Android emulator
pnpm android

πŸ“¦ Building for Production

iOS

# Build for iOS
eas build --platform ios

# Submit to App Store
eas submit --platform ios

Android

# Build for Android
eas build --platform android

# Submit to Google Play
eas submit --platform android

Note: Requires EAS CLI setup and account


🀝 Contributing

Contributions are welcome! Please read our Contributing Guide and Code of Conduct before getting started.

Quick Start

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

AI-Powered Code Review

When you open a pull request, our AI code review bot (powered by Google Gemini) will automatically:

  • πŸ€– Review your code changes
  • πŸ’‘ Provide constructive feedback
  • πŸ” Check for bugs, security issues, and best practices
  • πŸ“ Post a detailed review comment on your PR

The AI reviewer focuses on React Native, TypeScript, Expo conventions, and medical app best practices. Use the feedback as suggestions to improve your code quality.

Coding Standards

  • Use TypeScript for type safety
  • Follow existing code style and conventions
  • Write meaningful commit messages
  • Add comments for complex logic
  • Test on both iOS and Android

For detailed guidelines, see CONTRIBUTING.md.


πŸ“ License

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


πŸ‘¨β€πŸ’» Authors


πŸ™ Acknowledgments

  • Google Gemini API - For AI-powered meal planning
  • Expo Team - For the amazing development platform
  • React Native Community - For extensive libraries and support
  • Material Design - For icon system

πŸ“ž Support

For questions or issues:


πŸ—ΊοΈ Roadmap

Version 1.1 (Coming Soon)

  • Recipe details with cooking instructions
  • Grocery list generation
  • Barcode scanning for food items
  • Water intake tracking
  • Exercise tracking integration

Version 1.2

  • Social features (share meals, challenges)
  • Healthcare provider integration
  • Export reports as PDF
  • Multi-language support
  • Apple Health / Google Fit sync

Version 2.0

  • Meal photo recognition
  • Restaurant menu analyzer
  • Voice meal logging
  • Wearable device integration
  • Telemedicine consultation

πŸ“Š Statistics

  • Lines of Code: ~5,000+
  • Components: 20+
  • Screens: 6 main screens
  • API Integrations: 1 (Gemini AI)
  • Supported Platforms: iOS, Android

πŸ’‘ Tips & Tricks

Performance Optimization

  • Use React.memo() for expensive components
  • Implement virtualized lists for large datasets
  • Optimize images with expo-image
  • Use useCallback and useMemo appropriately

Best Practices

  • Always handle loading and error states
  • Validate user input before API calls
  • Use TypeScript interfaces for data structures
  • Implement proper error boundaries
  • Test on real devices, not just simulators

⭐ Show Your Support!

If you like this project and find it useful, please consider giving it a star! ⭐
It helps others discover MediDiet AI and motivates us to keep improving it.

Star this repo


Made with ❀️ and πŸ€– AI

⬆ Back to Top

About

πŸ₯ AI-powered nutrition management app for medical conditions. Personalized meal plans via Gemini API, health tracking, and premium UI. Built with React Native & Expo. πŸ½οΈπŸ“Š

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 10