A clean, focused nutrition tracking app for iOS built with SwiftUI. No fitness features, no ads, no sponsored content. Just simple, swift food logging.
We do not collect or track any of your personal data. The app will save information to your local device, but only you have access and it will be deleted upon app deletion.
- 🔍 Barcode Scanning: Scan food barcodes using your camera to instantly log nutrition data
- 🔎 Smart Food Search: Search for foods with automatic API fallback to OpenFoodFacts and local Database
- ✏️ Manual Food Entry: Create custom foods with complete nutritional customization
- 🍳 Recipe Management: Build recipes from ingredients with automatic nutrition calculation
- 📱 Offline-First: Full functionality without internet connection using local SQLite database
- ⏰ Recent Foods: Quick access to recently logged items
- 🍽️ Meal Organization: Log foods to breakfast, lunch, dinner, or snacks
- 📏 Smart Units: Flexible serving size units with automatic conversion
- 🌙 Dark/Light Themes: System aware theming with manual override
- ⚙️ Customizable Tracking: Choose which nutrients to monitor (calories, protein, carbs, fat, fiber, etc.)
- 📊 Daily Dashboard: Visual nutrition summary with goal tracking
- 📈 History Charts: View progress over daily, weekly, and monthly periods
- 🎯 Nutrition Goals: Set and track personal nutrition targets
- Framework: SwiftUI + iOS 15+
- Database: SQLite3 with thread-safe operations
- Camera: AVFoundation for barcode scanning
- APIs: OpenFoodFacts API
Swiftrax/
├── Models/ # Core data models (Food, FoodEntry, Recipe, etc.)
├── Networking/ # All things API
├── Persistance/ # All things database
├── Utilities/ # Swift extensions and other helpers
├── Views/ # SwiftUI views organized by feature
├── ContentView/ # Main SwiftUI view features
├── SwiftraxApp.swift # Entrypoint into the app
- DatabaseManager: Thread safe SQLite operations with duplicate prevention
- APIManager: Handles OpenFoodFacts and USDA API integration
- BarcodeScannerUtility: Camera-based barcode detection
- UnitConverter: Flexible measurement unit conversion system
- BasicFoodsSeeder: Populates database with common foods
- Barcode scanning with camera integration
- Food search with API fallback
- Manual food entry with full customization
- Local SQLite storage with offline functionality
- Recipe creation and management
- Nutrition tracking with customizable metrics
- Data visualization and goal tracking
- Dark/light theme support
- Clone the repository
git clone https://github.com/ameliatuttle/Swiftrax
- Open
Swiftrax.xcodeprojin Xcode 15+ - Build and run on iOS device or simulator
- Grant camera permissions for barcode scanning
The app uses SQLite with the following main tables:
| Table | Description |
|---|---|
| Foods | Stores food items with nutrition data |
| FoodEntries | Daily food logs with quantities and meal types |
| Recipes | User-created recipes with serving information |
| RecipeIngredients | Recipe components and quantities |
| UserSettings | App preferences and nutrition goals |
- OpenFoodFacts: Primary source for barcode-based food data
- Graceful fallback handling with offline-first architecture
| Dashboard | Food Search | Recipe Creation | Manual Entry | History | Settings | App Logo |
|---|---|---|---|---|---|---|
- OpenFoodFacts for their comprehensive food database
- USDA FoodData Central for nutrition data
- Apple's SwiftUI team for the excellent framework
- Brittney Hanson for the awesome App Logo
Built as a capstone project focusing on clean architecture, user experience, and practical nutrition tracking without the bloat of typical fitness apps.
Author: Amelia Tuttle
Date: July 2025