CulinaryCraft API is a backend service designed to manage and share recipes efficiently. Built using Node.js and Express.js, this API allows users to create, retrieve, update, and delete recipes with structured data storage using MongoDB and Mongoose.
- Create new recipes with detailed attributes.
- Retrieve all recipes or filter by title, author, or difficulty.
- Update recipe details like difficulty level, preparation time, and cooking time.
- Delete recipes securely with error handling.
- Uses Mongoose for database modeling and schema validation.
- Backend: Node.js, Express.js
- Database: MongoDB (Atlas)
- ORM: Mongoose
Ensure you have the following installed:
- Node.js
- MongoDB (Cloud-based like MongoDB Atlas)
- Postman (for API testing)
git clone https://github.com/sidhanta03/culinarycraft-api.git
cd culinarycraft-apinpm installCreate a .env file and configure it:
MONGO_URI=your_mongodb_connection_string
npm startServer will be running at http://localhost:3000
POST /recipes
{
"title": "Spaghetti Carbonara",
"author": "Sanjeev Kapoor",
"difficulty": "Intermediate",
"prepTime": 20,
"cookTime": 15,
"ingredients": ["200g spaghetti", "100g pancetta", "2 large eggs"],
"instructions": ["Cook spaghetti", "Sauté pancetta", "Mix with eggs and cheese"],
"imageUrl": "https://spaghetti_Carbonara.jpg"
}Response:
{
"message": "Recipe created successfully",
"recipe": {...}
}2️⃣ Get All Recipes
GET /recipes
GET /recipes/title/:title
GET /recipes/author/:author
GET /recipes/difficulty/easy
PATCH /recipes/:id
{
"difficulty": "Easy"
}PATCH /recipes/title/:title
{
"prepTime": 40,
"cookTime": 45
}DELETE /recipes/:id
This project is open-source and available under the MIT License.
For contributions, feel free to fork the repo and open a pull request!