{"id":21390874,"url":"https://github.com/nathsagar96/json-placeholder-service","last_synced_at":"2026-04-05T22:05:02.353Z","repository":{"id":244994391,"uuid":"816843494","full_name":"nathsagar96/json-placeholder-service","owner":"nathsagar96","description":"Free faux and dependable API for checking out and prototyping","archived":false,"fork":false,"pushed_at":"2024-09-24T16:24:41.000Z","size":1480,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T01:09:14.373Z","etag":null,"topics":["api-gateway","cache","caffiene","config-server","docker","docker-compose","eureka-server","h2-database","microservices","rest-api","service-discovery","service-registry","spring","spring-boot","spring-cloud"],"latest_commit_sha":null,"homepage":"","language":"Java","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/nathsagar96.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":"2024-06-18T14:00:34.000Z","updated_at":"2024-09-24T16:25:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"8365ada7-1e28-4767-bd2e-1d83037f835d","html_url":"https://github.com/nathsagar96/json-placeholder-service","commit_stats":null,"previous_names":["nathsagar96/json-placeholder-service"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathsagar96%2Fjson-placeholder-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathsagar96%2Fjson-placeholder-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathsagar96%2Fjson-placeholder-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathsagar96%2Fjson-placeholder-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathsagar96","download_url":"https://codeload.github.com/nathsagar96/json-placeholder-service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243872309,"owners_count":20361454,"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","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-gateway","cache","caffiene","config-server","docker","docker-compose","eureka-server","h2-database","microservices","rest-api","service-discovery","service-registry","spring","spring-boot","spring-cloud"],"created_at":"2024-11-22T13:20:12.212Z","updated_at":"2025-12-31T00:19:49.238Z","avatar_url":"https://github.com/nathsagar96.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON Placeholder Service\n\nThe JSON Placeholder Service is a group of Spring Boot applications designed to mimic the functionalities of\nthe [JSONPlaceholder](https://jsonplaceholder.typicode.com/) service. This service provides RESTful APIs for handling\nusers, posts, comments, and albums, demonstrating a microservices architecture using Spring Cloud.\n\n## Table of Contents\n\n- [Architecture](#architecture)\n- [Microservices](#microservices)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Monitoring and Logging](#monitoring-and-logging)\n- [Contributing](#contributing)\n\n## Architecture\n\nThis project follows a microservices architecture, where each functionality is separated into individual services. The\nproject leverages Spring Cloud for API gateway, service discovery, and configuration management.\n\n![architecture diagram](json-placeholder-service-architecture-diagram.png)\n\n### Technologies Used\n\n- Spring Boot\n- Spring Data JPA\n- H2 Database\n- Spring Cloud\n- Docker\n- Docker Compose\n- Grafana\n- Loki\n- Prometheus\n- Tempo\n\n## Microservices\n\nThe JSON Placeholder Service is composed of the following microservices:\n\n1. **Post Service**\n\n    - Folder: [Post Service](post-service)\n    - Manages posts.\n\n2. **Comment Service**\n\n    - Folder: [Comment Service](comment-service)\n    - Manages comments.\n\n3. **Album Service**\n\n    - Folder: [Album Service](album-service)\n    - Manages albums.\n\n4. **Photo Service**\n\n    - Folder: [Photo Service](photo-service)\n    - Manages photos.\n\n5. **Todo Service**\n\n    - Folder: [Todo Service](todo-service)\n    - Manages todos.\n\n6. **User Service**\n    - Folder: [User Service](user-service)\n    - Manages users.\n\n## Installation\n\n### Prerequisites\n\n- JDK 21\n- Maven\n- Docker\n- Docker Compose\n\n### Steps\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/nathsagar96/json-placeholder-service.git\n   cd json-placeholder-service\n   ```\n\n2. Build and start the application using Docker Compose:\n\n   In the root directory (where `docker-compose.yml` is located), run:\n\n   ```bash\n   docker-compose up --build\n   ```\n\n   This command builds the Docker images and starts the containers for all microservices.\n\n3. Access the application at `http://localhost:{port}`, where `{port}` is the port exposed by your API Gateway or\n   individual services.\n\n## Usage\n\n### Post Endpoints\n\n- `GET /posts`: Retrieve all posts\n- `GET /posts/{id}`: Retrieve a post by ID\n- `POST /posts`: Create a new post\n- `PUT /posts/{id}`: Update a post by ID\n- `DELETE /posts/{id}`: Delete a post by ID\n- `GET /posts/user/{userId}`: Retrieve all posts by a specific user\n\n### Comment Endpoints\n\n- `GET /comments`: Retrieve all comments\n- `GET /comments/{id}`: Retrieve a comment by ID\n- `POST /comments`: Create a new comment\n- `PUT /comments/{id}`: Update a comment by ID\n- `DELETE /comments/{id}`: Delete a comment by ID\n- `GET /comments/post/{postId}`: Retrieve all comments by a specific post\n\n### Album Endpoints\n\n- `GET /albums`: Retrieve all albums\n- `GET /albums/{id}`: Retrieve an album by ID\n- `POST /albums`: Create a new album\n- `PUT /albums/{id}`: Update an album by ID\n- `DELETE /albums/{id}`: Delete an album by ID\n- `GET /albums/user/{userId}`: Retrieve all albums by a specific user\n\n### Photo Endpoints\n\n- `GET /photos`: Retrieve all photos\n- `GET /photos/{id}`: Retrieve a photo by ID\n- `POST /photos`: Create a new photo\n- `PUT /photos/{id}`: Update a photo by ID\n- `DELETE /photos/{id}`: Delete a photo by ID\n- `GET /photos/album/{albumId}`: Retrieve all photos by a specific album\n\n### Todo Endpoints\n\n- `GET /todos`: Retrieve all todos\n- `GET /todos/{id}`: Retrieve a todo by ID\n- `POST /todos`: Create a new todo\n- `PUT /todos/{id}`: Update a todo by ID\n- `DELETE /todos/{id}`: Delete a todo by ID\n- `GET /todos/user/{userId}`: Retrieve all todos by a specific user\n\n### User Endpoints\n\n- `GET /users`: Retrieve all users\n- `GET /users/{id}`: Retrieve a user by ID\n- `POST /users`: Create a new user\n- `PUT /users/{id}`: Update a user by ID\n- `DELETE /users/{id}`: Delete a user by ID\n\n## Monitoring and Logging\n\nThis project integrates with several tools for monitoring and logging:\n\n### Grafana\n\nGrafana provides a powerful and flexible interface for visualizing metrics. To access Grafana, navigate to\n`http://localhost:3000`.\n\nGrafana is configured to connect with Prometheus to fetch metrics data and visualize it.\n\n### Prometheus\n\nPrometheus is used for collecting and querying metrics. It scrapes metrics from your microservices and stores them for\nquerying.\n\n### Loki\n\nLoki is used for log aggregation. Loki integrates with Grafana, allowing you to correlate logs and metrics.\n\n### Tempo\n\nTempo is used for distributed tracing. Tempo helps in tracing the flow of requests through your microservices.\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request.\n\n1. Fork the repository\n2. Create a new branch (`git checkout -b feature-branch`)\n3. Commit your changes (`git commit -am 'Add new feature'`)\n4. Push to the branch (`git push origin feature-branch`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathsagar96%2Fjson-placeholder-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathsagar96%2Fjson-placeholder-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathsagar96%2Fjson-placeholder-service/lists"}