fake-survey-generator
💡 摘要
这个应用程序生成虚假的调查问卷以供娱乐和实验。
🎯 适合人群
🤖 AI 吐槽: “看起来很能打,但别让配置把人劝退。”
风险:Medium。建议检查:是否发起外网请求(SSRF/数据外发);API Key/Token 的获取、存储与泄露风险。以最小权限运行,并在生产环境启用前审计代码与依赖。
Screenshot

What is this?
This is a .NET | C# | React | TypeScript full-stack application of moderate complexity (not just a to-do app), used as a playground for experimentation. Simply put: This is where I mess around with code. It is heavily inspired by the .NET Microservices: Architecture for Containerized .NET Applications book, as well as its companion reference application eShopOnAzure. It also incorporates various elements from different repos & blog posts which served as inspiration.
It is built using Vertical Slice Architecture principles with CQRS (Command Query Responsibility Segregation) and DDD (Domain-Driven Design) thrown into the mix. It doesn't follow these principles to the letter, but provides a decent example of how to apply the basics of these principles.
It is heavily centered around the Microsoft .NET + Azure technology stacks as these are what I have the most experience in & just like building things with. 😀
Here are some of the features incorporated into this project:
Application Features
- Observable, production ready, distributed application support using Aspire
- Unit & Integration tests for a CQRS/DDD project with TUnit
- Target production database for integration tests using Testcontainers for .NET
- E2E acceptance tests using Aspire Test Projects & Playwright for .NET
- Implementing health checks for various components using AspNetCore.Diagnostics.HealthChecks
- Adding OpenAPI to an ASP.NET Core Web API with Scalar for API documentation
- Adding OpenID Connect for Authentication
- Adding OpenID Connect to Scalar
- Securing an ASP.NET Core Web API using JWT Bearer authentication
- Adding security headers to API responses using NetEscapades.AspNetCore.SecurityHeaders
- Using Hosted Services in ASP.NET Core Web API
- Using a distributed Redis cache
- Using Microsoft.Extensions.Http.Resilience for resilient HTTP requests
- Implementing Forwarded Headers for hosting ASP.NET Core Web API behind a load balancer
- Validation of commands using FluentValidation
- Configuring Azure Monitor OpenTelemetry for telemetry
- Using Dapr with Dapr SDK for .NET for platform agnostic integration with infrastructure components
Infrastructure Features
- Automatic semantic versioning using Nerdbank.GitVersioning
- Creating trusted SSL certificates for HTTPS in development
- Deploying Entity Framework Core Code-First Migrations to Azure SQL Database using Azure Pipelines
- Using Microsoft Entra ID authentication to Azure SQL Database with Entity Framework Core
- Running a distributed application locally using Aspire
- Using Azure Pipelines with Azure Developer CLI to build & deploy a distributed application to Azure Container Apps
- Infrastructure as Code for Azure resources using Bicep
Some of the above features are relatively straightforward to implement, others have some intricacies that require some Googling in order to set up. I just like to have them placed in the context of a complete working application to refer back to when necessary.
Why is this here?
I wanted something to try new things out on, without the risk of substantially endangering an actual production environment used by actual people.
It was for this reason that I built the Fake Survey Generator (FSG) app as a way to test out tools, libraries, patterns, frameworks & various other stuff.
It has a very simple domain: it generates surveys. Fake ones. They can be used as a tool for helping you decide what to have for dinner, which book you should read next, where you should go for your next team lunch, or anything that tickles your fancy.
This application is also used as a reference for configuring/wiring up some common things I sometimes forget how to do. Living Documentation if you will. You know the culprits: How do I wire up that database again? What is the syntax for that logging configuration? How do I make thing A talk to thing B?
The domain is kept relatively simple such that it doesn't overwhelm the app with unnecessary complexity. It should be quite easy to wrap your head around without requiring a degree in Computer Science.
I also felt that a lot of reference/demo/boilerplate projects out there cover the core application domain & don't go into much detail around the building/deployment/hosting of final application. So this project aims to cover both. It contains application code, configuration, CI/CD pipelines, infrastructure-as-code needed to run the application, as well as a live, running version of the application (as long as budget allows 😁). So this repo hopefully may contain something for everyone & fill in the potential gaps across the whole spectrum of application development. It falls somewhere between a template/boilerplate project & a real-world production open-source application.
How is this thing structured?
FSG consists of two parts:
Server
The server side consists of the following main components:
- Fake Survey Generator API
- Fake Survey Generator Worker
- Application Project
- Application Tests Project
- API Integration Tests Project
- E2E Acceptance Tests Project
The server side makes use of the following tools, libraries & frameworks:
- Fake Survey Generator API
- Fake Survey Generator Worker
- .NET 10
- ASP.NET Core Worker Service
Client
The client side consists of the following main components:
- UI
The client side makes use of the following tools, libraries & frameworks:
Common
The application is built for containers & Aspire. For local development, the Aspire App host is used when debugging the application with Visual Studio/Rider.
The hosted version of the application is deployed here: https://fakesurveygenerator.mysecondarydomain.com
The following endpoints are accessible:
- /openapi - The OpenAPI documentation page for the API
- /health/live - Health Checks endpoint used by Azure Front Door health probe
- /health/ready - Health Checks endpoint used by Azure Front Door health probe
The hosted version utilizes the following infrastructure:
- Azure Container Apps
- [Azure SQL Database](https://azure.microsoft.com/en-us/services/
优点
- 鼓励对各种技术的实验
- 提供简单的学习领域
- 包含全面的全栈应用程序功能
缺点
- 对真实调查的实际应用有限
- 复杂性可能会让初学者感到不知所措
- 文档缺乏详细的使用说明
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 MarcelMichau.
