{"id":17947588,"url":"https://github.com/nemanja87/gameservice","last_synced_at":"2025-04-30T15:27:40.378Z","repository":{"id":259221678,"uuid":"875182220","full_name":"nemanja87/GameService","owner":"nemanja87","description":"A microservices architecture for a simple game built using .NET 8. This project features GameService, ComputerService, and ScoreboardService to handle game logic, computer choices, and scoreboard management respectively. Includes unit tests.","archived":false,"fork":false,"pushed_at":"2024-10-24T06:57:12.000Z","size":100,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T17:23:41.638Z","etag":null,"topics":["csharp","dotnet","microservices-architecture","polly"],"latest_commit_sha":null,"homepage":"","language":"C#","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/nemanja87.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-19T10:04:33.000Z","updated_at":"2024-10-24T06:57:16.000Z","dependencies_parsed_at":"2024-10-23T16:50:03.516Z","dependency_job_id":"df03ed18-9410-4360-9cd3-b054b28a214e","html_url":"https://github.com/nemanja87/GameService","commit_stats":null,"previous_names":["nemanja87/gameservice"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanja87%2FGameService","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanja87%2FGameService/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanja87%2FGameService/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemanja87%2FGameService/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nemanja87","download_url":"https://codeload.github.com/nemanja87/GameService/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251731171,"owners_count":21634528,"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":["csharp","dotnet","microservices-architecture","polly"],"created_at":"2024-10-29T08:05:51.953Z","updated_at":"2025-04-30T15:27:40.356Z","avatar_url":"https://github.com/nemanja87.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleGame Microservices\n\n## Description\n\nThis repository contains three microservices for a simple game built using .NET. Each microservice performs a specific role in the system, and they communicate via HTTP.\n\n### Microservices:\n\n1. **GameService**: Handles the core game logic (e.g., Rock-Paper-Scissors) and interacts with the other services.\n2. **ComputerService**: Provides the computer's choice in the game.\n3. **ScoreboardService**: Manages the game results, keeping track of the last 10 games.\n\n## Table of Contents\n\n1. [Technologies Used](#technologies-used)\n2. [Microservices](#microservices)\n3. [Prerequisites](#prerequisites)\n4. [Running the Project Locally](#running-the-project-locally)\n5. [Testing](#testing)\n6. [Contributing](#contributing)\n7. [License](#license)\n\n## Technologies Used\n\n- **.NET 8**\n- **MediatR** for CQRS implementation\n- **Moq** for unit testing\n- **Swagger** for API documentation\n- **Docker** for containerization\n- **xUnit** for unit tests\n\n## Microservices\n\n### GameService\nThe `GameService` is the core service that allows players to play the game by comparing their choice to the computer's choice. The game logic is implemented using `IGameLogicService`, and the service also interacts with `ComputerService` to get the computer's move and `ScoreboardService` to record the game result.\n\n### ComputerService\nThe `ComputerService` randomly selects a game move (e.g., Rock, Paper, Scissors, etc.) for the computer. It provides this choice to the `GameService` whenever a game is played.\n\n### ScoreboardService\nThe `ScoreboardService` manages the game results. It keeps track of the last 10 games and stores the results in memory (future work can include adding persistent storage).\n\n## Prerequisites\n\n- [.NET SDK 8](https://dotnet.microsoft.com/download/dotnet/8.0)\n- [Docker](https://www.docker.com/) (if you plan to run the services inside containers)\n\n## Running the Project Locally\n\n### Step 1: Clone the Repository\n``bash\ngit clone https://github.com/nemanja87/SimpleGame.git\ncd SimpleGame\n\n### Step 2: Solution setup\n- Make sure that all three services are up and running with https option in Visual Studio.\n- Adjust appSettings with the proper localhost values if needed.\n- Use `GameService` and its `play` endpoint to initiate the game. (this service makes http calls to both `Computer` and `Scoreboard` services)\n- Results of 10 last games should be visible when calling `last-results` endpoint of `ScoreboardService`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemanja87%2Fgameservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnemanja87%2Fgameservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemanja87%2Fgameservice/lists"}