Forkify is a recipe search web app for food enthusiasts. Search thousands of recipes, view ingredients and servings, build a shopping list, save favorites, and follow step-by-step cooking directions.
- Search recipes by keyword
- View a recipe's ingredients, servings, and cooking directions
- Adjust servings and add ingredients to a shopping list
- Favorite recipes (persisted in the browser's
localStorage) - Browse saved favorites from the heart icon in the top-right corner
- JavaScript (ES6+) with Babel
- Webpack 4 for bundling and dev server
- MVC architecture — models (
Search,Recipe,ShoppingList,Like) and views - Food2Fork API for recipe data
- Axios for HTTP requests
- Register at food2fork.com.
- Request your API key from the Food2Fork API page.
Add your key to env.json in the project root:
{
"api_key": "your_api_key_here"
}Note: Do not commit your real API key. Keep
env.jsonout of version control if you fork this project.
npm installnpm run buildThis starts webpack-dev-server and opens the app in your browser (default: http://localhost:8080).
npm run build:prodOutput is written to the dist/ folder.
| Command | Description |
|---|---|
npm run build |
Start the webpack dev server with hot reload |
npm run build:prod |
Create an optimized production build in dist/ |
npm test |
Placeholder — no tests configured yet |
forkify/
├── src/
│ ├── css/ # Styles
│ ├── img/ # Icons and images
│ ├── js/
│ │ ├── models/ # Data layer (Search, Recipe, ShoppingList, Like)
│ │ ├── views/ # UI rendering
│ │ ├── app.js # App controllers and state
│ │ └── shared.js # API key, CORS proxy, alerts
│ └── index.html
├── env.json # API key (not for production secrets)
├── webpack.config.babel.js
└── package.json
- Food2Fork API: The Food2Fork service has been discontinued. The app may not return live recipe data unless you point it at a compatible API or mock data source.
- CORS proxy: Requests go through
cors-anywhere.herokuapp.com. That public proxy often requires manual activation and is not suitable for production use.
This project is licensed under the MIT License.
Recipe data was originally provided by Food2Fork.