Snackhack is a fullstack AI-powered fridge recipe finder app. Just enter ingredients you have in your fridge, and it generates delicious recipes with realistic images using GPT-4 and DALL·E.
Built with:
- ⚛️ React + Vite + Tailwind CSS (frontend)
- 🐍 Flask (backend)
- 🤖 OpenAI API (GPT-4 + DALL·E for images)
- Ingredient input with tag-style autocomplete
- Filtering (Vegetarian, Under 30 Min, etc.)
- Dark/light mode toggle
- Like & save recipes (locally stored)
- GPT-powered recipe generation
- AI-generated food images (via DALL·E 2)
- Node.js (v18+ recommended)
- Python 3.10+
- An OpenAI API Key
git clone https://github.com/your-username/snackhack.git
cd snackhackcd frontend
npm install
npm run devFrontend will run at: http://localhost:5173
cd backend
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txtCreate a .env file in the backend/ folder:
OPENAI_API_KEY=your-openai-key-here
Then run the server:
python app.pyBackend runs on http://localhost:5000
- Go to the frontend in your browser.
- Add ingredients like:
chicken,pasta,cheese - Click Cook.
- Wait ~5–10s (image generation takes time).
- Scroll through generated recipes.
- DALL·E 2 is used for images (cheaper + 512x512 support)
- API rate limit: 5 images/min (use fallback images if needed)
- GPT-4 or 3.5 Turbo used for recipe generation
/frontend → React + Tailwind UI
/backend → Flask API & GPT logic
/images → Optional logos & assets
README.md
.gitignore
- User login & recipe saving
- Mobile PWA support
- Multiple image quality options
- Upload your own fridge photo
Junior Front-End Developer | React · Flask · Tailwind