{"id":25120459,"url":"https://github.com/nafiealhilaly/cli-afk","last_synced_at":"2025-04-02T14:41:18.888Z","repository":{"id":244206227,"uuid":"814572647","full_name":"NafieAlhilaly/CLI-AFK","owner":"NafieAlhilaly","description":"A Dotnet Console app to showcase learning `Domain Driven Design` and `RabbitMQ`.","archived":false,"fork":false,"pushed_at":"2024-06-13T09:24:53.000Z","size":180,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-02-08T05:29:26.388Z","etag":null,"topics":[],"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/NafieAlhilaly.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-06-13T09:15:45.000Z","updated_at":"2024-06-13T10:18:55.000Z","dependencies_parsed_at":"2024-06-13T12:24:29.565Z","dependency_job_id":"594d3035-3ba7-4de2-9e02-b68016079579","html_url":"https://github.com/NafieAlhilaly/CLI-AFK","commit_stats":null,"previous_names":["nafiealhilaly/cli-afk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NafieAlhilaly%2FCLI-AFK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NafieAlhilaly%2FCLI-AFK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NafieAlhilaly%2FCLI-AFK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NafieAlhilaly%2FCLI-AFK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NafieAlhilaly","download_url":"https://codeload.github.com/NafieAlhilaly/CLI-AFK/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246834222,"owners_count":20841501,"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":[],"created_at":"2025-02-08T05:29:28.657Z","updated_at":"2025-04-02T14:41:18.858Z","avatar_url":"https://github.com/NafieAlhilaly.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLI-AFK - Domain-Driven Design Documentation\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n# Overview\n![image info](./screenshots/sh2.png)\n\n_High level overview_\n\n\nThis document describes the design of simple game using Domain-Driven Design (DDD) principles. The game allows players to earn points, join a clan, and contribute points to their clans.\n\n### Glossary\n1. **Player**: The user\n2. **PlayerEarn**: The player earning points (when entered the playing state in client app).\n3. **PlayerContribution**: The player earning in a clan (already joined a clan).\n\n\n### Entities\n\n1. **Player**: The player is the main entity. Each player has a unique ID, a name and a PlayerEarn records, which the some of it indicate the player total earned points.\n\n2. **Clan**: A clan is a group of players. Each clan has a unique ID, a name, and points which is the sum of its players contributions.\n\n### Value Objects\n1. **PlayerEarn**: Player earning records, the total of records indicate player total points.\n2. **PlayerContribution**: Player points contribution in a clan, the total contributions in a clan indicate the clan total points, the total contributions of a player in a clan indicate the player total points in the clan.\n\n### Aggregates\n1. **Player**: The player is an aggregate root. All operations related to a player must go through the player aggregate.\n2. **Clan**: Similarly, the clan is also an aggregate root. All operations related to a clan must go through the clan aggregate.\n\n### Domain Events\n\n1. **PlayerEarned**: This event is triggered when a player earn points.\n2. **PointsContributed**: This event is triggered when a player earn point in a clan.\n\n### Services\n\n1. **ClanManagement Service**: This service handles the clan operations, adding and removing players, and managing clan points.\n2. **PlayerManagement Service**: This service handles player operation, currently, earning only.\n\n\n----\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n# Running\n\n\u003cbr\u003e\n\n### Backend\nOpen a new terminal and navigate to Console app `cli-afk`.\ninstall dependencies, then run the app\n```powershell\ndotnet restore\ndotnet run\n```\nThe app will run and wait for messages to consume.\n```console\nService is running and waiting for messages to consume!\n|\n```\n\n### Client\nOpen a new terminal and navigate to Console app `cli-afk-client`.\ninstall dependencies, then run the app\n```powershell\ndotnet restore\ndotnet run\n```\nThe app will run and you'll be asked to login with a username.\n```bash\n----------- Welcome! -------\nEnter your player name to login\n|\n```\n\n```console\nWelcome \u003cname\u003e\n    Enter the following options to perform an action:\n    1 - Start playing\n    2 - List clans\n\n\n```\n\nEnter 1 to start playing.\n\nEvery time you play, you start with 0, the number will increase by 1 for every second as long as you playing.\n```console\nWelcome \u003cname\u003e\n5507\n\n```\n\nfrom Database\n```sql\nsqlite\u003e select name from player;\nAli\nMona\nnafie\nsqlite\u003e select name from clan;\nKnights\nSamurai\nVikings\nsqlite\u003e select sum(points) from player_contribution where player_id = 'nafie' and clan_id = 'Knights';\n2208\nsqlite\u003e select name, clan_id from player;\nnafie|Knights\nMona|\nAli|\nsqlite\u003e select sum(points) from player_contribution where player_id = 'nafie' and clan_id = 'Knights';\n2208\nsqlite\u003e select sum(points) from player_earn where player_id = 'Mona';\n5667\nsqlite\u003e select sum(points) from player_earn where player_id = 'Ali';\n3410\n```\n\nFrom RabbitMQ Dashboard\n![image info](./screenshots/sh1.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnafiealhilaly%2Fcli-afk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnafiealhilaly%2Fcli-afk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnafiealhilaly%2Fcli-afk/lists"}