{"id":22962163,"url":"https://github.com/nhadi/gobookstore","last_synced_at":"2026-02-04T08:03:57.587Z","repository":{"id":257997495,"uuid":"871130870","full_name":"NHadi/GoBookStore","owner":"NHadi","description":"BookStore Microservices Architecture This repository contains the architecture and implementation of a BookStore application built using a microservices approach. The application consists of three main services: API Gateway, User Service, and Book Service, along with supporting services like Cassandra and Elasticsearch.","archived":false,"fork":false,"pushed_at":"2024-10-15T21:12:39.000Z","size":443,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T07:41:47.681Z","etag":null,"topics":["cqrs-pattern","domain-driven-design","event-driven","golang","microservices"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NHadi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-10-11T10:32:15.000Z","updated_at":"2024-11-14T06:19:47.000Z","dependencies_parsed_at":"2024-10-17T08:22:38.647Z","dependency_job_id":"5a806416-28ec-4d91-acd2-601e6b880de5","html_url":"https://github.com/NHadi/GoBookStore","commit_stats":null,"previous_names":["nhadi/gobookstore"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHadi%2FGoBookStore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHadi%2FGoBookStore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHadi%2FGoBookStore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NHadi%2FGoBookStore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NHadi","download_url":"https://codeload.github.com/NHadi/GoBookStore/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249692554,"owners_count":21311406,"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":["cqrs-pattern","domain-driven-design","event-driven","golang","microservices"],"created_at":"2024-12-14T19:15:33.443Z","updated_at":"2026-02-04T08:03:57.545Z","avatar_url":"https://github.com/NHadi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# BookStore Microservices Architecture\n\nThis repository contains the architecture and implementation of a BookStore application built using a microservices approach. The application consists of three main services: API Gateway, User Service, and Book Service, along with supporting services like Cassandra and Elasticsearch.\n\n## Architecture Overview\n\n![BookStore Microservices Architecture](A_system_design_architecture_diagram_illustrating_.png.webp)\n\n### Components\n\n1. **API Gateway**\n   - **Purpose**: Acts as a single entry point for all client requests. It routes requests to the appropriate microservices.\n   - **Port**: Exposes port `8080`.\n   - **Dependencies**: Depends on both the User Service and Book Service.\n\n2. **User Service**\n   - **Purpose**: Manages user-related operations, including registration, authentication, and user profile management.\n   - **Port**: Exposes port `8081`.\n\n3. **Book Service**\n   - **Purpose**: Handles operations related to books, such as creating, updating, deleting, and retrieving book information.\n   - **Port**: Exposes port `8082`.\n   - **Dependencies**: Depends on Cassandra for data storage and Elasticsearch for searching capabilities.\n\n4. **Cassandra**\n   - **Purpose**: Serves as the primary database for storing book information.\n   - **Image**: Uses the official `cassandra` Docker image.\n   - **Port**: Exposes port `9042`.\n   - **Configuration**:\n     - Cluster Name: `BookStoreCluster`\n     - Data Center: `dc1`\n     - Replication Factor: `1`\n\n5. **Elasticsearch**\n   - **Purpose**: Provides search capabilities for the Book Service.\n   - **Image**: Uses the official `elasticsearch` Docker image.\n   - **Port**: Exposes port `9200`.\n   - **Configuration**:\n     - Discovery Type: `single-node`\n     - Elastic Password: (set to a secure password)\n\n### Networking\n\nAll services are connected through a Docker network named `microservices-network`. This allows them to communicate with each other using their service names as hostnames.\n\n## Getting Started\n\n### Prerequisites\n\n- Docker and Docker Compose installed on your machine.\n- Basic knowledge of Go programming language.\n\n### Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/NHadi/GoBookStore.git\n   cd GoBookStore\n   ```\n\n2. Build and run the services using Docker Compose:\n\n   ```bash\n   docker-compose up --build\n   ```\n\n3. Access the services:\n   - API Gateway: `http://localhost:8080`\n   - User Service: `http://localhost:8081`\n   - Book Service: `http://localhost:8082`\n   - Cassandra: Connect using a CQL client to `cassandra:9042`.\n   - Elasticsearch: Access at `http://localhost:9200`.\n\n### API Endpoints\n\nThe Book Service exposes the following endpoints:\n\n- **Create Book**: `POST /books`\n- **Get Books**: `GET /books`\n- **Update Book**: `PUT /books/{id}`\n- **Delete Book**: `DELETE /books/{id}`\n- **Borrow Book**: `POST /books/borrow/{userId}/{bookId}`\n\nYou can explore these endpoints using tools like [Postman](https://www.postman.com/) or [Swagger](http://swagger.io/).\n\n### Health Check\n\nTo check the health of the Book Service, access:\n\n```\nGET /health\n```\n\nThis endpoint returns a simple \"Healthy\" message if the service is running correctly.\n\n## Contributing\n\nContributions are welcome! If you have suggestions for improvements or find bugs, feel free to create an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgements\n\n- [Gorilla Mux](https://github.com/gorilla/mux) for routing in Go.\n- [Swagger](https://swagger.io/) for API documentation.\n- [Cassandra](http://cassandra.apache.org/) for data storage.\n- [Elasticsearch](https://www.elastic.co/) for search functionality.\n\n## Contact\n\nFor support or inquiries, please contact:\n\n- **Name**: Nurul Hadi\n- **Email**: nurul.hadi@outlook.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhadi%2Fgobookstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnhadi%2Fgobookstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhadi%2Fgobookstore/lists"}