{"components":{"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","description":"Google ID token or registered-mobile access token: Bearer <token>","scheme":"bearer","type":"http"}}},"info":{"description":"Nutrition analysis and recommendation API","title":"NutriTracker API","version":"1.0.0"},"openapi":"3.0.3","paths":{"/api/account/dashboard":{"get":{"responses":{"200":{"description":"Combined mobile dashboard data"},"401":{"description":"Browser account session required"},"502":{"description":"Mobile dashboard service unavailable"}},"summary":"Get mobile dashboard meals, goals, hydration, and points","tags":["Account"]}},"/api/account/email/login":{"post":{"requestBody":{"content":{"application/json":{"example":{"email":"user@example.com","password":"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}}},"required":true},"responses":{"200":{"description":"Secure browser session established"},"401":{"description":"Invalid mobile account credentials"}},"summary":"Sign in with the same email account as the mobile app","tags":["Account"]}},"/api/account/history":{"get":{"responses":{"200":{"description":"Mobile meal history"},"401":{"description":"Browser account session required"}},"summary":"Retrieve meals from the connected mobile account","tags":["Account"]}},"/api/analyze-meal":{"post":{"requestBody":{"content":{"application/json":{"example":{"lang":"fr","text":"2 oeufs + salade verte + 1 pomme"},"schema":{"properties":{"lang":{"example":"fr","type":"string"},"text":{"example":"2 oeufs + salade","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"datetime_utc":"2026-02-28T12:00:00Z","meal":{"items":[{"confidence":0.86,"estimated_grams":100,"macros":{"calories":156,"carbs_g":1.1,"protein_g":13.0},"name":"oeufs","quantity":2,"unit":"unit"}],"language":"fr","notes":"Estimation automatique","overall_confidence":0.8,"totals":{"calories":251,"carbs_g":18.5,"protein_g":14.2}},"schema_version":"1.0","user_id":"google_sub"}}},"description":"Analysis result"},"400":{"description":"Bad request"},"401":{"description":"Missing or invalid bearer token"},"503":{"description":"Server not configured"}},"security":[{"bearerAuth":[]}],"summary":"Analyze meal from text or image","tags":["Nutrition"]}},"/api/health":{"get":{"responses":{"200":{"content":{"application/json":{"example":{"ok":true}}},"description":"Service health"}},"summary":"Health check","tags":["System"]}},"/api/health/db":{"get":{"responses":{"200":{"content":{"application/json":{"example":{"database":"connected","ok":true}}},"description":"Database reachable"},"503":{"description":"Database not configured or not reachable"}},"summary":"Database connectivity health check","tags":["System"]}},"/api/me":{"get":{"responses":{"200":{"description":"Minimal verified profile"},"401":{"description":"Missing or invalid access token"}},"security":[{"bearerAuth":[]}],"summary":"Get the verified current account","tags":["Account"]}},"/api/me/history":{"get":{"parameters":[{"in":"query","name":"limit","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"description":"Account history, newest first"},"401":{"description":"Missing or invalid access token"},"503":{"description":"Database not configured"}},"security":[{"bearerAuth":[]}],"summary":"Retrieve saved meals and recommendations","tags":["Account"]}},"/api/recommendations":{"post":{"requestBody":{"content":{"application/json":{"example":{"goal":"weight_loss","history":[{"calories":2100,"carbs_g":180,"date":"2026-02-26","protein_g":105},{"calories":1950,"carbs_g":170,"date":"2026-02-27","protein_g":110}]},"schema":{"additionalProperties":true,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"datetime_utc":"2026-02-28T12:00:00Z","insights":{"avg_calories":2025,"avg_carbs_g":175,"avg_protein_g":108},"recommendations":[{"actions":["Add 1 egg or greek yogurt","Target 20-30g protein at breakfast"],"title":"Increase protein at breakfast","why":"Helps satiety and muscle maintenance"}],"schema_version":"1.0","user_id":"google_sub","warnings":["Estimates are not medical advice"]}}},"description":"Recommendations result"},"401":{"description":"Missing or invalid bearer token"},"503":{"description":"Server not configured"}},"security":[{"bearerAuth":[]}],"summary":"Generate personalized recommendations","tags":["Nutrition"]}}},"servers":[{"description":"Current server","url":"/"}],"tags":[{"name":"System"},{"name":"Account"},{"name":"Nutrition"}]}
