NutriPal is a SwiftUI-based iOS app for tracking daily nutrition, logging meals, and visualizing macro/micronutrient intake trends. It integrates with FatSecret for food data and HealthKit for health data access.
- Dashboard: View daily macro and micronutrient progress with visual bars.
- Meal Log: Log foods for each meal (breakfast, lunch, dinner, snacks) and review your daily intake.
- Food Search: Search for foods using the FatSecret API, view detailed nutrition facts, and add them to your log.
- History: Visualize your nutrition history with calendar selection, nutrient summaries, and trend graphs.
- Settings: Edit personal details (weight, height, birthday, gender), adjust macro goals, and manage preferences.
- Auto Goal Calculation: Automatically generate macro goals based on your profile.
- HealthKit Integration: Request permissions to sync nutrition data with Apple Health.
NutriPal/
├── App/
│ ├── ContentView.swift
│ └── NutriPalApp.swift
├── Core/
│ ├── Models/
│ ├── Persistence/
│ ├── Services/
│ └── ViewModels/
├── Features/
│ ├── Dashboard/
│ ├── History/
│ ├── MealLog/
│ ├── Onboarding/
│ ├── Search/
│ └── Settings/
├── Resources/
│ └── Assets.xcassets/
├── Shared/
│ ├── Components/
│ ├── Extensions/
│ └── Utilities/
└── ...
- App/: Main app entry point and root view
- Core/: Core business logic and data layer
- Models/: Data models (e.g.,
FoodItem,LoggedFood,UserProfile) - Persistence/: Data persistence logic (
PersistenceManager) - Services/: API integrations (
FatSecretAPI,HealthKitManager) - ViewModels/: State management for views
- Models/: Data models (e.g.,
- Features/: Feature-based UI organization
- Dashboard/: Macro dashboard and progress views
- History/: Nutrition history and trends
- MealLog/: Meal logging functionality
- Onboarding/: User onboarding flow
- Search/: Food search and nutrition facts
- Settings/: App settings and user preferences
- Resources/: App assets and resources
- Shared/: Reusable components, extensions, and utilities
-
Clone the repository:
git clone https://github.com/dhruvSuhird/NutriPal.git cd NutriPal -
Open in Xcode:
- Open
NutriPal.xcodeprojin Xcode.
- Open
-
FatSecret API Setup:
- Register for a FatSecret developer account.
- Add your
clientIdandclientSecretinFatSecretAPI.
-
Build and Run:
- Select a simulator or device and run the app.
- SwiftUI (iOS 16+ recommended for best experience)
- Charts (for trends visualization, iOS 16+)
- HealthKit (for health data integration)
Note: This app is for educational and personal use. Always consult a professional for dietary