Skip to content

asapial/PlateFul-Server-Side

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍽️ PlateFul Server

This is the backend server for the PlateFul Recipe App. Built with Node.js, Express, and MongoDB, it provides RESTful APIs for managing recipes, including creating, updating, deleting, filtering, and liking recipes.

🌐 Live Site (Frontend)

👉 https://plateful-21a3d.web.app/


🚀 Features

  • 📝 Add Recipes – Users can submit detailed recipes with title, cuisine, prep time, ingredients, and images.
  • 🔍 Filter Recipes – Filter recipes by cuisine using query parameters.
  • ❤️ Like Recipes – Users can increment the likes count for a recipe.
  • 🔝 Top Recipes – Returns the top 6 most-liked recipes.
  • 📧 User-Specific Recipes – Fetch recipes based on the owner's email.
  • 🛠️ Update & Delete Recipes – Edit and remove existing recipes by ID.
  • 🌍 MongoDB Atlas – Cloud-based database integration with collections for scalable recipe data.

🛠️ Installation (Local Development)

  1. Clone the repository:

    git clone https://github.com/asapial/PlateFul-Server-Side.git
    cd PlateFul-Server-Side
  2. Install dependencies:

    npm install
  3. Create a .env file in the root directory with the following variables:

    DATABASE_URL=yourMongoDBUsername
    SECRET_KEY=yourMongoDBPassword
    port=3000
    
  4. Start the server:

    npm start

    The server will run on http://localhost:3000.


📚 API Endpoints

Add a Recipe

  • POST /addRecipe
  • Body:
    {
      "title": "Recipe Title",
      "ingredients": ["item1", "item2"],
      "instructions": "Steps...",
      "cuisine": "Cuisine Name",
      "prepTime": 30,
      "categories": ["Category1"],
      "image": "image-url",
      "recipeOwnerEmail": "user@example.com"
    }

Get All Recipes (with optional cuisine filter)

  • GET /allRecipe
  • Query: ?cuisine=Italian (optional)

Get Top Recipes

  • GET /topRecipe
  • Description: Returns top 6 recipes sorted by likes.

Get Recipe Details

  • GET /recipeDetails/:id

Get User's Recipes

  • GET /myRecipes?email=user@example.com

Like a Recipe

  • PATCH /likedRecipe/:id

Update a Recipe

  • PUT /recipes/:id
  • Body:
    {
      "title": "Updated Title",
      "ingredients": ["item1", "item2"],
      "instructions": "Updated steps...",
      "cuisine": "Cuisine Name",
      "prepTime": 25,
      "categories": ["Category1"],
      "image": "image-url"
    }

Delete a Recipe

  • DELETE /recipes/:id

🤝 Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.


📄 License

All content, including recipes, images, and branding, is the intellectual property of PlateFul unless otherwise stated. Unauthorized use or duplication without explicit permission is strictly prohibited.

About

This is the backend server for the PlateFul Recipe App.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors