{"id":15001986,"url":"https://github.com/youssefbennour/aspnetcore.starter","last_synced_at":"2025-10-30T08:30:53.191Z","repository":{"id":235146437,"uuid":"780692151","full_name":"youssefbennour/AspNetCore.Starter","owner":"youssefbennour","description":"A modular-monolith asp.net core starter inspired by Evolutionary-architecture","archived":false,"fork":false,"pushed_at":"2024-05-28T08:53:58.000Z","size":205,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-28T21:52:57.218Z","etag":null,"topics":["asp-net-core","csharp","eventbus","grafana","jaeger","localization","mediatr","modular-monolith","opentelemetry","postgresql","prometheus","test-containers","xunit"],"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/youssefbennour.png","metadata":{"files":{"readme":"README.adoc","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-04-02T01:25:12.000Z","updated_at":"2024-05-30T00:09:21.298Z","dependencies_parsed_at":"2024-04-22T12:26:48.484Z","dependency_job_id":"4cdbe170-a6a9-4ab5-9f06-5b10999a0d4e","html_url":"https://github.com/youssefbennour/AspNetCore.Starter","commit_stats":null,"previous_names":["youssefbennour/aspnetcore.starter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youssefbennour%2FAspNetCore.Starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youssefbennour%2FAspNetCore.Starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youssefbennour%2FAspNetCore.Starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youssefbennour%2FAspNetCore.Starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youssefbennour","download_url":"https://codeload.github.com/youssefbennour/AspNetCore.Starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238945669,"owners_count":19556700,"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":["asp-net-core","csharp","eventbus","grafana","jaeger","localization","mediatr","modular-monolith","opentelemetry","postgresql","prometheus","test-containers","xunit"],"created_at":"2024-09-24T18:33:01.469Z","updated_at":"2025-10-30T08:30:52.775Z","avatar_url":"https://github.com/youssefbennour.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"= .NET Modular Monolith Starter\n:toc: macro\n\nA production-ready starter template for building modular monolith applications using .NET 9.0, implementing the Backend-For-Frontend (BFF) pattern with Keycloak authentication. \n\nIf you're not familiar with the modular monolith concept, you can find an explanation for this choice in the https://github.com/evolutionary-architecture/evolutionary-architecture-by-example/blob/main/README.adoc#-modular-monolith[Evolutionary Architecture's documentation].\n\n== Features\n\n=== 🏗️ Modular Monolith Architecture\n* Clean separation of concerns\n* Module-based structure\n* Easy to extend and maintain\n\n=== 🔐 Authentication \u0026 Authorization\n* BFF (Backend-For-Frontend) pattern implementation\n* Keycloak integration\n\n=== 🚌 Event-Driven Architecture\n* Transactional Outbox Pattern implementation\n* Message-driven communication between modules\n\n=== 📊 Observability\n* OpenTelemetry integration\n* Grafana dashboards\n* Jaeger for tracing\n* Prometheus metrics\n\n=== 🧪 Testing\n* Unit testing setup with xUnit\n* Integration testing with TestContainers\n\n== Prerequisites\n\n* .NET SDK 9.0\n* Docker\n\n== Getting Started\n\n=== 1. Clone the repository\n\n=== 2. Navigate to the source directory\n[source,bash]\n----\ncd src\n----\n\n=== 3. Build the Docker images\n[source,bash]\n----\ndocker compose build\n----\n\n=== 4. Start the application\n[source,bash]\n----\ndocker compose up\n----\n\n[IMPORTANT]\n====\nFor local development with Docker Compose, additional setup is required to handle Keycloak authentication properly. Please refer to the link:LOCAL_DEVELOPMENT.adoc[Local Development Guide] for detailed instructions.\n====\n\n[NOTE]\n====\nIntegrating the BFF with a front-end requires special attention,  I recommend reading this detailed article:\nhttps://wrapt.dev/blog/standalone-duende-bff-for-any-spa\n====\n\nThe application will be available at:\n\n* BFF: http://localhost:8081\n* API: http://localhost:8080\n* Swagger UI: http://localhost:8080/swagger/index.html\n\n== Project Structure\n\n[source]\n----\nsrc/\n├── Starter/              # Main API application\n├── Starter.BFF/          # Backend-For-Frontend application\n├── Starter.Common/       # Shared libraries and utilities\n├── Starter.UnitTests/    # Unit tests\n└── Starter.IntegrationTests/ # Integration tests\n----\n\n== Authentication Flow\n\nThe project uses Keycloak as the identity provider with the BFF pattern:\n\n. Frontend applications communicate with the BFF\n. BFF Authenticates user by cookie\n. If user is not authenticated, BFF challenges the user to Keycloak \u0026 deals a cookie[secure, http only and SameSite strict] to the front-end\n. BFF proxies authenticated requests to the main API\n. API validates JWT tokens and handles authorization\n\n=== Direct API Access\n\nIf you need to bypass the BFF and access the APIs directly, you can obtain an access token from Keycloak using the following command:\n\n[source,bash]\n----\ncurl --location 'http://localhost:7002/realms/starter-realm/protocol/openid-connect/token' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--data-urlencode 'grant_type=password' \\\n--data-urlencode 'username={your username}' \\\n--data-urlencode 'password={your password}' \\\n--data-urlencode 'client_id=starter-client' \\\n--data-urlencode 'client_secret=2UxRNf8TY7jwycJCWcEWTWz3joSqQlLO'\n----\n\nThe response will contain an access token that can be used to authenticate direct API calls by including it in the `Authorization` header as a Bearer token.\n\n== Running Tests\n\n=== Unit Tests\n[source,bash]\n----\ndotnet test src/Starter.UnitTests\n----\n\n=== Integration Tests\n[source,bash]\n----\ndotnet test src/Starter.IntegrationTests\n----\n\n[NOTE]\n====\nIntegration tests require Docker to be running as they use TestContainers.\n====\n\n== Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n== Acknowledgments\n\nThis project is based on the excellent work from the https://github.com/evolutionary-architecture/evolutionary-architecture-by-example[Evolutionary Architecture by Example] repository. Special thanks to all the creators and contributors of the original project for providing such a great foundation for building modern .NET applications.\n\nOriginal repository maintainers and contributors can be found at: https://github.com/evolutionary-architecture/evolutionary-architecture-by-example/graphs/contributors\n\n== License\n\nThis project is licensed under the MIT License - see the link:LICENSE[LICENSE] file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoussefbennour%2Faspnetcore.starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoussefbennour%2Faspnetcore.starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoussefbennour%2Faspnetcore.starter/lists"}