How ashermemon/meal-mash works
1. Repository shape
- This is a two-tier product: a mobile client in client/ and a Python backend in server/.
- The client is the primary user-facing app; the server handles persistence and recipe generation logic.
2. Mobile runtime and navigation
- The client is an Expo/React Native app using TypeScript and Expo Router.
- Navigation is file-based under client/app/, with a root layout plus a tabbed shell in client/app/(tabs)/.
- The main app surfaces are home, generation, pantry, saved recipes, profile, recipe detail, and “follow recipe” flows.
3. Client feature boundaries
- UI is organized by feature under client/components/features/, which is the clearest architectural boundary in the frontend.
- Major feature areas:
- home: welcome, featured recipes, explore content
- generator: ingredient entry, leftovers, generation preview, search
- pantry: ingredient tagging and suggestions
- recipe: recipe detail, progress/timer, save/follow actions
- saved: saved recipe and favorite ingredient presentation
- auth: login
- profile: user counters / profile summary
4. State management and cross-screen coordination
- Shared app state lives in client/contexts/.
- These contexts indicate the app relies on context-based global state rather than a centralized Redux-style store.
- Important state domains include favorites, saved recipes, generation details, leftovers, nutrients, search, notifications, and recipe state.
5. Client data access and persistence
- client/httpClient.tsx is the main client-side network boundary, likely wrapping backend requests.
- client/utils/storage.ts suggests local persistence for session-like or cached app data.
- client/utils/RecipeSchema.ts implies the app validates or shapes recipe payloads before rendering or saving.
- client/utils/registerForPushNotificationsAsync.ts and scheduleDailyNotification.tsx show the client also owns local push notification setup and scheduling.
6. Recipe generation flow
- The generation workflow is split across generator components such as ingredient adders, leftover handling, search, preview cards, and generation details.
- The flow likely starts with user input in the generator UI, passes through shared generation context, and then calls the backend through the HTTP client.
- The resulting recipe preview then feeds into the recipe detail or follow-recipe screens.
7. Recipe execution flow
- client/app/followRecipe.tsx and the recipe feature components indicate a guided cooking experience, not just static recipe display.
- Components like progress bars, timers, nutrient circles, and sectioned instructions suggest a stepwise cook-along mode.
- Saving/favoriting appears to be attached directly to recipe views via dedicated feature components and contexts.
8. Pantry and ingredient knowledge
- Pantry management is a first-class feature, with tag-based ingredient UI and suggestions.
- The client also includes local ingredient datasets in client/ingredientDatabase/, including ingredientsDB.json and leftoversDB.json.
- That means some ingredient classification/suggestion behavior can happen locally without depending entirely on the server.
9. Visual system and reusable UI
- Shared UI primitives live in client/components/common/ and client/components/universal/.
- These cover reusable controls like pills, sliders, checkboxes, headers, camera access, emoji/icon rendering, and modal/sheet content.
- Styling is split between theme constants and global style definitions, which gives the app a consistent visual layer across features.
10. Backend responsibilities
- The backend is a Python application in server/, with app.py as the main entrypoint.
- models.py and the SQLite files under server/instance/ indicate a small relational persistence layer.
- gen.py is the main signal that recipe generation or AI-assisted content assembly happens server-side rather than only in the client.
11. Backend deployment/runtime
- requirements.txt and gunicorn_config.py show the server is intended to run as a production Python service, likely behind Gunicorn.
- The server uses SQLite for local/file-based persistence, which keeps the deployment lightweight and self-contained.
12. Data flow across the system
- User actions start in the mobile app UI, move through feature-specific components and contexts, then call the backend through the HTTP client when data must be generated, saved, or retrieved.
- The backend persists structured data in SQLite and returns recipe-related results to the client.
- The client then renders those results into home, pantry, generation, recipe, and saved screens, with local storage and notifications supporting offline-ish or recurring-app behavior.
13. Repo-level boundary summary
- The clearest architecture boundary is:
- Client: navigation, state, UI composition, local caching, notifications, ingredient UI
- Server: recipe generation and persistence
- Supporting assets, themes, and local ingredient databases are embedded in the client, while durable app data appears to live in the server’s SQLite store.
Main entry points: _layout.tsx App shell · RecipeContext.tsx App state · generationpage.tsx Generate · recipe.tsx Recipe view
Components 22
Client
Expo/React Native mobile app
- App shell · Root layout and tab navigation for the mobile app
client/app/_layout.tsx - Home · Entry screen with welcome, featured recipes, and explore content
client/app/(tabs)/index.tsx - Generate · Tabbed generation page that starts recipe creation
client/app/(tabs)/generationpage.tsx - Pantry · Ingredient tagging and suggestion flow
client/app/(tabs)/pantry.tsx - Saved · Saved recipes and favorite ingredient views
client/app/(tabs)/saves.tsx - Profile · User counters and profile summary
client/app/(tabs)/profile.tsx - Recipe view · Recipe detail and save actions
client/app/recipe.tsx - Cook along · Guided follow-recipe experience with progress and timers
client/app/followRecipe.tsx - Home features · Welcome, featured recipes, and explore components
client/components/features/home/Welcome.tsx - Generator features · Ingredient entry, leftovers, preview, and generation controls
client/components/features/generator/AddIngredients.tsx - Pantry features · Tagging and ingredient suggestion components
client/components/features/pantry/AddIngredientTag.tsx - Recipe features · Progress, timers, info tags, and save/follow controls
client/components/features/recipe/FollowRecipeHeader.tsx - Saved features · Saved recipe and favorite ingredient presentation
client/components/features/saved/DisplaySaved.tsx - App state · Context-based global state for favorites, saved recipes, generation, search, nutrients, and recipe flow
client/contexts/RecipeContext.tsx - HTTP client · Main client-side backend boundary
client/app/httpClient.tsx - Local storage · Client-side persistence for session-like or cached data
client/utils/storage.ts - Ingredient DB · Local ingredient and leftovers datasets used by pantry and generation flows
client/ingredientDatabase/ingredientsDB.json - Notifications · Push registration and daily scheduling support
client/utils/registerForPushNotificationsAsync.ts
Server
Python backend service
- API app · Backend entrypoint and service wiring
server/app.py - Recipe gen · Server-side recipe generation logic
server/gen.py - Models · Structured data models for backend persistence
server/models.py - SQLite store · File-based durable persistence
server/instance/db.sqlite
Connections 23
- App shell → Home: navigates to · Root shell exposes the main app surfaces
- App shell → Generate: routes · Tabbed navigation includes generation
- App shell → Pantry: routes · Tabbed navigation includes pantry
- App shell → Saved: routes · Tabbed navigation includes saved items
- App shell → Profile: routes · Tabbed navigation includes profile
- Home → Home features: uses · Home screen is assembled from feature components
- Generate → Generator features: uses · Generation screen is assembled from generator components
- Pantry → Pantry features: uses · Pantry screen is assembled from pantry components
- Recipe view → Recipe features: uses · Recipe detail and cook-along views reuse recipe components
- Saved → Saved features: uses · Saved screen is assembled from saved components
- Generator features → App state: reads/writes · Generation UI coordinates through shared context state
- Recipe features → App state: reads/writes · Recipe flow uses shared state for timers, nutrients, and save/follow actions
- Saved features → App state: reads/writes · Saved views reflect shared favorites and saved-recipes state
- Pantry features → Ingredient DB: consults · Local ingredient data supports pantry suggestions and tagging
- App state → HTTP client: requests · Shared state triggers backend fetches and mutations
- HTTP client → API app: calls · Client network boundary talks to backend API
- API app → Recipe gen: delegates · API routes invoke generation logic
- API app → Models: uses · Service uses structured persistence models
- Models → SQLite store: persists to · Backend data is stored in SQLite
- HTTP client → Local storage: caches · Client persists local session or cached app data
- Notifications → App shell: supports · Device notifications complement the app shell experience
- Generate → Recipe view: opens · Generated recipes flow into detail views
- Recipe view → Cook along: continues · Recipe detail can launch guided cook-along mode