A mobile MVP for generating recipes from ingredients using AI.
- Mobile App: Expo (React Native, TypeScript)
- API: Node.js TypeScript API using LangGraph.js
- Database: Supabase (Postgres + Auth)
- Deployment: Fly.io for API
SimpleBites/
├── apps/
│ ├── api/ # Node.js API server
│ └── mobile/ # Expo mobile app
- Node.js 20+
- npm or yarn
- Supabase account
- Fly.io account (for deployment)
- LLM API key (OpenAI or Anthropic)
-
Navigate to the API directory:
cd apps/api -
Install dependencies:
npm install
-
Create
.envfile (copy from.env.example):cp .env.example .env
-
Fill in
.envwith your values:LLM_API_KEY=your-llm-api-key LLM_PROVIDER=openai SUPABASE_URL=your-supabase-url SUPABASE_SERVICE_ROLE_KEY=your-service-role-key PORT=3000 -
Run migrations in Supabase:
- Go to your Supabase project SQL Editor
- Copy contents of
apps/api/migrations/001_create_recipes_and_favorites.sql - Run the SQL in the editor
-
Start the API server:
npm run dev
-
Navigate to the mobile directory:
cd apps/mobile -
Install dependencies:
npm install
-
Create
.envfile:cp .env.example .env
-
Fill in
.envwith your values:EXPO_PUBLIC_API_URL=http://localhost:3000 EXPO_PUBLIC_SUPABASE_URL=your-supabase-url EXPO_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key -
Start the Expo dev server:
npm run dev
LLM_API_KEY: Your OpenAI or Anthropic API keyLLM_PROVIDER:openaioranthropicSUPABASE_URL: Your Supabase project URLSUPABASE_SERVICE_ROLE_KEY: Your Supabase service role keyPORT: Server port (default: 3000)
EXPO_PUBLIC_API_URL: API server URL (localhost for dev, Fly.io URL for prod)EXPO_PUBLIC_SUPABASE_URL: Your Supabase project URLEXPO_PUBLIC_SUPABASE_ANON_KEY: Your Supabase anon/public key
-
POST /generate- Generate recipes from ingredients{ "ingredients": ["chicken", "tomatoes", "pasta"], "mode": "strict" | "flexible", "language": "en" | "uk" } -
GET /health- Health check
POST /recipes/save- Save a recipeGET /recipes/mine- Get user's saved recipesPOST /favorites/toggle- Toggle favorite statusGET /favorites- Get user's favorites
-
Install Fly CLI:
curl -L https://fly.io/install.sh | sh -
Login to Fly.io:
fly auth login
-
Navigate to API directory:
cd apps/api -
Launch app (if not already done):
fly launch
-
Set secrets:
fly secrets set LLM_API_KEY=your-key fly secrets set LLM_PROVIDER=openai fly secrets set SUPABASE_URL=your-url fly secrets set SUPABASE_SERVICE_ROLE_KEY=your-key fly secrets set PORT=8080
-
Deploy:
fly deploy
-
Update mobile app
.envwith production API URL:EXPO_PUBLIC_API_URL=https://your-app-name.fly.dev
-
Start API server:
cd apps/api npm run dev -
Start mobile app:
cd apps/mobile npm run dev
- API health check:
curl http://localhost:3000/health - Test recipe generation:
curl -X POST http://localhost:3000/generate -H "Content-Type: application/json" -d '{"ingredients":["chicken","rice"],"mode":"flexible","language":"en"}'
id(UUID)user_id(UUID)payload(JSONB) - Recipe objectcreated_at(TIMESTAMPTZ)
user_id(UUID)recipe_id(UUID)created_at(TIMESTAMPTZ)
Private project