{"id":14975948,"url":"https://github.com/basemax/recipesharinggraphql","last_synced_at":"2025-08-17T23:33:04.742Z","repository":{"id":185389348,"uuid":"671525759","full_name":"BaseMax/RecipeSharingGraphQL","owner":"BaseMax","description":"This is a TypeScript-based GraphQL API for a recipe sharing platform. It allows users to query for recipes, search recipes by ingredients, and also enables them to submit their own recipes.  Develop a GraphQL API for a recipe sharing platform. Users can query for recipes, search by ingredients, and submit their own recipes.","archived":false,"fork":false,"pushed_at":"2025-04-11T19:32:56.000Z","size":1883,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-11T02:54:38.060Z","etag":null,"topics":["api","api-graphql","graphql","graphql-api","graphql-client","graphql-codegen","graphql-schema","graphql-server","recipe","recipe-sharing","recipes","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-27T14:14:39.000Z","updated_at":"2025-04-11T19:32:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d6872f0-a34a-4cf4-871d-d1f759b22a8b","html_url":"https://github.com/BaseMax/RecipeSharingGraphQL","commit_stats":{"total_commits":62,"total_committers":4,"mean_commits":15.5,"dds":"0.29032258064516125","last_synced_commit":"51d895c72de700fbc9530a7fe412dc8640322dfe"},"previous_names":["basemax/recipesharinggraphql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BaseMax/RecipeSharingGraphQL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FRecipeSharingGraphQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FRecipeSharingGraphQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FRecipeSharingGraphQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FRecipeSharingGraphQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/RecipeSharingGraphQL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FRecipeSharingGraphQL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270922510,"owners_count":24668565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-graphql","graphql","graphql-api","graphql-client","graphql-codegen","graphql-schema","graphql-server","recipe","recipe-sharing","recipes","typescript"],"created_at":"2024-09-24T13:52:55.674Z","updated_at":"2025-08-17T23:33:04.372Z","avatar_url":"https://github.com/BaseMax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Recipe Sharing Platform GraphQL TypeScript\n\nThis is a TypeScript-based GraphQL API for a recipe sharing platform. It allows users to query for recipes, search recipes by ingredients, and also enables them to submit their own recipes.\n\nDeveloped a **GraphQL API** for a recipe sharing platform. Users can query for recipes, search by ingredients, and submit their own recipes.\n\n## Features\n\n- **Query recipes**: Users can query for recipes available on the platform.\n- **Search by ingredients**: Users can search for recipes based on the ingredients they have.\n- **Submit recipes**: Authenticated users can submit their own recipes to share with the community.\n\n## Technologies Used\n\n- **TypeScript**: The entire API is written in TypeScript to provide a strongly-typed development experience.\n- **GraphQL**: The API is built using GraphQL to provide efficient and flexible data retrieval capabilities.\n- **Node.js**: The API runs on Node.js to handle HTTP requests and serve the GraphQL endpoint.\n- **Nestjs**: a popular open-source, back-end framework for Node. js and TypeScript-based, server-side applications.\n- **Database**: MongoDB is used in order to get better performance due to tree structure like data.\n\n## Getting Started\n\n- Node.js (version v18.13.0 or higher)\n- NPM (9.2.0)\n\n## Installation\n\n**Clone the repository:**\n\n```bash\ngit clone https://github.com/BaseMax/RecipeSharingGraphQL\ncd RecipeSharingGraphQL\n```\n\n**Install dependencies:**\n\n```bash\nnpm install\n```\n\n**Set up environment variables:**\n\nCreate a `.env` file in the root directory and add the following environment variables:\n\n```makefile\nDB_URL=mongodb://your-mongodb-url\nPORT=3000\n```\n\n**Run e2e test:**\n\n- 1 : npm run test:auth\n\n- 2 : npm run test:recipe\n\n- 3 : npm run test:comment\n\n**Start the development server:**\n\n```\nnpm run start:dev\n```\n\nThe API will be accessible at `http://localhost:3000/graphql`.\n\n## Additional GraphQL\n\n**Popular Recipes Query:**\n\n```graphql\n\nquery PopularRecipes($limit: Int!) {\n        PopularRecipes(limit: $limit) {\n          _id\n          title\n          numberOfLikes\n        }\n      };\n```\n\n![popular Recipes](./screenshots/popularRecipes.png)\n\n**Update Recipe Mutation:**\n\nThis mutation allows users to update their submitted recipes.\n\n```graphql\n mutation UpdateRecipe($updateRecipeInput: UpdateRecipeInput!) {\n      updateRecipe(updateRecipeInput: $updateRecipeInput) {\n        authorId\n        description\n        title\n        instructions {\n          detail\n          step\n        }\n        ingredients\n        _id\n      }\n    };\n```\n\n![update Recipes](./screenshots/updateRecipe.png)\n\n**Like Recipe Mutation:**\n\nThis mutation allows users to like a recipe.\n\n```graphql\n\n  mutation LikeRecipe($likeRecipeInput: UpdateRecipeInput!) {\n      likeRecipe(likeRecipeInput: $likeRecipeInput) {\n        title\n        instructions {\n          detail\n          step\n        }\n        ingredients\n        description\n        authorId\n        _id\n        numberOfLikes\n        likes\n      }\n    };\n```\n\n![like Recipe](./screenshots/likeRecipe.png)\n\n**Delete Recipe Mutation:**\n\nThis mutation allows users to delete their submitted recipes.\n\n```graphql\nmutation RemoveRecipe($removeRecipeInput: UpdateRecipeInput!) {\n  removeRecipe(removeRecipeInput: $removeRecipeInput) {\n    title\n    likes\n    numberOfLikes\n    instructions {\n      detail\n      step\n    }\n    ingredients\n    description\n    _id\n    authorId\n  }\n}\n```\n\n![Delete Recipe](./screenshots/removeRecipe.png)\n\n**User Registration Mutation:**\n\nThis mutation allows new users to register on the platform.\n\n```graphql\nmutation Signup {\n  signup(\n    signup: {\n      email: \"test2@gmail.com\"\n      name: \"test\"\n      password: \"password\"\n      confirmPassword: \"${variables.password}\"\n    }\n  ) {\n    token\n    name\n  }\n}\n```\n\n![Sign up ](./screenshots/signup.png)\n\n**User Login Mutation:**\n\nThis mutation allows users to log in to the platform and obtain an access token.\n\n```graphql\nmutation Login($login: LoginInput!) {\n  login(login: $login) {\n    token\n    name\n  }\n}\n```\n\n![login](./screenshots/login.png)\n\n**Recent Recipes Query:**\n\nThis query returns a list of recently added recipes.\n\n```graphql\nquery RecentRecipes($limit: Int!) {\n  RecentRecipes(limit: $limit) {\n    _id\n    title\n    createdAt\n  }\n}\n```\n\n![recent recipes](./screenshots/mostRecenetRecipes.png)\n\n**Top Authors Query:**\n\nThis query returns a list of top authors based on their total recipes.\n\n```graphql\nquery TopUsers($limit: Int!) {\n        topUsers(limit: $limit) {\n          email\n          name\n          createdAt\n          recipes_count\n          _id\n        }\n      }`\n```\n\n![top authors](./screenshots/topUsers.png)\n\n**Random Recipe Query:**\n\nThis query returns a random recipe from the platform.\n\n```graphql\nquery RandomRecipe {\n  randomRecipe {\n    _id\n    title\n    authorId\n    numberOfLikes\n  }\n}\n```\n\n![random recipe](./screenshots/getRandomRecipe.png)\n\n**Add Comment Mutation:**\n\nThis mutation allows users to add comments to a recipe.\n\n```graphql\nmutation CreateComment($createCommentInput: CreateCommentInput!) {\n  createComment(createCommentInput: $createCommentInput) {\n    content\n    authorId\n    recipeId\n    createdAt\n    _id\n  }\n}\n```\n\n![create comment](./screenshots/createComment.png)\n\n**Update Comment Mutation:**\n\nThis mutation allows users to update their own comments.\n\n```graphql\nmutation UpdateComment($updateCommentInput: UpdateCommentInput!) {\n  updateComment(updateCommentInput: $updateCommentInput) {\n    _id\n    content\n    authorId\n    recipeId\n    createdAt\n  }\n}\n```\n\n**Delete Comment Mutation:**\n\nThis mutation allows users to delete their own comments.\n\n```graphql\nmutation RemoveComment($deleteCommentInput: DeleteCommentInput!) {\n  removeComment(deleteCommentInput: $deleteCommentInput) {\n    _id\n    content\n    authorId\n    recipeId\n    createdAt\n  }\n}\n```\n\n**User Recipes Query:**\n\nThis query allows users to retrieve their own submitted recipes.\n\n```graphql\nquery UserOwnRecipe {\n  userOwnRecipe {\n    _id\n    title\n    authorId\n    createdAt\n    numberOfLikes\n  }\n}\n```\n\n![user's recipe](./screenshots/getUserOwnRecipes.png)\n\n**Recommended Recipes Query:**\n\nThis query returns a list of recommended recipes based on the user's liked recipes .\n\n```graphql\nquery UserFavoriteRecipes($limit: Int!) {\n  userFavoriteRecipes(limit: $limit) {\n    _id\n    authorId\n    likes\n    createdAt\n    title\n  }\n}\n```\n\n![user favorite recipe](./screenshots/getUserFavoriteRecipes.png)\n\n\n\n## Authentication\n\nTo enable user-specific functionality like submitting recipes, you need to implement authentication using tokens, OAuth, or any other authentication mechanism of your choice.\n\n## API Reference\n\nThe GraphQL API provides the following queries and mutations.\n\n### Queries:\n\n- `recipes`: Retrieve a list of recipes.\n- `recipe`: Get details of a specific recipe by ID.\n- `searchRecipes`: Search for recipes based on ingredients.\n- `popularRecipes`: Retrieve a list of popular recipes based on the number of likes and views.\n- `recentRecipes`: Retrieve a list of recently added recipes.\n- `topAuthors`: Retrieve a list of top authors based on their total likes and contributions.\n- `randomRecipe`: Get a random recipe from the platform.\n- `userRecipes`: Retrieve a list of recipes submitted by the authenticated user.\n- `recommendedRecipes`: Retrieve a list of recommended recipes based on the user's liked recipes and followed authors.\n\n### Mutations:\n\n- `submitRecipe`: Submit a new recipe (requires authentication).\n- `updateRecipe`: Update a recipe (requires authentication and ownership).\n- `likeRecipe`: Like a recipe.\n- `deleteRecipe`: Delete a recipe (requires authentication and ownership).\n- `addComment`: Add a comment to a recipe (requires authentication).\n- `updateComment`: Update a comment (requires authentication and ownership).\n\n## Contributing\n\nContributions to this project are welcome! If you find any issues or want to add new features, feel free to submit a pull request.\n\n- Fork the repository.\n- Create a new branch for your feature or bug fix.\n- Commit your changes and push the branch to your fork.\n- Submit a pull request to the main repository.\n\n## License\n\nThis project is licensed under the GPL-3.0 License. Feel free to use, modify, and distribute the code as per the terms of the license.\n\nCopyright 2023, Max Base\n\nHappy recipe sharing! 🍳🥗🍰\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Frecipesharinggraphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Frecipesharinggraphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Frecipesharinggraphql/lists"}