An intelligent full-stack application that revolutionizes meal planning and grocery shopping through AI-powered recipe discovery, inventory management, and automated shopping list generation.
- Swipe Interface: Tinder-style recipe discovery with personalized recommendations
- AI Recipe Generation: Create custom recipes based on your pantry inventory and dietary preferences
- Smart Scraping: Automated recipe extraction from popular cooking websites using JSON-LD and browser rendering
- Advanced Filters: Dietary restrictions, cuisine types, cooking time, and difficulty levels
- Weekly Planner: Interactive calendar-style meal planning for the entire week
- Recipe Assignment: Drag-and-drop interface to assign recipes to specific days
- Flexible Planning: Leave days blank or assign multiple recipes per day
- AI-Powered Generation: Automatically generate shopping lists from recipes using OpenAI
- Inventory Integration: Compares recipe ingredients against your current pantry inventory
- Amazon Fresh Integration: One-click export to Amazon Fresh with optimized formatting
- Quantity Aggregation: Automatically combines duplicate items across multiple recipes
- Comprehensive Tracking: Track pantry items with quantities, expiration dates, and storage locations
- Smart Categories: Organized by food categories and subcategories
- Low Stock Alerts: Automatic restock flagging based on minimum quantity thresholds
- Purchase History: Track spending and purchase patterns
Frontend: React 19 + TypeScript + Vite + Tailwind CSS + Shadcn/UI
Backend: Hono framework on Cloudflare Workers
Database: Cloudflare D1 (SQLite)
Storage: Cloudflare KV for caching
AI: OpenAI GPT-4 for recipe generation and shopping list optimization
Scraping: Cloudflare Browser Rendering + Puppeteer
- Node.js 18+ and npm
- Cloudflare account with Workers access
- OpenAI API key
git clone https://github.com/smaldd14/agent-devin.git
cd agent-devin
npm install
# Set up your OpenAI API key
npm run secret OPENAI_API_KEY
# Follow the prompt to enter your API key
Apply the database schema to your Cloudflare D1 database:
# Create your D1 database in Cloudflare Dashboard first
# Then apply migrations
wrangler d1 execute agent-devin --file=./migrations/schema.sql
Update wrangler.json
with your database and KV namespace IDs:
{
"d1_databases": [
{
"binding": "DB",
"database_name": "agent-devin",
"database_id": "YOUR_DATABASE_ID_HERE"
}
],
"kv_namespaces": [
{
"binding": "RECIPE_SWIPE_CACHE",
"id": "YOUR_KV_NAMESPACE_ID_HERE"
}
]
}
# Start the React development server
npm run dev
# In a separate terminal, start the Worker (for scraping features)
npm run dev:worker
Visit http://localhost:5173
to see the application in action!
- Navigate to
/swipe
to start discovering recipes - Set your dietary preferences and cuisine filters
- Swipe right to save recipes, left to skip
- Access saved recipes in your recipe collection
- Go to
/plan
to create your weekly meal plan - Click on any day to assign recipes from your collection
- Generate consolidated shopping lists for the entire week
- Export directly to Amazon Fresh for convenient ordering
- Visit
/inventory
to manage your pantry - Add items with quantities, categories, and expiration dates
- Set minimum stock levels for automatic restock alerts
- Track your grocery spending and purchase history
- Access
/generate
to create custom recipes - Specify ingredients from your pantry
- Set dietary preferences and cuisine style
- Get AI-generated recipes with cooking instructions
src/
βββ react-app/ # React frontend application
β βββ components/ # Reusable UI components
β βββ pages/ # Page components and routing
β βββ hooks/ # Custom React hooks
β βββ services/ # API client services
β βββ context/ # React context providers
βββ worker/ # Cloudflare Worker backend
β βββ controllers/ # HTTP request handlers
β βββ services/ # Business logic layer
β βββ repositories/ # Data access layer
β βββ routes/ # API route definitions
β βββ utils/ # Utility functions
βββ types/ # Shared TypeScript types
npm run dev # Start React development server
npm run dev:worker # Start Cloudflare Worker in remote mode
npm run build # Build for production
npm run deploy # Build and deploy to Cloudflare
npm run lint # Run ESLint
npm run types # Generate Cloudflare Worker types
GET /api/recipes
- List all recipesPOST /api/recipes/generate
- AI recipe generationPOST /api/recipes/scrape
- Scrape recipe from URLGET /api/swipe/session
- Start recipe discovery sessionGET /api/swipe/next
- Get next recipe in sessionGET /api/inventory
- List inventory itemsPOST /api/inventory
- Add inventory itemGET /api/meal-plans
- Get weekly meal planPOST /api/meal-plans
- Save meal planPOST /api/shopping-lists/generate
- Generate shopping list
The application includes comprehensive testing for both frontend and backend components:
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run E2E tests
npm run test:e2e
- Environment variables for sensitive data (API keys)
- Input validation using Zod schemas
- Error handling with custom error classes
- CORS protection for API endpoints
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Built with Cloudflare Workers for global edge deployment
- UI components from Shadcn/UI
- Recipe data powered by OpenAI GPT-4
- Icons from Lucide React
Live Demo: https://agent-devin.your-subdomain.workers.dev
Made with β€οΈ for food lovers and meal planning enthusiasts