Presentation
Presentation is a SPA (Single Page Application) using Angular and Typescript to easily implement domain models and business logic that match with the models and business logic from microservices.
*Being a microservice, Presentation is written as well using SOLID principles to:
- be reactive to events using RabbitMq;
- store its own data in separate databases;
- communicate with other microservices over HTTP using Consul to get IP and port using DNS;
- be resilient to failure using Polly;
- segregate business logic implementing Command pattern using MediatR;
- expose itself at runtime to Consul.
CRMService
CRMService has the role to manage users, configure the main company, and store its data in PostgreSQL.
CRMService contains the following technologies:
- C#, Asp.Net 5;
- PostgreSQL;
- EntityFramework Core as ORM;
- OpenAPI;
- Steeltoe as client for Consul;
- MediatR to segregate the business logic.
TmService
TmService contains contracts, products, services with management options and stores the flow activities. TmService receives events through RabbitMq to mark products when emitting automated invoices and stores its data in PostgreSQL.
TmService contains the following technologies:
- C#, Asp.Net 5;
- PostgreSQL;
- MassTransit for RabbitMq client and implementing pub/sub pattern;
- EntityFramework Core as ORM;
- OpenAPI;
- Steeltoe as client for Consul;
- MediatR to segregate the business logic.
FinancialService
FinancialService is a microservice that tracks all invoices and transactions and allows the creation of an invoice manually or automated. FinancialService communicates with PdfService, CrmService, TmService, and ApiOrchestrator directly through HTTP and sends events to TmService through RabbitMq. It also stores its data in PostgreSQL.
FinancialService contains the following technologies:
- C#, Asp.Net 5;
- PostgreSQL;
- MassTransit for RabbitMq client and implementing pub/sub pattern;
- EntityFramework Core as ORM;
- OpenAPI;
- Polly for circuit breaker;
- Hangfire for scheduled jobs;
- Refit to make it easier to communicate with other services over HTTP;
- Steeltoe as client for Consul;
- MediatR to segregate the business logic.
PdfService
PdfService is an agnostic service that communicates with an FTP server with the possibility to store, read and generate PDFs.
PdfService contains the following technologies:
- C#, Asp.Net 5;
- IronPdf library to generate Pdfs from .cshtml templates;
- OpenAPI;
- Steeltoe as client for Consul;
- MediatR to segregate the business logic.
EmailService
EmailService is an agnostic microservice that sends emails to specific email accounts using Sendgrid client.
EmailService contains the following technologies:
- C#, Asp.Net 5;
- OpenAPI;
- MassTransit for RabbitMq client and implementing pub/sub pattern;
- SendGrid client;
- MediatR to segregate the business logic.
Authentication
Authentication service is the service that creates accounts, generates tokens, and keeps the logic for authentication. It also stores its data in PostgreSQL.
Contains the following technologies:
- C#, Asp.Net 5;
- PostgreSQL;
- OpenAPI;
- MediatR to segregate the business logic;
- MailKit to implement custom smtp logic;
- Steeltoe as client for Consul;
- JWT for authorization.
ApiGateway
ApiGateway is a gateway service with the role of exposing microservices endpoints and authorization logic. It is the only service that communicates directly with client apps.
ApiGateway contains the following technologies:
- C#, Asp.Net 5;
- Ocelot library to implement API Gateway using microservices DNS stored in Consul;
- JWT for authorization.
ApiOrchestrator
ApiOrchestrator implements custom business logic by aggregating data for mobile and invoices.
ApiOrchestrator contains the following technologies:
- C#, Asp.Net 5;
- MediatR to segregate the business logic;
- OpenAPI;
- Polly for circuit breaker.
Common projects are used to implement DRY (Do not Repeat Yourself) principle, adding more stability to the solution by having a common place to store DTOs (Data Transfer Objects) and generic abstraction of the logic.