Skip to content

feat: sync NutriHelp-AI routers to Nutrihelp-api (6 remaining routes)#275

Merged
Vedant1515 merged 1 commit into
masterfrom
feat/sync-nutrihelp-ai-routes
May 25, 2026
Merged

feat: sync NutriHelp-AI routers to Nutrihelp-api (6 remaining routes)#275
Vedant1515 merged 1 commit into
masterfrom
feat/sync-nutrihelp-ai-routes

Conversation

@TienNguyen3711
Copy link
Copy Markdown
Collaborator

@TienNguyen3711 TienNguyen3711 commented May 22, 2026

Summary

  • Port 6 remaining AI routers from NutriHelp-AI (Python/FastAPI) into Nutrihelp-api (Node/Express) as JavaScript re-implementations, completing the full 8/8 router sync
  • All new routes are registered under the /ai-model/* prefix for compatibility with the mobile app (NutriHelp-App-2026)

New files

File Route(s)
routes/ai/medicalReport.js POST /ai-model/medical-report/retrieve
routes/ai/imageAnalysis.js POST /ai-model/image-analysis/image-analysis · POST /ai-model/image-analysis/multi-image-analysis
routes/ai/mealLog.js 7 endpoints under /ai-model/meals/* (log-scan, logs, daily-summary, chat-context, plan-context, delete)
routes/ai/mealPlan.js POST /ai-model/meal-plan/generate — full port of meal_generator.py with allergy/condition filtering and scoring
routes/ai/finetuneChat.js GET /ai-model/chatbot-finetune/healthz · POST /ai-model/chatbot-finetune/chat (proxies HuggingFace Space)
services/mealLogService.js JSON file-based meal log storage (port of Python meal_log_service.py)
services/nutritionLookupService.js Nutrition lookup with EXACT_LOOKUP dict + keyword fallback (port of nutrition_lookup.py)
data/meal_library.json Meal database used by meal plan generation

Modified files

  • routes/index.js — register 5 new /ai-model/* route prefixes
  • .gitignore — add !data/meal_library.json exception so the meal library is tracked

Test plan

  • POST /ai-model/medical-report/retrieve — returns medical prediction
  • POST /ai-model/image-analysis/image-analysis — single image classification
  • POST /ai-model/image-analysis/multi-image-analysis — multi-image classification
  • POST /ai-model/meals/log-scan — creates meal log entry, returns entry + daily summary
  • GET /ai-model/meals/logs?date=&user_id= — list meal logs
  • GET /ai-model/meals/daily-summary — returns calorie totals and breakdown
  • POST /ai-model/meal-plan/generate — returns full day plan with rationale
  • GET /ai-model/chatbot-finetune/healthz — HuggingFace Space health check
  • POST /ai-model/chatbot-finetune/chat — fine-tuned chatbot response

Port remaining 6 AI routers from NutriHelp-AI (Python/FastAPI) into
Nutrihelp-api (Node/Express) as JavaScript re-implementations:

- routes/ai/medicalReport.js  — POST /ai-model/medical-report/retrieve
- routes/ai/imageAnalysis.js  — POST /ai-model/image-analysis/image-analysis
                                POST /ai-model/image-analysis/multi-image-analysis
- routes/ai/mealLog.js        — 7 endpoints under /ai-model/meals/*
- routes/ai/mealPlan.js       — POST /ai-model/meal-plan/generate
- routes/ai/finetuneChat.js   — GET/POST /ai-model/chatbot-finetune/*
- services/mealLogService.js  — JSON file-based meal log storage
- services/nutritionLookupService.js — nutrition lookup (EXACT + keyword fallback)
- data/meal_library.json      — meal database for plan generation
- routes/index.js             — register all 5 new route prefixes
- .gitignore                  — allow data/meal_library.json to be tracked

All 8 NutriHelp-AI routers are now available under /ai-model/* on Nutrihelp-api.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Vedant1515 Vedant1515 self-requested a review May 25, 2026 08:50
@Vedant1515 Vedant1515 merged commit 6890406 into master May 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants