Architecture - malparty/keywords GitHub Wiki

The solution contains 2x projects:

  • Web app ./KeywordsApp/
  • Test project ./KeywordsApp.Tests/

Besides, you can also find:

  • GitHub Action workflow ./.github/workflows/
  • Some config scripts (Docker compose, .editorconfig, build and dev scripts)

Solution file explorer

Web app (./KeywordsApp/)

We follow Asp.net core MVC project standards. Besides the Model/View/Controller folders, you will find:

  • Areas: Areas are only used by Authentication
  • ClientApp: where custom css/js are being codded. Webpack is setup only in this folder
  • Data: Containing our Entity Framework Context and its configurations
  • HostedService: Contain our background worker to parse pending keywords
  • Hubs: Contain our SignalR hub and its interface
  • Migrations: Containing the scripts to update the database
  • wwwroot: Where the css/js/... libs are located as well as the dist output folder from Webpack

Test project (./KeywordsApp.Tests/)

Running unit tests with X-Unit framework. Tests are organized into main-classes (covering 1 class to be tested). Inside each of these main classes, we encapsulate sub-classes to regroup all tests for 1 given method.

class ClassLevelTests{
    class MethodLevelTests{
        [Fact] / [Theory]
        public void MethodName1_Label(){
        [...]
    }
}

At the moment, tests cover 2 main classes:

  • UploadFormViewModel, containing CSV File validation rules as well as parsing
  • KeywordParserModel, containing Google results HTM parsing & validation rules

The overall execution time is around 150ms for 35 tests.

GitHub Action workflow

  • Test: Run unit tests on any Push.

A Docker compose file

Currently only used to handle the Postgres DB.