Skip to content

Krapa007/RecipeBook-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RecipeBook

A simple, responsive recipe website built with React + Vite.

This repository contains a small, mobile-first app for browsing, searching and viewing recipes. It's intentionally light so you can swap static data for an API later or extend it however you like.


Quick overview

  • Browse recipes in a card/list view
  • View recipe details
  • Responsive layout — works on mobile and desktop

Tech stack

  • React (functional components)
  • Vite (dev server + build)
  • react-router for navigation
  • Plain CSS for styling

Getting started

Prerequisites

  • Node.js 14+ and npm (or yarn/pnpm)

Clone and run

# clone
git clone https://github.com/Krapa007/RecipeBook-Project.git
cd RecipeBook-Project

# install dependencies
npm install
# or: yarn

# dev server
npm run dev

# build for production
npm run build

# preview production build (optional)
npm run preview

If your package.json uses different script names (for example start instead of dev) use those instead.


Project structure

RecipeBook-Project/
├─ public/             # static assets, index.html
├─ src/
│  ├─ components/      # UI components (cards, search, header, footer)
│  ├─ pages/           # page-level components (Home, RecipeDetail)
│  ├─ data/            # sample recipes (JSON) or mock data
│  ├─ styles/          # CSS files
│  └─ main.jsx
├─ .env                # environment variables (if any)
├─ package.json
└─ README.md

Adjust this to match your repo if files are named differently.


Data format (recipes)

If you store recipes as JSON, use a consistent shape. Example minimal object:

{
  "id": "choco-chip-cookies",
  "title": "Chocolate Chip Cookies",
  "time": "25 mins",
  "servings": 12,
  "tags": ["dessert", "vegetarian"],
  "ingredients": [
    "2 cups flour",
    "1 cup sugar",
    "1 cup chocolate chips"
  ],
  "steps": [
    "Preheat oven to 350°F (180°C).",
    "Mix dry ingredients.",
    "Fold in chocolate chips and bake 10-12 minutes."
  ]
}

Place an array of these objects in src/data/recipes.json or fetch them from an API.


How to add a recipe

  1. Open src/data/recipes.json (or the data source you use).
  2. Add a new object following the shape above.
  3. Ensure the id is unique and URL-safe (kebab-case).

If you use a backend, add a POST endpoint to accept the same shape and update the UI to call it.


Routing suggestions

  • / — home / list of recipes
  • /recipes/:id — recipe details
  • (optional) /favorites, /submit

If you're using react-router-dom v6, add routes in App.jsx or main.jsx and link with <Link to={...} />.


Scripts (common)

Check package.json for the exact script names. Typical scripts:

{
  "dev": "vite",
  "build": "vite build",
  "preview": "vite preview"
}

Tests & linting

If you add ESLint, Prettier or testing later, add scripts like:

npm run lint
npm run test

Deployment

Build the app (npm run build) and deploy the dist/ folder to a static host such as Vercel, Netlify, or GitHub Pages.

Netlify example:

  • Build command: npm run build
  • Publish directory: dist

Ideas & roadmap

  • Persist recipes to a backend (Node + Express + MongoDB or PostgreSQL)
  • User accounts and saved favorites
  • Recipe submission form with image upload
  • Tag-based filtering (vegetarian, quick, dessert)
  • Improve accessibility and add tests

Contributing

  1. Fork the repo
  2. Create a branch: git checkout -b feat/your-feature
  3. Commit: git commit -m "Add feature"
  4. Push and open a PR

Keep PRs focused, include screenshots for UI changes, and provide short descriptions.


License

MIT License

Copyright (c) 2025 Krapa

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Contact

Maintained by @Krapa007.


Example recipes.json starter (6 recipes)

[
  {
    "id": "choco-chip-cookies",
    "title": "Chocolate Chip Cookies",
    "time": "25 mins",
    "servings": 12,
    "tags": ["dessert"],
    "ingredients": ["2 cups flour", "1 cup sugar", "1 cup chocolate chips"],
    "steps": ["Preheat oven to 350°F.", "Mix dry ingredients.", "Bake 10-12 minutes."]
  },
  {
    "id": "classic-pancakes",
    "title": "Classic Pancakes",
    "time": "20 mins",
    "servings": 4,
    "tags": ["breakfast"],
    "ingredients": ["1.5 cups flour", "1 cup milk", "1 egg"],
    "steps": ["Mix ingredients.", "Cook on a hot griddle until golden."]
  },
  {
    "id": "spaghetti-aglio-e-olio",
    "title": "Spaghetti Aglio e Olio",
    "time": "15 mins",
    "servings": 2,
    "tags": ["dinner", "vegetarian"],
    "ingredients": ["200g spaghetti", "2 cloves garlic", "olive oil"],
    "steps": ["Cook pasta.", "Sauté garlic in olive oil.", "Toss pasta with oil and serve."]
  },
  {
    "id": "greek-salad",
    "title": "Greek Salad",
    "time": "10 mins",
    "servings": 2,
    "tags": ["salad", "vegetarian"],
    "ingredients": ["tomatoes", "cucumber", "feta cheese"],
    "steps": ["Chop veg.", "Toss with dressing."]
  },
  {
    "id": "quick-veg-curry",
    "title": "Quick Veg Curry",
    "time": "30 mins",
    "servings": 4,
    "tags": ["dinner", "vegan"],
    "ingredients": ["mixed vegetables", "curry powder", "coconut milk"],
    "steps": ["Sauté veggies.", "Add spices and coconut milk.", "Simmer until cooked."]
  },
  {
    "id": "fruit-smoothie",
    "title": "Fruit Smoothie",
    "time": "5 mins",
    "servings": 2,
    "tags": ["drink"],
    "ingredients": ["banana", "berries", "milk or plant milk"],
    "steps": ["Blend all ingredients until smooth."]
  }
]

About

A responsive React-based recipe website that lets users browse, search, and view detailed cooking recipes with a clean UI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors