Skip to main content

Nutrition Service

The Nutrition Service provides AI-powered food analysis and nutritional logging.

🚀 Responsibilities

  • AI Analysis: Integrating with Google Gemini AI to analyze food from images or text descriptions.
  • Nutritional Logging: Tracking daily calorie and macronutrient (Protein, Carbs, Fats) intake.
  • History Tracking: Providing historical data for user progress visualization.

🛠️ Technical Details

  • Port: 3003
  • Database: fitnexa_nutrition (PostgreSQL)
  • AI Integration: Google Generative AI (Gemini) SDK.
  • Key Model: FoodLog.

📡 API Endpoints

Food Logic

  • POST /analyze: Send an image or prompt to Gemini AI to get nutritional estimates.
  • POST /log: Store a confirmed food entry in the database.
  • GET /history/:userId: Retrieve the user's food log history.
  • PUT /log/:id: Edit a previously stored food entry.
  • DELETE /log/:id: Remove a food entry.

💾 Model: FoodLog

FieldTypeDescription
userIdStringOwner of the log
foodNameStringName of the food item
caloriesIntTotal energy in kcal
proteinFloatProtein in grams
carbsFloatCarbohydrates in grams
fatsFloatFats in grams

Back to Services Catalog