{"id":31013963,"url":"https://github.com/mirian97/recipes-httpclient-springboot","last_synced_at":"2025-09-22T18:41:12.007Z","repository":{"id":301550957,"uuid":"1009608443","full_name":"Mirian97/recipes-httpclient-springboot","owner":"Mirian97","description":"Spring Boot application that consumes an external recipes API using HttpClient 👩‍🍳. Provides REST endpoints to list, search, create, update, and delete recipes. Includes global exception handling and a modular structure with DTOs and services.","archived":false,"fork":false,"pushed_at":"2025-06-28T00:55:23.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-13T06:54:02.608Z","etag":null,"topics":["http-client","jackson-json-processor","maven","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mirian97.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2025-06-27T12:10:06.000Z","updated_at":"2025-06-28T00:55:26.000Z","dependencies_parsed_at":"2025-06-27T13:26:00.221Z","dependency_job_id":"709ac833-c1c7-493f-b331-26499f8996f2","html_url":"https://github.com/Mirian97/recipes-httpclient-springboot","commit_stats":null,"previous_names":["mirian97/recipes-httpclient-springboot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mirian97/recipes-httpclient-springboot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirian97%2Frecipes-httpclient-springboot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirian97%2Frecipes-httpclient-springboot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirian97%2Frecipes-httpclient-springboot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirian97%2Frecipes-httpclient-springboot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mirian97","download_url":"https://codeload.github.com/Mirian97/recipes-httpclient-springboot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirian97%2Frecipes-httpclient-springboot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276451755,"owners_count":25645043,"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-09-22T02:00:08.972Z","response_time":79,"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":["http-client","jackson-json-processor","maven","spring-boot"],"created_at":"2025-09-13T06:52:00.052Z","updated_at":"2025-09-22T18:41:11.965Z","avatar_url":"https://github.com/Mirian97.png","language":"Java","readme":"# Recipes HTTP Client\n\nA RESTful API built with Spring Boot that interacts with the [dummyjson.com/recipes](https://dummyjson.com/recipes) external API to manage recipes. This project provides endpoints to list, search, create, update, and delete recipes, using Java's `HttpClient` for HTTP requests and Jackson for JSON processing.\n\n## Features\n\n- **List all recipes**: Retrieve a list of all recipes.\n- **Get recipe by ID**: Fetch details of a specific recipe by its ID.\n- **Search recipes by name**: Search for recipes using a query string.\n- **Create a recipe**: Add a new recipe to the external API.\n- **Update a recipe**: Update an existing recipe by ID.\n- **Delete a recipe**: Remove a recipe by ID.\n\n## Technologies\n\n- **Spring Boot**: Framework for building the REST API.\n- **Java 17**: Programming language used.\n- **HttpClient**: Java's built-in HTTP client (Java 11+) for making requests to the external API.\n- **Jackson**: Library for JSON serialization and deserialization.\n- **Maven**: Build tool for dependency management.\n\n## Endpoints\n\n| Method | Endpoint                      | Description            |\n| ------ | ----------------------------- | ---------------------- |\n| GET    | `/recipes`                    | List all recipes       |\n| GET    | `/recipes/{id}`               | Get a recipe by ID     |\n| GET    | `/recipes/search?name={name}` | Search recipes by name |\n| POST   | `/recipes`                    | Create a new recipe    |\n| PUT    | `/recipes/{id}`               | Update a recipe by ID  |\n| DELETE | `/recipes/{id}`               | Delete a recipe by ID  |\n\n### Example Requests\n\n- **List all recipes**:\n\n  ```bash\n  curl http://localhost:8080/recipes\n  ```\n\n- **Get a recipe by ID**:\n\n  ```bash\n  curl http://localhost:8080/recipes/1\n  ```\n\n- **Search recipes by name**:\n\n  ```bash\n  curl http://localhost:8080/recipes/search?name=chicken\n  ```\n\n- **Create a recipe**:\n\n  ```bash\n  curl -X POST http://localhost:8080/recipes \\\n       -H \"Content-Type: application/json\" \\\n       -d '{\"name\":\"New Recipe\",\"ingredients\":[\"ingredient1\",\"ingredient2\"],\"instructions\":[\"step1\",\"step2\"],\"prepTimeMinutes\":10,\"cookTimeMinutes\":20,\"servings\":4,\"difficulty\":\"Easy\",\"cuisine\":\"Italian\",\"caloriesPerServing\":300,\"tags\":[\"tag1\",\"tag2\"],\"userId\":1,\"image\":\"url\",\"rating\":5,\"reviewCount\":10,\"mealType\":[\"Dinner\"]}'\n  ```\n\n- **Update a recipe**:\n\n  ```bash\n  curl -X PUT http://localhost:8080/recipes/1 \\\n       -H \"Content-Type: application/json\" \\\n       -d '{\"name\":\"Updated Recipe\"}'\n  ```\n\n- **Delete a recipe**:\n  ```bash\n  curl -X DELETE http://localhost:8080/recipes/1\n  ```\n\n## Prerequisites\n\n- **Java 17** or later\n- **Maven** 3.6.0 or later\n- **Git** (optional, for cloning the repository)\n\n## Setup and Installation\n\n1. **Clone the repository**:\n\n   ```bash\n   git clone https://github.com/Mirian97/recipes-httpclient-springboot.git\n   cd recipes-httpclient-springboot\n   ```\n\n2. **Build the project**:\n\n   ```bash\n   mvn clean install\n   ```\n\n3. **Run the application**:\n\n   ```bash\n   mvn spring-boot:run\n   ```\n\n4. **Access the API**:\n   The API will be available at `http://localhost:8080/recipes`.\n\n## Configuration\n\nThe application uses the following configurations:\n\n- **External API**: Consumes `https://dummyjson.com/recipes`.\n- **HttpClient**: Configured with HTTP/2 and a 10-second connection timeout.\n- **Error Handling**: Custom `ExternalApiException` with global exception handling via `@ControllerAdvice`.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirian97%2Frecipes-httpclient-springboot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirian97%2Frecipes-httpclient-springboot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirian97%2Frecipes-httpclient-springboot/lists"}