How guadoesdev/lean-ledger-app works
Lean Ledger is a calorie and nutrition tracker with account-based food logging and an AI meal-chat workflow. Users enter meals manually or describe them (or add a photo) in chat; uncertain AI results prompt clarification, while confident chat results can be saved automatically. The server handles authentication and user-scoped operations, with Supabase as the private data store. README documents additional history, correction, undo, and nutrition-source capabilities; some AI route details were not excerpted, so those links rely on the README rather than unsampled implementation claims.
Main entry points: server.js Express API · nutrition.js Nutrition resolution · ai-meals.js AI meal workflow · gemini.js Meal understanding
Components 17
App and tracking
- Web interface
public/index.html - Express API
server.js - Account auth
server.js - Profile and targets
server.js - Food catalog
server.js - Manual food log
server.js - Weight tracking
server.js
AI meal logging
- AI meal workflow
ai-meals.js - Meal understanding
gemini.js
Nutrition lookup
- Nutrition resolution
nutrition.js - USDA FoodData
- Open Food Facts
- Optional databases
- Google Search
Persistence
- Supabase access
supabase.js - Supabase store
Other components
- User
Connections 19
- User → Web interface: enters meals
README.md - Web interface → Express API: calls endpoints
README.md - Express API → Account auth: handles login
server.js - Express API → Profile and targets: serves profile
server.js - Express API → Food catalog: serves foods
server.js - Express API → Manual food log: writes log
server.js - Express API → Weight tracking: serves weights
server.js - Express API → Supabase access: calls storage
server.js - Express API → AI meal workflow: mounts routes
server.js - AI meal workflow → Meal understanding: analyzes meals
ai-meals.js - AI meal workflow → Nutrition resolution: resolves nutrition
ai-meals.js - AI meal workflow → Supabase access: reads and writes
ai-meals.js - Nutrition resolution → USDA FoodData: searches first
nutrition.js - Nutrition resolution → Open Food Facts: searches labels
nutrition.js - Nutrition resolution → Optional databases: searches optionally
nutrition.js - Meal understanding → Google Search: grounds fallback
gemini.js - Nutrition resolution → Google Search: uses fallback
README.md - Nutrition resolution → Meal understanding: estimates fallback
README.md - Supabase access → Supabase store: queries store
supabase.js