AI-powered calorie tracking app with natural language meal logging.
Describe what you ate in plain English — the AI identifies foods, estimates portions, and calculates calories from USDA nutrition data.
- Natural Language Meal Logging — Type "2 eggs and toast" and the AI parses it automatically
- Smart Food Matching — 100+ food synonyms and a 104-food USDA database
- Insights & Analytics — Daily summaries, 7-day trends, weekly averages
- Meal Editing — Update descriptions, adjust quantities, auto-recalculate calories
- Food Search — Wildcard patterns (
*bread*,app*) with pagination - CSV Export — Detailed meals or daily summaries, Excel/Google Sheets compatible
- Cross-Platform — Web (PWA), Windows desktop, Android/iOS (coming soon)
- Secure — API key stored server-side only, input validation, graceful error handling
- Offline Fallback — Local parser works when the backend is unavailable
| Layer | Technology |
|---|---|
| Frontend | Flutter 3.10+ / Dart, Provider, Freezed, Dio, sqflite |
| Backend | Node.js 18+, Express |
| AI | Google Gemini 2.0 Flash |
| Database | SQLite (mobile/desktop), in-memory (web) |
| Nutrition Data | USDA MyPyramid (104+ foods) |
- Flutter SDK 3.10.4+
- Node.js 18.0+
- Gemini API Key (free)
git clone https://github.com/AaronBezi/CalorieChat.git
cd CalorieChat/calorie_chatcd backend
npm installCreate backend/.env:
GEMINI_API_KEY=your_api_key_here
PORT=3000
NODE_ENV=developmentnpm startcd CalorieChat/calorie_chat
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
flutter run -d chrome # web
# or
flutter run -d windows # desktopFlutter calorie_chat/.env:
API_BASE_URL=http://localhost:3000Backend calorie_chat/backend/.env:
GEMINI_API_KEY=your_key_here
PORT=3000
NODE_ENV=development- Open the Chat tab
- Type a meal description:
"2 eggs, toast, and coffee" - Click Parse Meal
- Review detected foods and adjust quantities
- Click Save Meal
- Open the Search tab
- Type a food name or use wildcards:
*bread* - Browse paginated results
- Open the Insights tab
- See today's totals and 7-day trends
- Edit or delete meals
- Export data to CSV
calorie_chat/
├── lib/
│ ├── core/ # Config, networking, services, utils
│ ├── data/ # DAOs, models (Freezed), repositories
│ └── features/
│ ├── chat/ # AI meal logging
│ ├── search/ # Food search
│ └── insights/ # Analytics & history
├── backend/
│ └── server.js # Express API proxy → Gemini
├── assets/data/ # USDA food database (JSON)
├── data_pipeline/ # USDA CSV-to-JSON conversion tools
└── test/ # Unit tests (30 tests)
User Input → Flutter UI → Backend Proxy → Gemini AI
↓ ↓
SQLite / Web Storage ← Parsed Results
# Web
flutter build web # → build/web/
# Windows
flutter build windows # → build/windows/runner/Release/
# Android
flutter build apk # → build/app/outputs/flutter-apk/flutter test30 unit tests covering input validation, state management, food matching, search, pagination, and text normalization.
GET /health
→ { "status": "ok", "timestamp": "...", "version": "1.0.0" }
POST /api/parse-meal
Content-Type: application/json
{ "text": "2 eggs and toast" }
→ {
"items": [
{ "query": "eggs", "quantity": 2, "portionHint": null },
{ "query": "toast", "quantity": 1, "portionHint": null }
]
}