Building a Microservice Application using C#, ASP.NET Core, Docker & Kubernetes
Tags: showdev, csharp, dotnet, microservices
Published: 2020-01-28 08:37:59

Photo by Anas Alshanti on Unsplash

---

Hello everyone!

This is my first post on dev.to, so I'm very new to this. :)

I'd like to share something which I built recently. 

After reading the [.NET Microservices: Architecture for Containerized .NET Applications](https://docs.microsoft.com/en-us/dotnet/architecture/microservices/) book, I felt inspired to build something using the concepts I learned in the book.  But you know how it goes, I got the old writer's block when deciding what on Earth I'm going to build.  I didn't want to write yet another to-do app because I wanted to play around with the Domain-Driven Design (DDD) & Command Query Responsibility Segregation (CQRS) concepts described in the book. A simple to-do app would not have the appropriate domain complexity which would allow me to flex my newly acquired DDD muscle (the muscle in question is still quite small, I've only just gotten into this).

I wanted to tackle a problem which was just complex enough to apply some DDD patterns, but not too complex such that it requires expert knowledge to understand. Therefore, I chose a completely imaginary problem.

How often do you find yourself in the need to decide between multiple options? Whether it's where to go for your next team lunch, which book to read next, which Game of Thrones character to dress up as for Halloween, or how to arrange your Steam wishlist. Don't you wish there was something that could make this decision process easier? Fortunately, there is a method that plenty of industry experts use to gather feedback on specific topics: Surveys. But what if you don't have the time or resources to compile a survey, send it out to multiple respondents, wait for their feedback, consolidate the results and then finally make your decision? This is where *Fake Survey Generator* comes in...

![Fake Survey Generator UI](https://dev-to-uploads.s3.amazonaws.com/i/b405ipshv2snoyhvgqg2.png)

Yes, the interface is basic, but it's also *minimal*.

How it works: you capture some basic info about the survey you'd like to create:

![Creating a Survey](https://dev-to-uploads.s3.amazonaws.com/i/huhxjvevibr2nd0y0w8g.png)

Click on *Create Survey*, and the results will be calculated:

![Survey Results](https://dev-to-uploads.s3.amazonaws.com/i/u04p5apkouth2ffxq4eb.png)

There. It's definitive. The community has spoken.

## Fake Survey Generator features

The back-end side of the app is built with a variety of frameworks, tools & libraries predominantly centered around the C# .NET stack, while the front-end side is currently a basic React app written in TypeScript. In a nutshell, it's slightly more complex than a to-do app, but it's built as if it were a real-world, production-ready microservice application. Therefore, it uses a real database, has authentication, validation rules, health checks, fault handling, logging, caching, unit tests, integration tests & a CI/CD pipeline that deploys to Kubernetes. In short, overkill.

I mainly built Fake Survey Generator as a platform to teach myself new concepts and to try stuff out, while also serving as a reference application when building new things. There are still plenty of features I'd like to add to the app in due course such as asynchronous messaging using queues, experimenting with GraphQL & gRPC, and adding some more bounded contexts.

Hopefully it can serve as a useful reference for any other .NET devs out there who are interested in topics such as Clean Architecture, DDD, CQRS as well as Docker & Kubernetes.

More information & guidelines on how to run everything can be found on the project README on GitHub:

{% github https://github.com/MarcelMichau/fake-survey-generator %}

I'm keen to hear any feedback, and of course, PRs, contributions & suggestions are welcome!