How akii-real/budget-based-diet works
Budget-Based Diet Maker is a Next.js meal-planning app that targets a user's calorie and macronutrient goals within a strict INR budget, then adds ingredient price estimates. Its principal workflow is profile input, budget-aware plan generation and reuse, followed by recipe details and price comparison. Ingredient price refresh is a separate backend branch: the frontend asks Express to refresh prices, and the backend uses Python scrapers and MongoDB. The README documents capabilities not fully visible in the excerpts; their links are shown only where documented. Several UI and backend relationships remain unverified.
Main entry points: index.tsx Landing page · Wave.tsx Wave renderer · ai-meal-plan.js Plan generation API · server.js Express API
Components 29
Web experience
- Landing page
src/pages/index.tsx - Navigation
src/components/Header.tsx - Hero section
src/components/MainHero.tsx - Hero image
src/components/MainHeroImage.tsx - Product section
src/components/Product.tsx - About section
src/components/About.tsx - Lazy display
src/components/LazyShow.tsx - Analytics UI
src/components/Analytics.tsx - Canvas display
src/components/Canvas.tsx - Wave renderer
src/components/Wave.tsx - Canvas context
src/hooks/useCanvas.ts - Responsive sizing
src/hooks/useResponsiveSize.ts - Wave drawing
src/utils/wave.ts - Analytics tracking
src/lib/gtag.ts
Meal planning
- Profile input
src/pages/GetStarted.tsx - Plan selection
src/pages/diet-plan.tsx - Plan generation API
src/pages/api/ai-meal-plan.js - Local model
- Plan pool
- Recipe details
src/pages/recipe.tsx - Recipe API
src/pages/api/recipe.js
Ingredient pricing
- Price refresh helper
src/lib/ingredientPrices.js
Price backend
- Express API
backend/server.js - Price scraper
backend/scrapers/scraper.py - Price simulator
backend/scrapers/simulate_prices.py - Ingredient model
backend/models/Ingredient.js - MongoDB connection
backend/database/mongodb.js - Ingredient prices
Other components
- User
Connections 29
- User → Landing page: visits
README.md - Landing page → Navigation: renders
src/pages/index.tsx - Landing page → Hero section: renders
src/pages/index.tsx - Landing page → Hero image: renders
src/pages/index.tsx - Landing page → Product section: renders
src/pages/index.tsx - Landing page → About section: renders
src/pages/index.tsx - Landing page → Lazy display: renders
src/pages/index.tsx - Landing page → Analytics UI: renders
src/pages/index.tsx - Landing page → Canvas display: renders
src/pages/index.tsx - Canvas display → Wave renderer: renders
src/components/Canvas.tsx - Wave renderer → Canvas context: uses
src/components/Wave.tsx - Wave renderer → Responsive sizing: uses
src/components/Wave.tsx - Wave renderer → Wave drawing: uses
src/components/Wave.tsx - Analytics UI → Analytics tracking: uses
src/components/Analytics.tsx - User → Profile input: enters profile
- Profile input → Plan selection: continues to
- Plan selection → Plan generation API: requests plan
- Plan generation API → Local model: requests inference
src/pages/api/ai-meal-plan.js - Plan generation API → Plan pool: caches plans
- Plan generation API → Price refresh helper: collects ingredients
src/pages/api/ai-meal-plan.js - User → Recipe details: views recipe
- Recipe details → Recipe API: requests details
- Recipe API → Price refresh helper: uses prices
src/pages/api/recipe.js - Price refresh helper → Express API: requests refresh
src/lib/ingredientPrices.js - Express API → Price scraper: runs scraper
README.md - Express API → Price simulator: supports simulation
README.md - Price scraper → Ingredient model: upserts prices
- Ingredient model → MongoDB connection: uses connection
- MongoDB connection → Ingredient prices: stores prices