AI-Powered Personalized Nutrition Management for Medical Conditions
Features β’ Installation β’ Usage β’ Tech Stack β’ Contributing
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!
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.
- 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
- 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
- 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
- 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
- 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
- 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
- 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)
-
Clone the repository
git clone https://github.com/niksbanna/medidiet-app.git cd medidiet-app -
Install dependencies
pnpm install
-
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
-
Start the development server
pnpm start
-
Run on your device
- iOS: Press
iin the terminal or scan the QR code with the Expo Go app - Android: Press
ain the terminal or scan the QR code with the Expo Go app - Web: Press
win the terminal
- iOS: Press
- Welcome Screen: Launch the app to see the beautiful welcome screen with feature highlights
- Login/Sign Up: Enter your credentials or use social login (Google, Apple, Facebook)
- Onboarding: Complete the 6-step onboarding process:
- Basic information (name, age)
- Physical metrics (height, weight)
- Medical condition selection
- Activity level
- Dietary preferences
- Goal setting
- Dashboard: View your daily progress, quick stats, and health insights
- Meal Plan: Check your AI-generated weekly meal plan
- Log Meals: Track what you eat throughout the day
- Profile: Update your information and track BMI changes
- Navigate to the Meal Plan tab
- Tap the refresh icon to generate a new plan
- Wait for the AI loader (typically 5-10 seconds)
- Browse through 7 days of personalized meals
- View detailed nutrition information for each meal
- Navigate to the Log tab
- Tap Log New Meal
- Select meal type (breakfast, lunch, dinner, snack)
- Choose food items from the quick list
- Rate adherence (1-10)
- Add optional notes
- Tap Save
- 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
- expo-linear-gradient: Gradient backgrounds
- expo-blur: iOS-style blur effects
- @expo/vector-icons: Material Design icons
- React Native Animated API: Smooth animations
- React Context API: Global state (HealthContext)
- React Hooks: Local component state
- AsyncStorage: Local data persistence
- TypeScript Interfaces: Type-safe data models
- Google Gemini API: AI meal plan generation
- Custom AI Service: Wrapper for Gemini integration
- Fallback System: Offline meal generation
- ESLint: Code linting
- Prettier: Code formatting
- TypeScript: Static type checking
- Expo CLI: Build and deployment
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
- 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
- Breakfast:
#FF9800(Orange) - Lunch:
#4CAF50(Green) - Dinner:
#9C27B0(Purple) - Snacks:
#FF5722(Red/Orange)
- Headers: 28px, Bold
- Titles: 20px, Bold
- Body: 15px, Medium
- Small: 13px, Regular
- 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
# Run linting
pnpm lint
# Type checking
npx tsc --noEmit
# Run on iOS simulator
pnpm ios
# Run on Android emulator
pnpm android# Build for iOS
eas build --platform ios
# Submit to App Store
eas submit --platform ios# Build for Android
eas build --platform android
# Submit to Google Play
eas submit --platform androidNote: Requires EAS CLI setup and account
Contributions are welcome! Please read our Contributing Guide and Code of Conduct before getting started.
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m 'Add some amazing feature' - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
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.
- 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.
This project is licensed under the MIT License - see the LICENSE file for details.
- Niks Banna - @niksbanna
- 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
For questions or issues:
- GitHub Issues: Create an issue
- Email: [email protected]
- Documentation: Wiki
- Recipe details with cooking instructions
- Grocery list generation
- Barcode scanning for food items
- Water intake tracking
- Exercise tracking integration
- Social features (share meals, challenges)
- Healthcare provider integration
- Export reports as PDF
- Multi-language support
- Apple Health / Google Fit sync
- Meal photo recognition
- Restaurant menu analyzer
- Voice meal logging
- Wearable device integration
- Telemedicine consultation
- Lines of Code: ~5,000+
- Components: 20+
- Screens: 6 main screens
- API Integrations: 1 (Gemini AI)
- Supported Platforms: iOS, Android
- Use
React.memo()for expensive components - Implement virtualized lists for large datasets
- Optimize images with
expo-image - Use
useCallbackanduseMemoappropriately
- 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
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.
Made with β€οΈ and π€ AI