Giter Club home page Giter Club logo

fake-survey-generator's Introduction

Fake Survey Generator

This is an app. That generates surveys. Fake ones. For fun. That is all.

Component Build Status
Fake Survey Generator API Build Status
Fake Survey Generator UI Build Status
IdentityServer Build Status
SQL Server Build Status
Redis Build Status

What is this?

This is an application of moderate complexity, 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 eShopOnContainers

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.

How is this thing built?

FSG consists of two parts:

Server

The server side consists of the following main components:

  • Fake Survey Generator API
    • Domain Project
    • Domain Unit Tests Project
    • Infrastructure Project
    • Application Project
    • Application Tests Project
    • API Integration Tests Project
    • EF Design Project (used purely for EF Core design-time tooling)
  • Identity Provider API

The server side makes use of the following tools, libraries & frameworks:

  • Fake Survey Generator API
    • .NET Core 3.1
    • ASP.NET Core 3.1 Web API
    • Entity Framework Core 3.1 with Code-First Migrations
    • Dapper
    • Redis
    • Swagger
    • AutoMapper
    • MediatR
    • FluentValidation
    • AspNetCore.Diagnostics.HealthChecks
    • Docker
  • Identity Provider API
    • .NET Core 3.1
    • ASP.NET Core 3.1 MVC
    • IdentityServer

Client

The client side consists of the following main components:

  • UI

The client side makes use of the following tools, libraries & frameworks:

  • React
  • NGINX
  • Docker

Common

The application is built for Docker, Docker Compose & Kubernetes with Helm. For local development, Docker Compose is used when debugging the application with Visual Studio, and Skaffold is used to package the application into a Helm chart to deploy to a local Kubernetes cluster for running locally.

The hosted version of the application is deployed to three environments:

The following endpoints are accessible:

  • /swagger - The Swagger documentation page for the API
  • /health/live - Health Checks endpoint used by Kubernetes liveness probe
  • /health/ready - Health Checks endpoint used by Kubernetes readiness probe

The hosted version utilizes the following:

  • Azure Kubernetes Service
  • Azure SQL Database
  • Azure Redis Cache
  • Azure Container Registry
  • Docker Hub
  • Azure DevOps Services (for CI/CD)

Authentication

The application makes use of OpenID Connect for authentication which is implemented by IdentityServer. The Identity Provider has a user database with a couple of test users with the following credentials:

  • User 1

    • Username: alice
    • Password: Pass123$
  • User 2

    • Username: bob
    • Password: Pass123$

There is no interface to register users - the authentication mechanism serves as an example of how to implement user authentication using OpenID Connect in a .NET microservice architecture.

How do I run this thing?

In order to run FSG on your local machine, you will need the following prerequisites:

To run on local Kubernetes:

  • Docker Desktop with Kubernetes enabled (Ensure that at least 2048 MB of Memory is allocated to Docker Engine)
  • NGINX Ingress installed on the Kubernetes cluster
  • Skaffold

To deploy to a local Kubernetes cluster:

  1. Create an entry in your hosts file as follows:

    127.0.0.1 k8s.local

  2. In a Terminal/Command Prompt/PowerShell window in the project root, run:

    skaffold run

  3. In a browser, navigate to http://k8s.local to open up the Fake Survey Generator UI

To run with Docker Compose:

  • Docker Desktop
  • Visual Studio (optional)

To run with Docker Compose:

  1. In a Terminal/Command Prompt/PowerShell window in the project root, run:

    docker-compose up

  2. In a browser, navigate to http://localhost:3000 to open up the Fake Survey Generator UI

or

  1. Open FakeSurveyGenerator.sln in Visual Studio:

  2. Make sure that the docker-compose project is selected as the startup project

  3. Hit F5 to debug the application, or Ctrl + F5 to run without debugging

  4. In a browser, navigate to http://localhost:3000 to open up the Fake Survey Generator UI

How do I contribute?

If you find a bug, want to add a feature, or want to improve the documentation, open up a PR!

fake-survey-generator's People

Contributors

marcelmichau avatar dependabot-preview[bot] avatar dependabot[bot] avatar dorucioclea avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.