A personal wellness app that helps you log meals quickly and explore connections between what you eat and how you feel.
- Meal Tracking: Log meals in natural language or via photo. View and edit your history.
- Insight Chatbot: Ask questions like "What did I eat last week?" or "Which foods might be linked to my bloating?"
- Log meals fast: Type a natural language sentence (e.g., "For lunch today I had a hamburger, french fries and a wedge salad and afterwards felt bloated"), or upload a photo to auto-extract a description and symptoms.
- Automatic structure: The app parses your text into date, meal type, dishes, and optional symptoms.
- Ingredient awareness: It expands dish names into likely ingredients (e.g., hamburger → beef, tomato, onion, pickles, potatoes, vegetable oil, iceburg lettuce).
- History and edits: Browse your logged meals, open a meal, and edit details later.
- Meal recall: "What did I eat yesterday?", "When did I last have eggs?"
- Symptom patterns: "What foods make me feel bloated?", "Which ingredients show up when I have headaches?"
- Safe guidance: Results emphasize patterns and correlations, not medical advice.
- Client (Vite + React + MUI): UI components for logging meals, viewing history, and chatting.
- Server (Node + Express + PostgreSQL): REST API for meals and a chat endpoint that runs RAG-style analysis.
- AI: OpenAI (GPT-4o) for structured parsing, ingredient inference, and safe response generation; OpenAI embeddings for semantic search.
- Observability: Langfuse tracing around AI calls.
-
Meal logging (
POST /api/meals):- Parse free‑text into structured fields via Instructor + GPT-4o (schema‑validated with Zod)
- Infer likely ingredients from dishes using GPT-4o
- Generate a clinically toned
meal_textsummary - Create an embedding for semantic recall and store everything in Postgres
-
Meal recall (
POST /api/chatwith intentmeal_recall):- Parses time expressions (e.g., "last week"), fetches relevant meals, uses embeddings to rank by similarity, and formats a readable summary preserving line breaks.
-
Symptom analysis (
POST /api/chatwith intentsymptom_analysis):- Finds meals mentioning symptoms, runs ingredient frequency/intersection analysis, and presents possible correlations with disclaimers.
- Node.js 18+
- PostgreSQL 14+
- OpenAI API key
Create a .env file in server/:
PORT=3001
OPENAI_API_KEY=your_openai_key
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=wellness_tracker
LANGFUSE_PUBLIC_KEY=optional
LANGFUSE_SECRET_KEY=optional
LANGFUSE_HOST=optional
In two terminals:
# Terminal 1 – server
cd server
npm install
npm run dev
# Terminal 2 – client
cd client
npm install
npm run dev
Client dev server proxies '/api' to http://localhost:3001.
- Import the dump in
db/wellness_tracker_dump.sqlto create tables and seed sample data. - The
mealstable storesdishesandingredientsas arrays and ameal_textstring. Anembeddingvector is stored as text in this POC and used for similarity with PostgreSQL operators in queries. - Proof of Concept project uses data from a single user. Data taken from kaggle and transformed using google colab
GET /api/meals→ list meals (newest first)GET /api/meals/:id→ fetch one mealPOST /api/meals→ create a meal- Body:
{ "text": string, "session_id?": string } - Response: full meal record plus
debugsession info
- Body:
PATCH /api/meals/:id→ update a meal
POST /api/chat- Body:
{ "query": string, "user_id?": number, "session_id?": string } - Intents:
meal_recall,symptom_analysis,general - Returns: intent classification, number of meals considered, and a formatted
answer
- Body:
MealTracker.tsx: natural‑language input, photo upload modal, and a list of logged meals.InsightFinder.tsx: chat interface to send queries and display AI responses (markdown‑rendered).
- This app does not provide medical advice.
- Pattern findings indicate correlation, not causation.
- Consult a healthcare professional for medical concerns.