Owneat Technical Guide main Help

Identity

This microservice is responsible for managing user accounts and handling login requests. It provides APIs for creating, updating, and deleting user accounts, as well as authenticating users with their email and password.

Prerequisites

  • Knowledge of user authentication and authorization concepts

  • Familiarity with C# and .NET

  • Familiarity with DDD and CQRS

Getting Started

  1. Clone the repository: git clone https://versioning.advans-group.com/owneat/owneat.git

  2. Install dependencies: dotnet restore

  3. Create a local database and run the schema migration scripts located in the Infrastructure/Migrations directory

  4. Set the necessary configuration values in the appsettings.json and appsettings.Development.json files, including the connection string for the database.

  5. Run the microservice: dotnet run.

Architecture

The Identity microservice is built using Domain-Driven Design (DDD) principles and follows a Command-Query Responsibility Segregation (CQRS) pattern.

The Identity microservice is built with C# and .NET, and follows a microservices architecture. It uses a database to store user data.

The Identity microservice uses JSON Web Tokens (JWTs) for authentication, which are implemented using the JwtConfigurationproject in the BuildingBlocks solution.

The CQRS handlers in the Identity microservice have their own test classes, which use xUnit, Fluent Assertion, and the Should_do_when pattern for testing. Each CQRS handler has its own test file.

The Identity microservice uses the IOptions<> pattern to retrieve data from the appsettings.json and appsettings.json.development files.

Testing

To run the test suite, use the following command: dotnet test The Identity microservice uses MOQ to mock the database and IAsyncLifeTime objects for testing purposes. This allows us to test the behavior of the service without actually interacting with the database.

Last modified: 21 May 2024