A mobile-first meal planning and recipe management app with AI-powered recipe generation and Walmart shopping integration.
- AI Recipe Generation - GPT-5-nano powered recipe creation with dietary preferences
- Smart Meal Planning - Weekly meal plans with nutrition tracking
- Walmart Integration - Direct shopping cart creation with Walmart Affiliate API
- Ingredient Management - Searchable ingredient database with category filtering
- Shopping Lists - Automatic ingredient aggregation with smart merging
- Chat Assistant - AI-powered cooking assistant
- User Preferences - Dietary restrictions, cuisine preferences, and nutrition goals
- Inventory Tracking - Track what you have on hand
- Runtime: Node.js 20
- Framework: Express 5.0.1
- Language: TypeScript 5.7.2
- Database: PostgreSQL with pgvector extension
- ORM: Prisma 7.2.0
- AI: OpenAI GPT-5-nano-2025-08-07
- E-commerce: Walmart Affiliate API v2
- Auth: JWT with bcrypt
- Framework: React Native 0.81.5
- Platform: Expo 54.0.23
- Routing: Expo Router 6.0.14
- Language: TypeScript 5.9.2
- State: React Context API
pantry-chef/
├── backend/
│ ├── src/
│ │ ├── routes/ # API endpoints (13 files)
│ │ ├── services/ # Business logic (10 files)
│ │ ├── utils/ # Helper functions (4 files)
│ │ ├── middleware/ # Auth middleware
│ │ ├── config/ # Configuration
│ │ └── index.ts # Server entry point
│ ├── prisma/
│ │ └── schema.prisma # Database schema (20+ tables)
│ ├── package.json
│ ├── tsconfig.json
│ └── Dockerfile
├── frontend/
│ ├── app/ # Expo Router screens
│ ├── contexts/ # React contexts
│ ├── src/
│ │ ├── api/ # API clients
│ │ └── types/ # TypeScript types
│ ├── config.ts # API configuration
│ ├── package.json
│ └── tsconfig.json
├── docker-compose.yml
├── init-db.sql
└── README.md
- Docker Desktop (for running PostgreSQL)
- Node.js 20+ (for local development)
- Expo CLI (for frontend development)
- OpenAI API key
- Walmart Affiliate API credentials
You need to create a .env file in the root directory. This single file is used by both Docker and local development.
IMPORTANT: Copy the example file and fill in your actual credentials:
# In the root directory
cp .env.example .envThen edit .env and add your API keys:
# Database Configuration
# For Docker: use "postgres" as hostname (default in .env.example)
# For local dev: change to "localhost"
DATABASE_URL="postgresql://pantrychef:pantrychef_dev_password@postgres:5432/pantrychef"
# JWT Configuration
JWT_SECRET="your-super-secret-jwt-key-change-in-production"
JWT_EXPIRES_IN="7d"
# OpenAI API Configuration
OPENAI_API_KEY="sk-proj-your-actual-openai-api-key-here"
# Walmart Affiliate API Configuration
WALMART_CONSUMER_ID="your-consumer-id-uuid-here"
WALMART_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nyour-key-here\n-----END PRIVATE KEY-----"
WALMART_KEY_VERSION="1"
WALMART_PUBLISHER_ID="your-publisher-id-here"
# Host Configuration
HOST_IP="localhost"
PORT="3000"
NODE_ENV="development"For local development only: If you're running the backend locally (not in Docker), change the DATABASE_URL hostname from postgres to localhost:
DATABASE_URL="postgresql://pantrychef:pantrychef_dev_password@localhost:5432/pantrychef"The easiest way to get started is to run everything with Docker:
# 1. Setup environment
cp .env.example .env
# Edit .env and add your OpenAI API key and Walmart credentials
# 2. Start backend and database
docker-compose up -d
# 3. Check logs to ensure it's running
docker-compose logs -f backend
# Backend is now running on http://localhost:3000That's it for the backend! Docker handles all dependencies, database setup, and Prisma migrations automatically.
cd frontend
# 1. Install dependencies
npm install
# 2. Create frontend .env file
cp .env.example .env
# Edit .env and add your computer's IP address
# Find it with 'ipconfig' (Windows) or 'ifconfig' (Mac/Linux)
# 3. Start Expo development server
npm startChoose your platform:
- Press
afor Android emulator - Press
ifor iOS simulator - Scan QR code with Expo Go app on your phone
If you prefer to run the backend outside Docker (for easier debugging):
# 1. Setup environment
cp .env.example .env
# Edit .env and add your API keys
# IMPORTANT: Change DATABASE_URL from "postgres" to "localhost"
# 2. Start only the database with Docker
docker-compose up -d postgres
# 3. Setup backend
cd backend
npm install
npx prisma generate
npx prisma db push
npm run build
# 4. Start backend in development mode
npm run dev
# Backend runs on http://localhost:3000Frontend setup is the same as above.
POST /api/auth/register- Create new user accountPOST /api/auth/login- Login with email/passwordGET /api/auth/me- Get current user profile
GET /api/recipes- List recipes (with pagination, filtering)POST /api/recipes- Create new recipeGET /api/recipes/:id- Get recipe detailsPATCH /api/recipes/:id- Update recipeDELETE /api/recipes/:id- Delete recipe
GET /api/ingredients- List ingredients (with search, category filter)POST /api/ingredients- Add new ingredientGET /api/ingredients/:id- Get ingredient details
POST /api/meal-plans/generate-ideas- Generate recipe ideasPOST /api/meal-plans/generate-week- Generate weekly meal planGET /api/meal-plans- List user's meal plansGET /api/meal-plans/:id- Get meal plan detailsPOST /api/meal-plans/:id/shopping-list- Generate shopping list
POST /api/cart/generate- Generate cart from recipesPOST /api/cart/enrich-walmart- Add Walmart product dataPOST /api/cart/checkout- Create Walmart checkout URL
POST /api/chat- Send message to AI assistant
The app uses PostgreSQL with 20+ tables including:
- Users - User accounts with authentication
- Recipes - Recipe data with ingredients and instructions
- Ingredients - Master ingredient list
- RecipeIngredients - Junction table for recipe-ingredient relationships
- MealPlans - Weekly meal plans
- MealSlots - Individual meal slots in plans
- ShoppingLists - Generated shopping lists
- UserPreferences - User dietary preferences
- UserInventory - User's ingredient inventory
- RecipeEmbeddings - Vector embeddings for semantic search (pgvector)
- Routes handle HTTP requests and validation
- Services contain business logic and external API calls
- Utils provide helper functions for unit conversion, ingredient matching, etc.
- Middleware handles authentication and request validation
Ingredient Similarity Detection:
- Uses Levenshtein distance for fuzzy matching
- Three-tier strategy: auto-merge (≥95%), suggest (70-95%), AI verify (40-70%)
- Caches user decisions to avoid re-asking
Unit Conversion:
- Ingredient-specific conversions (e.g., 1 lemon = 0.25 cup juice)
- Generic unit conversions (volume, weight, count)
- Smart package quantity calculation for Walmart products
AI Recipe Generation:
- Strict validation rules (no "or" in ingredients, every ingredient needs a unit)
- Dietary restriction enforcement
- Nutrition target adherence
- Learning from user's recipe history
The app uses Walmart Affiliate API v2 with RSA-SHA256 signature authentication:
- Product search with relevance scoring
- Price and availability checking
- Consolidated cart creation with affiliate tracking
# Backend tests
cd backend
npm test
# Frontend tests
cd frontend
npm test- Connect your GitHub repo to Railway
- Add environment variables in Railway dashboard
- Railway will auto-deploy on push
cd frontend
# Install EAS CLI
npm install -g eas-cli
# Login to Expo
eas login
# Configure build
eas build:configure
# Build for Android
eas build --platform android
# Build for iOS
eas build --platform iosMIT
This is a hackathon project rebuilt from scratch. All code was manually written (no copy-paste) to ensure clean git history and compliance with hackathon rules.
Built with:
- OpenAI GPT-5-nano for AI features
- Walmart Affiliate API for e-commerce
- Expo for mobile development
- Prisma for database ORM
- PostgreSQL with pgvector for vector search
Note: This app is provided "as is" for educational and personal use. Always verify recipes and ingredients for safety and dietary compatibility.