/OneTimePassGen

`One-time password generator` is an web application which allows authenticated users to generate random passwords which expires at an interval of 30 seconds after creation.

Primary LanguageC#

One-time password generator

One-time password generator is an web application which allows authenticated users to generate random passwords which expires at an interval of 30 seconds after creation.

App-Demo

  • Build Status:

    Build Status

Table of contents:

Prerequisites

  1. Install latest NET Core 6 SDK, then check if dotnet is installed by running next command:

    dotnet --version
  2. Restore tools used in development by running next command:

    dotnet tool restore
    

Running the solution

  1. To run the application via dotnet execute command and open browser at URL https://localhost:7010/:

    dotnet run --project ./src/Server
  2. Open browser at URL https://localhost:7056 and login or create a new account.

Build solution

Running all tests

  • Check test runs on CI --or--

  • On the root folder run next command:

    dotnet cake --task=test
  • The above command will also generated coverage results which can open automatically if option open-coverage-results is present:

    dotnet cake --task=test --open-coverage-results

Unit tests

Integration tests

Acceptance tests

Code Coverage

  • Check coverage reports on CI --or--

  • On the root folder run next command:

    dotnet cake --task=code-coverage
  • Generated coverage results are open automatically if option open-coverage-results is present:

    dotnet cake --task=code-coverage --open-coverage-results

Database commands

In order to use any of the [ef commands][ef-commands] we need to:

  • specify ./src/Infrastructure as the --project (since there we keep the database configurations)
  • specify ./src/Server as the --startup-project (since the Server includes the Client)
  • and in case of working with ef migrations add command, specify Persistence/Migrations as the --output-dir.

Handy commands:

  • update database:

    dotnet ef database update --project ./src/Infrastructure --startup-project ./src/Server
  • drop database

    dotnet ef database drop --project ./src/Infrastructure --startup-project ./src/Server
  • add migration:

    dotnet ef migrations add "MigrationName" --project ./src/Infrastructure --startup-project ./src/Server --output-dir Persistence/Migrations
  • remove migration:

    dotnet ef migrations remove --project ./src/Infrastructure --startup-project ./src/Server