How nerorebel/smartpantry works
SmartPantry is an offline-first household pantry app. The main workflow is adding or scanning food, looking up barcode details when available, saving products locally, and using pantry contents to discover recipes or manage shopping; product outcomes also feed history, statistics, and expiration reminders. Authentication and synchronization extend the local experience with account-specific cloud data, while appearance and localization provide cross-cutting settings. The README documents several capabilities whose individual implementations were not sampled, so those branches are represented at subsystem level; edges are limited to documented relationships or visible source references.
Main entry points: products.ts Product management · auth-context.tsx Authentication · sync-context.tsx Cloud sync · recipes.ts Recipe discovery
Components 23
Pantry workflow
- Pantry screens
src/app/(tabs)/index.tsx - Product management
src/db/products.ts - Local SQLite
src/db/database.ts - History and statistics
src/utils/statistics.ts - Expiration reminders
src/services/notifications.ts
Food discovery
- Scan and search
src/app/product/search.tsx - Barcode lookup
src/api/open-food-facts.ts - Open Food Facts
- Recipe discovery
src/api/recipes.ts - TheMealDB
- Pantry matching
src/utils/ingredient-matching.ts - Shopping list
src/db/shopping-list.ts
Accounts and sync
- Authentication
src/auth/auth-context.tsx - Auth service
src/services/auth.ts - Supabase
src/lib/supabase.ts - Cloud sync
src/sync/sync-context.tsx - Sync orchestration
src/sync/sync-service.ts - Cloud data store
src/sync/cloud-store.ts - Profile and avatars
src/components/user-avatar.tsx
App experience
- Appearance settings
src/theme/theme-context.tsx - Localization
src/i18n/index.ts - App settings storage
src/db/app-settings.ts
Other components
- Household user
Connections 25
- Household user → Pantry screens: manages pantry
README.md - Pantry screens → Product management: loads products
src/app/(tabs)/index.tsx - Product management → Local SQLite: stores products
src/db/database.ts - Household user → Scan and search: scans or searches
README.md - Scan and search → Barcode lookup: uses search hook
src/app/product/search.tsx - Barcode lookup → Open Food Facts: looks up barcode
README.md - Household user → Recipe discovery: discovers recipes
README.md - Recipe discovery → TheMealDB: fetches recipes
README.md - Recipe discovery → Pantry matching: matches ingredients
README.md - Pantry matching → Shopping list: adds missing items
README.md - Household user → Shopping list: manages list
README.md - Product management → History and statistics: records outcomes
README.md - Product management → Expiration reminders: schedules reminders
README.md - Household user → Authentication: signs in
README.md - Authentication → Auth service: delegates auth
src/auth/auth-context.tsx - Auth service → Supabase: uses client
src/services/auth.ts - Authentication → Profile and avatars: provides avatar state
src/components/user-avatar.tsx - Authentication → Cloud sync: provides session
src/sync/sync-context.tsx - Cloud sync → Sync orchestration: activates and schedules
src/sync/sync-context.tsx - Sync orchestration → Cloud data store: syncs account data
- Cloud sync → Supabase: configures cloud sync
src/sync/sync-context.tsx - Cloud sync → Expiration reminders: reconciles reminders
src/sync/sync-context.tsx - Household user → Appearance settings: sets preferences
README.md - Appearance settings → App settings storage: loads and saves
src/theme/theme-context.tsx - Appearance settings → Localization: changes language
src/theme/theme-context.tsx