{"id":19099868,"url":"https://github.com/MarcelMichau/fake-survey-generator","last_synced_at":"2025-04-18T17:32:17.613Z","repository":{"id":36970802,"uuid":"158113219","full_name":"MarcelMichau/fake-survey-generator","owner":"MarcelMichau","description":"A slightly more-than-trivial full-stack application built with DDD \u0026 CQRS concepts","archived":false,"fork":false,"pushed_at":"2024-04-11T05:59:06.000Z","size":27007,"stargazers_count":74,"open_issues_count":10,"forks_count":18,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-14T07:58:57.310Z","etag":null,"topics":["aspnet-core","azure","azure-application-insights","azure-containerapps","azure-front-door","azure-key-vault","azure-pipelines","azure-redis-cache","azure-sql-database","bicep","cqrs","docker","domain-driven-design","entity-framework-core","mediatr","react","typescript","vertical-slice-architecture"],"latest_commit_sha":null,"homepage":"https://fakesurveygenerator.mysecondarydomain.com/","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/MarcelMichau.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}},"created_at":"2018-11-18T18:17:40.000Z","updated_at":"2024-04-16T06:33:16.625Z","dependencies_parsed_at":"2023-10-10T13:46:06.419Z","dependency_job_id":"e7538bfe-1d84-4b4f-8977-b93ede2bd50b","html_url":"https://github.com/MarcelMichau/fake-survey-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelMichau%2Ffake-survey-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelMichau%2Ffake-survey-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelMichau%2Ffake-survey-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelMichau%2Ffake-survey-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcelMichau","download_url":"https://codeload.github.com/MarcelMichau/fake-survey-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223783108,"owners_count":17201903,"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":["aspnet-core","azure","azure-application-insights","azure-containerapps","azure-front-door","azure-key-vault","azure-pipelines","azure-redis-cache","azure-sql-database","bicep","cqrs","docker","domain-driven-design","entity-framework-core","mediatr","react","typescript","vertical-slice-architecture"],"created_at":"2024-11-09T03:52:20.222Z","updated_at":"2025-04-18T17:32:17.604Z","avatar_url":"https://github.com/MarcelMichau.png","language":"C#","funding_links":[],"categories":["typescript","azure"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"200\" src=\"images/undraw_customer_survey_f9ur.svg\"\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003csmall align=\"center\"\u003eLogo by \u003ca href=\"https://undraw.co\"\u003eUndraw\u003c/a\u003e\u003c/small\u003e\n\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003e\n  Fake Survey Generator\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\nThis is an app. That generates surveys. Fake ones. For fun. That is all.\n\u003c/p\u003e\n\n[![Build Status](https://dev.azure.com/marcelmichau/Personal/_apis/build/status/fake-survey-generator/fake-survey-generator?branchName=main)](https://dev.azure.com/marcelmichau/Personal/_build/latest?definitionId=26\u0026branchName=main)\n\n[Open in github.dev](https://github.dev/MarcelMichau/fake-survey-generator)\n\n## Screenshot\n\n![Screenshot](images/screenshot.png \"Screenshot of Fake Survey Generator UI\")\n\n## What is this?\n\nThis is a .NET | C# | React | TypeScript full-stack application of moderate complexity (not just a to-do app), used as a\nplayground for experimentation. Simply put: This is where I mess around with code. It is heavily inspired by\nthe [.NET Microservices: Architecture for Containerized .NET Applications](https://docs.microsoft.com/en-us/dotnet/architecture/microservices/)\nbook, as well as its companion reference\napplication [eShopOnAzure](https://github.com/Azure-Samples/eShopOnAzure). It also incorporates various\nelements from different repos \u0026 blog posts which served as inspiration.\n\nIt is built using Vertical Slice Architecture principles with CQRS (Command Query Responsibility Segregation) and DDD (\nDomain-Driven Design) thrown into the mix. It doesn't follow these principles to the letter, but provides a decent\nexample of how to apply the basics of these principles.\n\nIt is heavily centered around the\nMicrosoft [.NET](https://dotnet.microsoft.com/) + [Azure](https://azure.microsoft.com/) technology stacks as these are\nwhat I have the most experience in \u0026 just like building things with. 😀\n\nHere are some of the features incorporated into this project:\n\n### Application Features\n\n- Observable, production ready, distributed application support\n  using [.NET Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview)\n- Unit \u0026 Integration tests for a CQRS/DDD project with [XUnit](https://xunit.net/)\n- Target production database for integration tests\n  using [Testcontainers for .NET](https://github.com/testcontainers/testcontainers-dotnet)\n- E2E acceptance tests\n  using [.NET Aspire Test Projects](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/testing) \u0026 [Playwright for .NET](https://playwright.dev/dotnet/)\n- Implementing health checks for various components\n  using [AspNetCore.Diagnostics.HealthChecks](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks)\n- Adding [Swagger](https://swagger.io/) to an ASP.NET Core Web API\n  using [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore)\n- Adding [OpenID Connect](https://openid.net/connect/) for Authentication\n- Adding OpenID Connect to Swagger UI\n- Securing an ASP.NET Core Web API using JWT Bearer authentication\n- Adding security headers to API responses\n  using [NetEscapades.AspNetCore.SecurityHeaders](https://github.com/andrewlock/NetEscapades.AspNetCore.SecurityHeaders)\n- Using [Hosted Services](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services) in ASP.NET\n  Core Web API\n- Using a distributed [Redis](https://redis.io/) cache\n- Configuring SQL Server retry policies\n- Using [Microsoft.Extensions.Http.Resilience](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.http.resilience?view=dotnet-plat-ext-9.0) for resilient HTTP requests\n- Implementing [Forwarded Headers](https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer) for hosting ASP.NET Core Web API behind a load balancer\n- Validation of commands using [FluentValidation](https://fluentvalidation.net/)\n- Configuring [Azure Monitor OpenTelemetry](https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable) for telemetry\n- Using [Dapr](https://dapr.io/) with [Dapr SDK for .NET](https://github.com/dapr/dotnet-sdk) for platform agnostic\n  integration with infrastructure components\n\n### Infrastructure Features\n\n- Automatic semantic versioning using [Nerdbank.GitVersioning](https://github.com/dotnet/Nerdbank.GitVersioning)\n- Creating trusted SSL certificates for HTTPS in development\n- Deploying Entity Framework Core Code-First Migrations\n  to [Azure SQL Database](https://azure.microsoft.com/en-us/services/sql-database/)\n  using [Azure Pipelines](https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started/what-is-azure-pipelines?view=azure-devops)\n- Using [Microsoft Entra ID](https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id)\n  authentication to [Azure SQL Database](https://azure.microsoft.com/en-us/services/sql-database/) with Entity Framework\n  Core\n- Running a microservice application locally using [.NET Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview)\n- Using Azure Pipelines\n  with [Azure Developer CLI](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/overview) to build \u0026\n  deploy a microservice application\n  to [Azure Container Apps](https://azure.microsoft.com/en-us/services/container-apps/#overview)\n- Infrastructure as Code for Azure resources\n  using [Bicep](https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview)\n\nSome of the above features are relatively straightforward to implement, others have some intricacies that require some\nGoogling in order to set up. I just like to have them placed in the context of a complete working application to refer\nback to when necessary.\n\n## Why is this here?\n\nI wanted something to try new things out on, without the risk of substantially endangering an actual production\nenvironment used by actual people.\n\nIt was for this reason that I built the Fake Survey Generator (FSG) app as a way to test out tools, libraries, patterns,\nframeworks \u0026 various other stuff.\n\nIt has a very simple domain: it generates surveys. Fake ones. They can be used as a tool for helping you decide what to\nhave for dinner, which book you should read next, where you should go for your next team lunch, or anything that tickles\nyour fancy.\n\nThis application is also used as a reference for configuring/wiring up some common things I sometimes forget how to do.\n_Living Documentation_ if you will. You know the culprits: How do I wire up that database again? What is the syntax for\nthat logging configuration? How do I make thing A talk to thing B?\n\nThe domain is kept relatively simple such that it doesn't overwhelm the app with unnecessary complexity. It should be\nquite easy to wrap your head around without requiring a degree in Computer Science.\n\nI also felt that a lot of reference/demo/boilerplate projects out there cover the core application domain \u0026 don't go\ninto much detail around the building/deployment/hosting of final application. So this project aims to cover both. It\ncontains application code, configuration, CI/CD pipelines, infrastructure-as-code needed to run the application, as well\nas a live, running version of the application (as long as budget allows 😁). So this repo hopefully may contain something\nfor everyone \u0026 fill in the potential gaps across the whole spectrum of application development. It falls somewhere\nbetween a template/boilerplate project \u0026 a real-world production open-source application.\n\n## How is this thing structured?\n\nFSG consists of two parts:\n\n### Server\n\nThe server side consists of the following main components:\n\n- Fake Survey Generator API\n- Fake Survey Generator Worker\n- Application Project\n- Application Tests Project\n- API Integration Tests Project\n- E2E Acceptance Tests Project\n\nThe server side makes use of the following tools, libraries \u0026 frameworks:\n\n- Fake Survey Generator API\n    - .NET 9.0\n    - [ASP.NET Core](https://docs.microsoft.com/en-gb/aspnet/core) 9.0 Web API\n    - [.NET Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview)\n    - [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) 9.0\n      with [Code-First Migrations](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli)\n    - [Dapper](https://github.com/StackExchange/Dapper)\n    - [Redis](https://redis.io/)\n    - [Swagger](https://swagger.io/)\n    - [MediatR](https://github.com/jbogard/MediatR)\n    - [FluentValidation](https://fluentvalidation.net/)\n    - [AspNetCore.Diagnostics.HealthChecks](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks)\n    - [Docker](https://www.docker.com/)\n    - [NSubstitute](https://nsubstitute.github.io/)\n- Fake Survey Generator Worker\n    - .NET 9.0\n    - ASP.NET Core 9.0 Worker Service\n\n### Client\n\nThe client side consists of the following main components:\n\n- UI\n\nThe client side makes use of the following tools, libraries \u0026 frameworks:\n\n- [Vite](https://vitejs.dev/)\n- [React](https://reactjs.org/)\n- [TypeScript](https://www.typescriptlang.org/)\n- [auth0.js](https://github.com/auth0/auth0.js/)\n- [Tailwind CSS](https://tailwindcss.com/)\n- [PostCSS](https://postcss.org/)\n- [React Loading Skeleton](https://github.com/dvtng/react-loading-skeleton)\n- [NGINX](https://www.nginx.com/)\n- [Docker](https://www.docker.com/)\n\n### Common\n\nThe application is built for containers \u0026 .NET Aspire. For local development, the .NET Aspire App host is used when debugging the\napplication with Visual Studio/Rider.\n\nThe hosted version of the application is deployed here: https://fakesurveygenerator.mysecondarydomain.com\n\nThe following endpoints are accessible:\n\n- [/swagger](https://fakesurveygenerator.mysecondarydomain.com/swagger/index.html) - The Swagger documentation page for\n  the API\n- [/health/live](https://fakesurveygenerator.mysecondarydomain.com/health/live) - Health Checks endpoint used by Azure\n  Front Door health probe\n- [/health/ready](https://fakesurveygenerator.mysecondarydomain.com/health/ready) - Health Checks endpoint used by Azure\n  Front Door health probe\n\nThe hosted version utilizes the following infrastructure:\n\n- [Azure Container Apps](https://azure.microsoft.com/en-us/services/container-apps/#overview)\n- [Azure SQL Database](https://azure.microsoft.com/en-us/services/sql-database/)\n- [Azure Cache for Redis](https://azure.microsoft.com/en-us/services/cache/)\n- [Azure Container Registry](https://azure.microsoft.com/en-us/services/container-registry/)\n- [Azure Key Vault](https://azure.microsoft.com/en-us/services/key-vault/)\n- [Azure Log Analytics](https://docs.microsoft.com/en-us/azure/azure-monitor/logs/log-analytics-overview)\n- [Azure Application Insights](https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview)\n- [Azure Front Door](https://azure.microsoft.com/en-in/pricing/details/frontdoor/#overview)\n- [Azure DNS](https://docs.microsoft.com/en-us/azure/dns/dns-overview)\n- [Azure DevOps](https://azure.microsoft.com/en-us/services/devops/) (for CI/CD)\n\n## Authentication\n\nThe application makes use of [OpenID Connect](https://openid.net/connect/) for authentication which is implemented\nby [Auth0](https://auth0.com/). Currently supported connections are:\n\n- Auth0\n- Google\n- Microsoft\n\n## How do I run this thing?\n\nIn order to run FSG on your local machine, you will need the following prerequisites:\n\n- [Docker](https://www.docker.com/products/docker-desktop) or [Podman](https://podman.io/)\n- [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/)\n- [Visual Studio 2022 v17.10 or higher](https://visualstudio.microsoft.com/vs/)\n\n1. Open `FakeSurveyGenerator.slnx` in Visual Studio:\n\n2. Ensure that the `FakeSurveyGenerator.AppHost` project is selected as the startup project\n\n3. Hit `F5` to debug the application, or `Ctrl` + `F5` to run without debugging\n\n4. The [.NET Aspire Dashboard](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/overview) should\n   open automatically\n\n## How do I contribute?\n\nIf you find a bug, want to add a feature, or want to improve the documentation, open up a PR!\n\n## References\n\nMy deepest thanks to all the people who provided these resources as reference:\n\n- [.NET Microservices: Architecture for Containerized .NET Applications](https://docs.microsoft.com/en-us/dotnet/architecture/microservices/)\n- [eShopOnContainers](https://github.com/dotnet-architecture/eShopOnContainers)\n- [jasontaylordev/CleanArchitecture](https://github.com/jasontaylordev/CleanArchitecture)\n- [nadirbad/VerticalSliceArchitecture](https://github.com/nadirbad/VerticalSliceArchitecture)\n- [Vladimir Khorikov - Applying Functional Principles in C#](https://pluralsight.com/courses/csharp-applying-functional-principles)\n- [Vladimir Khorikov - Functional C#: Primitive obsession](https://enterprisecraftsmanship.com/posts/functional-c-primitive-obsession/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarcelMichau%2Ffake-survey-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMarcelMichau%2Ffake-survey-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarcelMichau%2Ffake-survey-generator/lists"}