Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bilalm04/recipe-finder-graphql
GraphQL backend server with MongoDB.
https://github.com/bilalm04/recipe-finder-graphql
backend graphql javascript mongodb nodejs
Last synced: 5 days ago
JSON representation
GraphQL backend server with MongoDB.
- Host: GitHub
- URL: https://github.com/bilalm04/recipe-finder-graphql
- Owner: BilalM04
- Created: 2024-06-29T16:57:13.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-06-29T17:13:30.000Z (6 months ago)
- Last Synced: 2024-11-08T12:15:08.477Z (about 2 months ago)
- Topics: backend, graphql, javascript, mongodb, nodejs
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GraphQL Server with MongoDB
This is a simple GraphQL server that uses MongoDB for data storage. The server is built with Apollo Server and the database is connected using Mongoose.
## Features
- Fetch recipes for a user
- Add a new recipe for a user
- Delete a recipe for a user## Installation
1. Clone the repository:
```
git clone https://github.com/BilalM04/recipe-finder-graphql.git
```
2. Install the dependencies:
```bash
cd recipe-finder-graphql
npm install
```
4. Create a .env file in the root directory of the project, and add your MongoDB connection string and the port number:
```
MONGODB_URI=your_mongodb_connection_string
PORT=your_desired_port_number
```
6. Run the server:
```
npm start
```## Usage
You can perform the following operations:- `getRecipes(email: String)`: Fetches the recipes for the user with the specified email.
- `addRecipe(email: String!, recipeInput: RecipeInput!)`: Adds a new recipe for the user with the specified email.
- `deleteRecipe(email: String!, recipeId: ID!)`: Deletes the recipe with the specified ID for the user with the specified email.