Skip to content

NicolasBologna/JobOpportunities

Repository files navigation

Job Opportunities .Net6 + Angular

REAL DEMO LIVE NOW

Setup

Set both projects (API and SPA) as startup projects

Startup projects

If you want to use Serilog:

  1. Install Windows Azure Storage Emulator

  2. Run:

    AzureStorageEmulator.exe start
  1. set:
    "AuditLogs": {
    "Enabled": true}

in appsettings.json

Steps to set up the database

  1. update-database

Steps to update the database

  1. add-migration <MigrationName> -Project JobOpportunities.Data -StartupProject JobOpportunities.API
  2. update-database

Technologies

  • .Net 6
  • EF Core
  • Moq
  • NUnit
  • MediatR
  • FluentValidations
  • FluentAssertions
  • Angular 13
  • Angular Material
  • Audit.NET
  • AzureStorageBlobs (Audit.NET.AzureStorageBlobs)
  • Serilog
  • Rabbitmq

Layers

API

(In Progress)

Data

EFCore 6 (Sql Server)

Generic Repository

Generic Repository

Core

Audit.NET: Track only commands with [AuditLog] attribute.

Auth: Access token + Refresh tokens

Domain

(In Progress)

Domain Model

Features

Log

To open local storage in azure storage explorer and avoid problems:

add by name

search "mediatr".


Audit.NET loguea solo commands en Azure Storage. Ver de tener AuditLogs:Enabled en el appSettings y el emulador de azure storage local corriendo. Se crea un blob container por día con formato: "mediatrcommandlogs{DateTime.Today:yyyyMMdd}" Y luego un registro en formato json por cada command con el formato: "{ev.EventType}/{currentUser?.Id}_{DateTime.UtcNow.Ticks}.json"

Serilog está en la pipeline de MediatR y hace un log de cada request con el siguiente formato: {RequetsName}: {@User} with request {@Request}

Hay un custom logger puesto en un middleware que mide tiempo de respuestas de cada endpoint

Queues and workers

Enable RabbitMQ Management Plugin

Go to the directory where the RabbitMQ is installed.

Now, enable the rabbitmq_management plugin using the rabbitmq-plugins command as shown below.

sbin/rabbitmq-plugins enable rabbitmq_management

After enabling the rabbitmq_management plugin you should restart the RabbitMQ server as shown below.

sbin/rabbitmqctl stop

sbin/rabbitmq-server -detached

By default the management plugin runs on 15672 HTTP port.

From your browser go to http://localhost:15672

The default username and password for RabbitMQ management plugin is: guest

Resources

💡 Notice: Some resources are in Spanish

Inspired by

Pending

Work in progress

References

To read

To watch

You are doing .NET logging wrong

Tools

DBeaver Mediatr Service Template