Skip to content

Add concurrently scripts to co-launch NutriHelp-AI server#268

Closed
TienNguyen3711 wants to merge 4 commits into
masterfrom
feat/s224882599-concurrent-ai-server
Closed

Add concurrently scripts to co-launch NutriHelp-AI server#268
TienNguyen3711 wants to merge 4 commits into
masterfrom
feat/s224882599-concurrent-ai-server

Conversation

@TienNguyen3711
Copy link
Copy Markdown
Collaborator

Summary

  • Add npm run dev:all script: starts both Nutrihelp-api (Node.js, port 8081) and NutriHelp-AI (Python/FastAPI, port 8000) concurrently with a single command
  • Add npm run start:all script: same for production mode
  • Add concurrently ^9.2.1 as a devDependency

Motivation

Previously, developers had to open two separate terminals and start each service manually. This change wraps both into one command, reducing setup friction without altering any API contracts or code structure.

What does NOT change

  • No API routes modified
  • No business logic touched
  • NutriHelp-AI remains a fully independent repo — the AI team continues to work on it separately
  • The HTTP communication contract between both services (http://localhost:8000/ai-model/...) is unchanged

Usage

# Development (with nodemon auto-reload)
npm run dev:all

# Production
npm run start:all
Terminal output is colour-coded: [API] in blue for Nutrihelp-api, [AI] in green for NutriHelp-AI. Ctrl+C stops both processes at once.

TienNguyen3711 and others added 4 commits May 12, 2026 18:52
Add `npm run dev:all` and `npm run start:all` scripts using the
`concurrently` package to start both Nutrihelp-api and NutriHelp-AI
(Python/FastAPI) with a single command. No code or API contracts changed.

Co-Authored-By: Tien Nguyen <s224882599@deakin.edu.au>
…demo

- chatbotService: replace stub response with Groq llama-3.3-70b (nutrition assistant)
- chatbot route: add POST / alias so mobile app can call /api/chatbot directly
- mealPlanAIController: accept snake_case fields (calorie_target, dietary_preference)
  from mobile in addition to existing camelCase fields
- healthPlanController: replace Python AI server fetch with Groq — generates 4-week
  health plan from medical report and survey data without requiring NutriHelp-AI running

Co-Authored-By: Tien Nguyen <s224882599@deakin.edu.au>
…PlanController

- chatbot route: keep POST / alias for mobile + add authenticateToken middleware
  to match master's security pattern
- healthPlanController: merge master's normalizeMedicalReportForPlan and
  buildFallbackWeeklyPlan helpers with our Groq implementation — Groq is primary,
  fallback kicks in automatically if Groq fails or is unconfigured

Co-Authored-By: Tien Nguyen <s224882599@deakin.edu.au>
Add 4 AI endpoints ported exactly from the Python FastAPI service:
- POST /ai-model/chatbot/chat
- POST /ai-model/chatbot/chat_with_rag
- POST /ai-model/chatbot/transcribe
- POST /ai-model/medical-report/plan/generate

Creates routes/ai/chatbot.js and routes/ai/healthPlan.js (CommonJS),
installs chromadb, and registers routes in routes/index.js.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant