{"id":20270638,"url":"https://github.com/sararasoulian/dotnet-webapi-sample","last_synced_at":"2025-04-11T04:13:52.795Z","repository":{"id":245684563,"uuid":"818556812","full_name":"SaraRasoulian/DotNet-WebAPI-Sample","owner":"SaraRasoulian","description":"👑 A Sample Web API Application","archived":false,"fork":false,"pushed_at":"2024-08-11T10:43:54.000Z","size":115,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T04:13:47.595Z","etag":null,"topics":["authentication","clean-architecture","clean-code","cqrs-pattern","docker","entity-framework-core","integration-testing","postgresql-database","redis-cache","restful-api","serilog","tdd","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"C#","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/SaraRasoulian.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-22T06:56:55.000Z","updated_at":"2025-03-14T21:41:04.000Z","dependencies_parsed_at":"2024-11-14T12:45:21.619Z","dependency_job_id":null,"html_url":"https://github.com/SaraRasoulian/DotNet-WebAPI-Sample","commit_stats":null,"previous_names":["sararasoulian/loyalty-system-api","sararasoulian/customer-loyalty-app","sararasoulian/dotnet-api-sample"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaraRasoulian%2FDotNet-WebAPI-Sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaraRasoulian%2FDotNet-WebAPI-Sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaraRasoulian%2FDotNet-WebAPI-Sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaraRasoulian%2FDotNet-WebAPI-Sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaraRasoulian","download_url":"https://codeload.github.com/SaraRasoulian/DotNet-WebAPI-Sample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339225,"owners_count":21087215,"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":["authentication","clean-architecture","clean-code","cqrs-pattern","docker","entity-framework-core","integration-testing","postgresql-database","redis-cache","restful-api","serilog","tdd","unit-testing"],"created_at":"2024-11-14T12:32:12.473Z","updated_at":"2025-04-11T04:13:52.767Z","avatar_url":"https://github.com/SaraRasoulian.png","language":"C#","readme":"## Web API Application\n\nThis repository is a sample ASP.NET Core Web API (.NET 8) project.\n\n\n## Avaliable endpoints\n\nThe endpoints can be tested using postman or swagger.\n\n\n\u003cdetails\u003e\n  \n\u003csummary\u003eLogin\u003c/summary\u003e\n\n```\nPost    http://localhost:5000/api/identity/login\n```\n\n##### Input from body:\n\n```\nContent-Type: application/json\n{\n  \"userName\": \"sara\",\n  \"password\": \"123456\"\n}\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \n\u003csummary\u003eGet User\u003c/summary\u003e\n\n \u003ch6\u003eNeeds authorization \u003c/h6\u003e\n\n```\nGET    http://localhost:5000/api/users/{userId}\n```\n\n\n\u003c/details\u003e\n\n\n\n\u003cdetails\u003e\n  \n\u003csummary\u003eEarn Points\u003c/summary\u003e\n\n \u003ch6\u003eNeeds authorization \u003c/h6\u003e\n\n```\nPost    http://localhost:5000/api/users/{userId}/earn\n```\n\n##### Input from body:\n\n```\nContent-Type: application/json\n{\n  \"points\": 100\n}\n```\n\n\u003c/details\u003e\n\n\n\n\n\n## Tech Stack\n  -\tASP.NET Core Web API -v8\n  - Entity Framework Core -v8\n  - TDD (Test-Driven Development)\n  - DDD (Domain-Driven Design)\n  - Clean Architecture\n  - Clean Code\n  - Repository Design Pattern\n  - CQRS Design Pattern\n  - Mediator Design pattern\n  - JWT (JSON Web Token)\n  - PostgreSQL Database\n  - Redis for Caching\n  - Docker\n\n\n\u003cdetails\u003e\n\n  \n\u003csummary\u003eNuget Packages\u003c/summary\u003e\n\n \u003ch4\u003eHere are some of the NuGet packages used in this repository:\u003c/h4\u003e\n\n  - __xUnit__ for unit and integration testing\n  - __Testcontainers__ for integration testing\n  - __Moq__ for mocking\n  - __Serilog__ for logging in console and text file\n  - __FluentValidation__ for server-side validation\n  - __FluentAssertions__ for test assertions\n  - __MediatR__ for implementing mediator pattern\n  - __Mapster__ for object mapping\n  - __Newtosoft.Json__ for serializing and deserializing objects\n  - __Microsoft.Extensions.Caching.StackExchangeRedis__ for implementing redis cache\n    \n\n\u003c/details\u003e\n\n  \n## Get started\n\n#### 1. Clone the repository\n\n```\ngit clone https://github.com/SaraRasoulian/Loyalty-System-API.git\n```\n#### 2. Start with Docker compose\n\nMake sure [docker](https://docs.docker.com/get-docker/) is installed on your machine.\n\nRun the following command in project directory:\n\n```\ndocker-compose up -d\n```\n\nDocker compose in this project includes 4 services:\n\n- Web API application will be listening at `http://localhost:5000`\n\n- Postgres database will be listening at `http://localhost:5433`\n\n- PgAdmin4 web interface will be listening at `http://localhost:8080`\n \n- Redis cache will be listening at `http://localhost:6379`\n\n\nTo apply your modified code, you can add build option:\n\n```\n  docker-compose up -d --build\n```\n\nTo stop and remove all containers, use the following command:\n\n```\n  docker-compose down\n```\n\n\n#### 3. Run the migrations\n\nOpen `CustomerLoyalty.sln` file in visual studio, then in package manager console tab, run:\n\n```\nupdate-database\n```\n\nThis command will generate the database schema in postgres container.\n\n---\n\nMake sure Docker engine is running, before running the integration tests.\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsararasoulian%2Fdotnet-webapi-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsararasoulian%2Fdotnet-webapi-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsararasoulian%2Fdotnet-webapi-sample/lists"}