This is an Expo project created with create-expo-app.
-
Install dependencies
npm install
-
Start the app
npx expo start
The primary UI for this feature is the Vite web app under web/. The Macros page pulls meals logged via iMessage through a small Node server in server/. (There is also an Expo app at the repo root with a similar syncMealsFromRemote using EXPO_PUBLIC_* env vars.)
cd server && npm install
cp .env.example .env
# Edit .env: SENDBLUE_API_KEY, SENDBLUE_SECRET_KEY, SENDBLUE_FROM_NUMBER,
# ALLOWED_FROM_NUMBERS (comma-separated E.164), ANTHROPIC_API_KEY
npm run devBy default the API listens on port 3847 (GET /health, GET /api/meals, POST /webhooks/sendblue).
SendBlue POSTs inbound messages to your webhook URL. For local development use ngrok or Cloudflare Tunnel, then register in the SendBlue dashboard:
https://<your-host>/webhooks/sendblue
On free plans, add your phone as a verified contact so inbound iMessages are delivered.
In web/, copy web/.env.example to web/.env and set:
VITE_SYNC_API_URL— base URL of the meal API (no trailing slash), e.g.http://localhost:3847when the Vite dev server and Node server run on the same machine, or your public ngrok URL if the browser must reach the API from another host.VITE_DEMO_USER_PHONE— the same E.164 number as inALLOWED_FROM_NUMBERS.
Restart npm run dev in web/ after changing env. The Macros page syncs when you change the selected day and includes an ↻ iMessage button when these vars are set.
Expo (optional): copy .env.example at the repo root to .env and use EXPO_PUBLIC_SYNC_API_URL and EXPO_PUBLIC_DEMO_USER_PHONE for the Expo Macros tab (pull-to-refresh + focus sync).
- User texts or sends a food photo to your SendBlue number.
- SendBlue hits
POST /webhooks/sendblue; the server acknowledges immediately, then calls Claude (vision ifmedia_urlis set), scores macros, saves toserver/data/meals.json, and replies via SendBlue with fragments, reasoning, and remaining daily macros. - The app fetches
GET /api/meals?phone=…&date=YYYY-MM-DDand merges into the store.
In the output, you'll find options to open the app in a
- development build
- Android emulator
- iOS simulator
- Expo Go, a limited sandbox for trying out app development with Expo
You can start developing by editing the files inside the app directory. This project uses file-based routing.
When you're ready, run:
npm run reset-projectThis command will move the starter code to the app-example directory and create a blank app directory where you can start developing.
To learn more about developing your project with Expo, look at the following resources:
- Expo documentation: Learn fundamentals, or go into advanced topics with our guides.
- Learn Expo tutorial: Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.
Join our community of developers creating universal apps.
- Expo on GitHub: View our open source platform and contribute.
- Discord community: Chat with Expo users and ask questions.