Skip to content

Latest commit

 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to your Expo app 👋

This is an Expo project created with create-expo-app.

Get started

  1. Install dependencies

    npm install
  2. Start the app

    npx expo start

SendBlue + Claude prototype (iMessage meal logging)

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.)

1. Configure the server

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 dev

By default the API listens on port 3847 (GET /health, GET /api/meals, POST /webhooks/sendblue).

2. Expose HTTPS for SendBlue webhooks

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.

3. Point the web app at the server

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:3847 when 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 in ALLOWED_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).

Flow

  1. User texts or sends a food photo to your SendBlue number.
  2. SendBlue hits POST /webhooks/sendblue; the server acknowledges immediately, then calls Claude (vision if media_url is set), scores macros, saves to server/data/meals.json, and replies via SendBlue with fragments, reasoning, and remaining daily macros.
  3. The app fetches GET /api/meals?phone=…&date=YYYY-MM-DD and merges into the store.

In the output, you'll find options to open the app in a

You can start developing by editing the files inside the app directory. This project uses file-based routing.

Get a fresh project

When you're ready, run:

npm run reset-project

This command will move the starter code to the app-example directory and create a blank app directory where you can start developing.

Learn more

To learn more about developing your project with Expo, look at the following resources:

Join the community

Join our community of developers creating universal apps.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages