diff --git a/Directory.Build.props b/Directory.Build.props
index b2374060..04aeec4f 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -26,7 +26,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/README.md b/README.md
index 0b0fc551..5f55d748 100644
--- a/README.md
+++ b/README.md
@@ -73,7 +73,9 @@ You can use **Docker compose** to setup the infrastructure components just by ru
``` bash
cd ./containers
-# Setup the infrastructure. Use this file to setup the basic infrastructure components (RabbitMQ, MongoDB)
+
+# Setup the infrastructure.
+#Use this file to setup the basic infrastructure components (RabbitMQ, MongoDB)
docker compose -f ./infrastructure.yml --env-file ./.env --project-name genocs up -d
# Use this file only in case you want to setup Redis and PostgreSQL (no need if you use MongoDB)
@@ -106,9 +108,7 @@ docker compose -f ./infrastructure-ml.yml --env-file ./.env --project-name genoc
`infrastructure.yml` allows to install the basic infrastructure components. They are:
- [RabbitMQ](https://rabbitmq.com)
-- [Redis](https://redis.io)
- [MongoDB](https://mongodb.com)
-- [Postgres](https://www.postgresql.org/)
`infrastructure-db.yml` allows to install Redis and PostgreSQL
@@ -125,6 +125,7 @@ You can check them locally:
`infrastructure-monitoring.yml` allows to install the monitoring infrastructure components. They are:
+- [Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/)
- [Prometheus](https://prometheus.io/)
- [Grafana](https://grafana.com/)
- [InfluxDB](https://www.influxdata.com/)
@@ -133,7 +134,7 @@ You can check them locally:
You can find the console locally at:
-
+- [Aspire](localhost:18888): `localhost:18888`
- [Prometheus](localhost:9090): `localhost:9090`
- [Grafana](localhost:3000): `localhost:3000`
- [InfluxDB](localhost:8086): `localhost:8086`
@@ -141,29 +142,45 @@ You can find the console locally at:
- [Seq](localhost:5341): `localhost:5341`
-`infrastructure-scaling.yml` allows to install the scaling infrastructure components composed by Fabio and Consul.
-
+`infrastructure-scaling.yml` allows to install the scaling infrastructure components composed by a Fabio (Loadbalancer) Service Discovery (Consul) components. They are:
- [Fabio](https://fabiolb.net/)
- [Consul](https://www.consul.io/)
-
-
`infrastructure-security.yml` allows to install the security infrastructure components.
Inside the file you can find:
- vault (Hashicorp)
-The script below allows to setup the infrastructure components. This means that you can find all the containers inside the same network.
-
-The network is called `genocs`.
+> **NOTE**
+>
+> The commands above allows to setup infrastructure components, this means you can find all the containers inside the same network `genocs`.
+>
+> Whenever possible the data are persisted on the host machine by means of volumens, so you can restart the containers without losing data.
+
``` yml
networks:
genocs:
name: genocs-network
driver: bridge
+
+volumes:
+ rabbitmq-data:
+ mongo-data:
+ redis-data:
+ postgres-data:
+ influx-data:
+ grafana-data:
+ jaeger-data:
+ seq-data:
+ vault-data:
+ elk-data:
+ fabio-data:
+ consul-data:
+ prometheus-data:
+ ml-data:
```
Remember to add the network configuration inside your docker compose file to setup the network, before running the containers.
@@ -176,6 +193,11 @@ You can setup the application inside a Kubernetes cluster.
Check the repo [enterprise-containers](https://github.com/Genocs/enterprise-containers) to setup a Kubernetes cluster.
There you can find scripts, configuration files and documentation to setup a cluster from scratch.
+## ***Aspire Integration***
+
+SOON :rocket:
+
+
## Support
Use [**api-workbench**](./api-workbench.rest) inside Visual Studio code with [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) plugin
@@ -198,7 +220,7 @@ Use [**api-workbench**](./api-workbench.rest) inside Visual Studio code with [RE
"address": "docker.for.mac.localhost",
"port": "5070",
"pingEnabled": true,
- "pingEndpoint": "health",
+ "pingEndpoint": "healthz",
"pingInterval": 3,
"removeAfterInterval": 3
},
@@ -219,7 +241,12 @@ Use [**api-workbench**](./api-workbench.rest) inside Visual Studio code with [RE
},
"logger": {
"level": "information",
- "excludePaths": [ "/", "/ping", "/metrics" ],
+ "excludePaths": [
+ "/",
+ "/healthz",
+ "/alive",
+ "/metrics"
+ ],
"excludeProperties": [
"api_key",
"access_key",
@@ -453,7 +480,10 @@ docker push genocs/demo-worker:latest
```
---
-## Enterprise Application
+## **Enterprise Application**
+
+### Application Components
+
Inside **./src/apps** folder you can find a full-fledged application composed by:
- ApiGateway
@@ -464,30 +494,43 @@ Inside **./src/apps** folder you can find a full-fledged application composed by
In that way you can test the entire flow.
-**TODO**: Add a architecture diagram to show the components and how they interact with each other.
+| Component | Description | Container Port | Visibility |
+|-------------------|-----------------------------------|----------------|------------------------------|
+| ApiGateway | Handles API requests | :5500 | Public |
+| Identity Service | Manages user identities | :5510* | Private through API Gateway |
+| Product Service | Manages product information | :5520* | Private through API Gateway |
+| Order Service | Processes orders | :5530* | Private through API Gateway |
+| SignalR Service | Handles real-time communication | :5540* | Private through API Gateway |
+
+
+
### How to BUILD & RUN the application
-The build and run process can be done by using docker-compose
+The build and run process can be done by using docker-compose.
+
+Pre-requisites:
+- Docker
+
``` bash
cd src/apps
# Build with docker compose
-docker compose -f ./docker-compose.yml -f ./docker-compose.override.yml --env-file ./local.env --project-name genocs-app build
+docker compose -f ./docker-compose.yml -f ./docker-compose.override.yml --env-file ./local.env --project-name genocs build
# *** Before running the solution remember to check ***
# *** if the infrastructure services were setup ***
# Run with docker compose
-docker compose -f ./docker-compose.yml --env-file ./local.env --project-name genocs-app up -d
+docker compose -f ./docker-compose.yml --env-file ./local.env --project-name genocs up -d
# Clean Docker cache
docker builder prune
```
-Following commands are useful to build and push the images one by one
+Use following to build and push the images one by one
``` bash
cd src/apps
@@ -496,16 +539,16 @@ cd src/apps
docker build -t genocs/apigateway:1.0.0 -t genocs/apigateway:latest -f ./apigateway.dockerfile .
# Build the identity service
-docker build -t genocs/identities:1.0.0 -t genocs/identities:latest -f ./identity-webapi.dockerfile .
+docker build -t genocs/identities:1.0.0 -t genocs/identities:latest -f ./identity.dockerfile .
# Build the order service
-docker build -t genocs/orders:1.0.0 -t genocs/orders:latest -f ./containers/order-webapi.dockerfile .
+docker build -t genocs/orders:1.0.0 -t genocs/orders:latest -f ./containers/order.dockerfile .
# Build the product service
-docker build -t genocs/products:1.0.0 -t genocs/products:latest -f ./product-webapi.dockerfile .
+docker build -t genocs/products:1.0.0 -t genocs/products:latest -f ./product.dockerfile .
# Build the signalr service
-docker build -t genocs/signalr:1.0.0 -t genocs/signalr:latest -f ./signalr-webapi.dockerfile .
+docker build -t genocs/signalr:1.0.0 -t genocs/signalr:latest -f ./signalr.dockerfile .
# Push on Dockerhub
@@ -556,13 +599,13 @@ Here are a few ways by which you can support.
- ☕ If you want to support this project in the long run, [consider buying me a coffee](https://www.buymeacoffee.com/genocs)!
-[](https://www.buymeacoffee.com/genocs)
+[](https://www.buymeacoffee.com/genocs)
## Code Contributors
This project exists thanks to all the people who contribute. [Submit your PR and join the team!](CONTRIBUTING.md)
-[](https://github.com/genocs/blazor-template/graphs/contributors)
+[](https://github.com/genocs/genocs-library/graphs/contributors)
## Financial Contributors
diff --git a/assets/Genocs-Library-Overview.drawio.png b/assets/Genocs-Library-Overview.drawio.png
deleted file mode 100644
index ab45ae00..00000000
Binary files a/assets/Genocs-Library-Overview.drawio.png and /dev/null differ
diff --git a/assets/architecture_01.png b/assets/architecture_01.png
new file mode 100644
index 00000000..d51e1c1c
Binary files /dev/null and b/assets/architecture_01.png differ
diff --git a/genocs.sln b/genocs.sln
index 53366e9e..cb7bf2c9 100644
--- a/genocs.sln
+++ b/genocs.sln
@@ -37,8 +37,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.HTTP", "src\Genocs.H
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.Auth", "src\Genocs.Auth\Genocs.Auth.csproj", "{63DFA0D8-D60E-4985-BD46-E6A2F253E2D5}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdentityService", "IdentityService", "{6E25EB9D-CA55-4DF1-8A2A-5A8A20C4B849}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.WebApi", "src\Genocs.WebApi\Genocs.WebApi.csproj", "{612DA557-6D26-485A-A998-AAABEC1F796B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.WebApi.Swagger", "src\Genocs.WebApi.Swagger\Genocs.WebApi.Swagger.csproj", "{E01C11ED-A212-4B57-A94B-0B4CA097AB49}"
@@ -67,15 +65,27 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.Persistence.Redis",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.Secrets.Vault", "src\Genocs.Secrets.Vault\Genocs.Secrets.Vault.csproj", "{3AC0521F-192D-4B1F-8741-64D4505A5AA5}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "APIGateway", "APIGateway", "{E2C01E9C-032C-4CD2-A0DE-C1A7AB8A9C7B}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Application", "Application", "{140B7191-88E9-4EEE-9D86-9A70839F8507}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.APIGateway", "src\apps\api-gateway\Genocs.APIGateway\Genocs.APIGateway.csproj", "{C9E31675-9AD7-4EBC-9986-B64CCE869454}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "api-gateway", "api-gateway", "{E2C01E9C-032C-4CD2-A0DE-C1A7AB8A9C7B}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "identity", "identity", "{6E25EB9D-CA55-4DF1-8A2A-5A8A20C4B849}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "orders", "orders", "{80862789-8B42-4878-AC10-9CFF06A7313C}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "notification", "notification", "{160F94A8-C119-4C0F-94FA-E03673269AC8}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "notification-signalr", "notification-signalr", "{75D24F85-48AC-4058-AF8D-461FC6A360AD}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wallet", "wallet", "{9344A71B-D7EA-4C91-B303-2F8E8841B521}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.Identities.Application", "src\apps\identity\Genocs.Identities.Application\Genocs.Identities.Application.csproj", "{D1BE29BD-9518-42DA-9A34-C86D4287BAB5}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "products", "products", "{B2028A73-6C94-4166-A0BB-22080805E351}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.Identities.WebApi", "src\apps\identity\Genocs.Identities.WebApi\Genocs.Identities.WebApi.csproj", "{CA411C82-9B2F-45B2-AF3F-8650C971E49D}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "APIGateway", "src\apps\api-gateway\APIGateway.WebApi\APIGateway.WebApi.csproj", "{C9E31675-9AD7-4EBC-9986-B64CCE869454}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Identities.Application", "src\apps\identity\Identities.Application\Identities.Application.csproj", "{D1BE29BD-9518-42DA-9A34-C86D4287BAB5}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Identities.WebApi", "src\apps\identity\Identities.WebApi\Identities.WebApi.csproj", "{CA411C82-9B2F-45B2-AF3F-8650C971E49D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.Common", "src\Genocs.Common\Genocs.Common.csproj", "{2B25640E-3141-4AD1-AFDE-AFE4ADDBA45F}"
EndProject
@@ -95,9 +105,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Solution Items", "_Solutio
stylecop.json = stylecop.json
EndProjectSection
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OrdersService", "OrdersService", "{80862789-8B42-4878-AC10-9CFF06A7313C}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.Orders.WebApi", "src\apps\orders\Genocs.Orders.WebApi\Genocs.Orders.WebApi.csproj", "{F9F54FEC-23B0-4A83-B5E9-75CD476D4B22}"
+
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Orders.WebApi", "src\apps\orders\Orders.WebApi\Orders.WebApi.csproj", "{F9F54FEC-23B0-4A83-B5E9-75CD476D4B22}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.Discovery.Consul", "src\Genocs.Discovery.Consul\Genocs.Discovery.Consul.csproj", "{C42D741B-EBCC-4770-907C-C8B980D22A65}"
EndProject
@@ -105,17 +114,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.LoadBalancing.Fabio"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.HTTP.RestEase", "src\Genocs.HTTP.RestEase\Genocs.HTTP.RestEase.csproj", "{C2CC0D45-CB64-4E0C-B875-6DB1667141E3}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NotificationsService", "NotificationsService", "{160F94A8-C119-4C0F-94FA-E03673269AC8}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SignalR", "SignalR", "{75D24F85-48AC-4058-AF8D-461FC6A360AD}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WalletsService", "WalletsService", "{9344A71B-D7EA-4C91-B303-2F8E8841B521}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.SignalR.WebApi", "src\apps\signalr\Genocs.SignalR.WebApi\Genocs.SignalR.WebApi.csproj", "{6846DCBA-4D72-49DA-B4FE-70AAF5542AB2}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ProductsService", "ProductsService", "{B2028A73-6C94-4166-A0BB-22080805E351}"
+
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SignalR.WebApi", "src\apps\signalr\SignalR.WebApi\SignalR.WebApi.csproj", "{6846DCBA-4D72-49DA-B4FE-70AAF5542AB2}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.Products.WebApi", "src\apps\products\Genocs.Products.WebApi\Genocs.Products.WebApi.csproj", "{6CE8740F-8561-481B-AC9F-D1E73C449235}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Products.WebApi", "src\apps\products\Products.WebApi\Products.WebApi.csproj", "{6CE8740F-8561-481B-AC9F-D1E73C449235}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Application", "Application", "{B184733D-2415-4517-BC65-26ED22EEB2C2}"
ProjectSection(SolutionItems) = preProject
diff --git a/src/Genocs.Auth/Genocs.Auth.csproj b/src/Genocs.Auth/Genocs.Auth.csproj
index cdfd60f9..3ed166d8 100644
--- a/src/Genocs.Auth/Genocs.Auth.csproj
+++ b/src/Genocs.Auth/Genocs.Auth.csproj
@@ -18,13 +18,11 @@
-
-
-
+
diff --git a/src/Genocs.Core.Demo.Contracts/Genocs.Core.Demo.Contracts.csproj b/src/Genocs.Core.Demo.Contracts/Genocs.Core.Demo.Contracts.csproj
index a0048946..6949e81d 100644
--- a/src/Genocs.Core.Demo.Contracts/Genocs.Core.Demo.Contracts.csproj
+++ b/src/Genocs.Core.Demo.Contracts/Genocs.Core.Demo.Contracts.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/src/Genocs.Core.Demo.Domain/Genocs.Core.Demo.Domain.csproj b/src/Genocs.Core.Demo.Domain/Genocs.Core.Demo.Domain.csproj
index c5014b73..f038f127 100644
--- a/src/Genocs.Core.Demo.Domain/Genocs.Core.Demo.Domain.csproj
+++ b/src/Genocs.Core.Demo.Domain/Genocs.Core.Demo.Domain.csproj
@@ -12,8 +12,8 @@
-
-
+
+
diff --git a/src/Genocs.Core.Demo.WebApi/Genocs.Core.Demo.WebApi.csproj b/src/Genocs.Core.Demo.WebApi/Genocs.Core.Demo.WebApi.csproj
index f96ba041..5a82c70d 100644
--- a/src/Genocs.Core.Demo.WebApi/Genocs.Core.Demo.WebApi.csproj
+++ b/src/Genocs.Core.Demo.WebApi/Genocs.Core.Demo.WebApi.csproj
@@ -20,19 +20,19 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
diff --git a/src/Genocs.Core.Demo.Worker/Genocs.Core.Demo.Worker.csproj b/src/Genocs.Core.Demo.Worker/Genocs.Core.Demo.Worker.csproj
index 08e02982..b3271537 100644
--- a/src/Genocs.Core.Demo.Worker/Genocs.Core.Demo.Worker.csproj
+++ b/src/Genocs.Core.Demo.Worker/Genocs.Core.Demo.Worker.csproj
@@ -14,14 +14,14 @@
-
-
-
+
+
+
-
+
diff --git a/src/Genocs.Core/Genocs.Core.csproj b/src/Genocs.Core/Genocs.Core.csproj
index b4d32c18..648c8e46 100644
--- a/src/Genocs.Core/Genocs.Core.csproj
+++ b/src/Genocs.Core/Genocs.Core.csproj
@@ -22,12 +22,12 @@
-
+
-
+
diff --git a/src/Genocs.Discovery.Consul/Genocs.Discovery.Consul.csproj b/src/Genocs.Discovery.Consul/Genocs.Discovery.Consul.csproj
index 89fc9be8..98b96f58 100644
--- a/src/Genocs.Discovery.Consul/Genocs.Discovery.Consul.csproj
+++ b/src/Genocs.Discovery.Consul/Genocs.Discovery.Consul.csproj
@@ -18,14 +18,11 @@
-
-
-
-
+
diff --git a/src/Genocs.HTTP.RestEase/Genocs.HTTP.RestEase.csproj b/src/Genocs.HTTP.RestEase/Genocs.HTTP.RestEase.csproj
index 19552e7b..f6a2abb1 100644
--- a/src/Genocs.HTTP.RestEase/Genocs.HTTP.RestEase.csproj
+++ b/src/Genocs.HTTP.RestEase/Genocs.HTTP.RestEase.csproj
@@ -18,17 +18,11 @@
-
-
-
-
-
-
-
+
diff --git a/src/Genocs.HTTP/Genocs.HTTP.csproj b/src/Genocs.HTTP/Genocs.HTTP.csproj
index b8e6e49e..439254d0 100644
--- a/src/Genocs.HTTP/Genocs.HTTP.csproj
+++ b/src/Genocs.HTTP/Genocs.HTTP.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.LoadBalancing.Fabio/Genocs.LoadBalancing.Fabio.csproj b/src/Genocs.LoadBalancing.Fabio/Genocs.LoadBalancing.Fabio.csproj
index a75fb1bd..b9d556b5 100644
--- a/src/Genocs.LoadBalancing.Fabio/Genocs.LoadBalancing.Fabio.csproj
+++ b/src/Genocs.LoadBalancing.Fabio/Genocs.LoadBalancing.Fabio.csproj
@@ -18,14 +18,10 @@
-
-
-
-
-
+
diff --git a/src/Genocs.Logging/CQRS/Decorators/CommandHandlerLoggingDecorator.cs b/src/Genocs.Logging/CQRS/Decorators/CommandHandlerLoggingDecorator.cs
index 2c0182a0..a75a06ef 100644
--- a/src/Genocs.Logging/CQRS/Decorators/CommandHandlerLoggingDecorator.cs
+++ b/src/Genocs.Logging/CQRS/Decorators/CommandHandlerLoggingDecorator.cs
@@ -6,21 +6,13 @@
namespace Genocs.Logging.CQRS.Decorators;
-[DecoratorAttribute]
-internal sealed class CommandHandlerLoggingDecorator : ICommandHandler
+[Decorator]
+internal sealed class CommandHandlerLoggingDecorator(ICommandHandler handler, ILogger> logger, IServiceProvider serviceProvider) : ICommandHandler
where TCommand : class, ICommand
{
- private readonly ICommandHandler _handler;
- private readonly ILogger> _logger;
- private readonly IMessageToLogTemplateMapper _mapper;
-
- public CommandHandlerLoggingDecorator(ICommandHandler handler,
- ILogger> logger, IServiceProvider serviceProvider)
- {
- _handler = handler;
- _logger = logger;
- _mapper = serviceProvider.GetService() ?? new EmptyMessageToLogTemplateMapper();
- }
+ private readonly ICommandHandler _handler = handler;
+ private readonly ILogger> _logger = logger;
+ private readonly IMessageToLogTemplateMapper _mapper = serviceProvider.GetService() ?? new EmptyMessageToLogTemplateMapper();
public async Task HandleAsync(TCommand command, CancellationToken cancellationToken = default)
{
@@ -40,14 +32,14 @@ public async Task HandleAsync(TCommand command, CancellationToken cancellationTo
}
catch (Exception ex)
{
- var exceptionTemplate = template.GetExceptionTemplate(ex);
+ string? exceptionTemplate = template.GetExceptionTemplate(ex);
Log(command, exceptionTemplate, isError: true);
throw;
}
}
- private void Log(TCommand command, string message, bool isError = false)
+ private void Log(TCommand command, string? message, bool isError = false)
{
if (string.IsNullOrEmpty(message))
{
diff --git a/src/Genocs.Logging/CQRS/Decorators/EventHandlerLoggingDecorator.cs b/src/Genocs.Logging/CQRS/Decorators/EventHandlerLoggingDecorator.cs
index 501916ca..eac0fc4f 100644
--- a/src/Genocs.Logging/CQRS/Decorators/EventHandlerLoggingDecorator.cs
+++ b/src/Genocs.Logging/CQRS/Decorators/EventHandlerLoggingDecorator.cs
@@ -6,20 +6,13 @@
namespace Genocs.Logging.CQRS.Decorators;
-[DecoratorAttribute]
-internal sealed class EventHandlerLoggingDecorator : IEventHandler where TEvent : class, IEvent
+[Decorator]
+internal sealed class EventHandlerLoggingDecorator(IEventHandler handler, ILogger> logger, IServiceProvider serviceProvider) : IEventHandler
+ where TEvent : class, IEvent
{
- private readonly IEventHandler _handler;
- private readonly ILogger> _logger;
- private readonly IMessageToLogTemplateMapper _mapper;
-
- public EventHandlerLoggingDecorator(IEventHandler handler,
- ILogger> logger, IServiceProvider serviceProvider)
- {
- _handler = handler;
- _logger = logger;
- _mapper = serviceProvider.GetService() ?? new EmptyMessageToLogTemplateMapper();
- }
+ private readonly IEventHandler _handler = handler;
+ private readonly ILogger> _logger = logger;
+ private readonly IMessageToLogTemplateMapper _mapper = serviceProvider.GetService() ?? new EmptyMessageToLogTemplateMapper();
public async Task HandleAsync(TEvent @event, CancellationToken cancellationToken = default)
{
@@ -39,14 +32,14 @@ public async Task HandleAsync(TEvent @event, CancellationToken cancellationToken
}
catch (Exception ex)
{
- var exceptionTemplate = template.GetExceptionTemplate(ex);
+ string? exceptionTemplate = template.GetExceptionTemplate(ex);
Log(@event, exceptionTemplate, isError: true);
throw;
}
}
- private void Log(TEvent @event, string message, bool isError = false)
+ private void Log(TEvent @event, string? message, bool isError = false)
{
if (string.IsNullOrEmpty(message))
{
@@ -64,10 +57,11 @@ private void Log(TEvent @event, string message, bool isError = false)
}
///
- /// Null Message to log template
+ /// Null Message to log template.
///
private class EmptyMessageToLogTemplateMapper : IMessageToLogTemplateMapper
{
- public HandlerLogTemplate? Map(TMessage message) where TMessage : class => null;
+ public HandlerLogTemplate? Map(TMessage message)
+ where TMessage : class => null;
}
}
\ No newline at end of file
diff --git a/src/Genocs.Logging/CQRS/Extensions.cs b/src/Genocs.Logging/CQRS/Extensions.cs
index 05eed6e0..ff78a0fb 100644
--- a/src/Genocs.Logging/CQRS/Extensions.cs
+++ b/src/Genocs.Logging/CQRS/Extensions.cs
@@ -28,12 +28,12 @@ private static IGenocsBuilder AddHandlerLogging(this IGenocsBuilder builder, Typ
handlers.ForEach(ch => GetExtensionMethods()
.FirstOrDefault(mi => !mi.IsGenericMethod && mi.Name == "TryDecorate")?
- .Invoke(builder.Services, new object[]
- {
+ .Invoke(builder.Services,
+ [
builder.Services,
ch.GetInterfaces().FirstOrDefault(),
decoratorType.MakeGenericType(ch.GetInterfaces().FirstOrDefault()?.GenericTypeArguments.First())
- }));
+ ]));
return builder;
}
@@ -48,6 +48,7 @@ from method in type.GetMethods(BindingFlags.Static | BindingFlags.Public | Bindi
where method.IsDefined(typeof(ExtensionAttribute), false)
where method.GetParameters()[0].ParameterType == typeof(IServiceCollection)
select method;
+
return query;
}
}
\ No newline at end of file
diff --git a/src/Genocs.Logging/Extensions.cs b/src/Genocs.Logging/Extensions.cs
index 34a1b8ee..ee9e8558 100644
--- a/src/Genocs.Logging/Extensions.cs
+++ b/src/Genocs.Logging/Extensions.cs
@@ -49,9 +49,7 @@ public static IHostBuilder UseLogging(
configure?.Invoke(context, loggerConfiguration);
});
- public static IEndpointConventionBuilder MapLogLevelHandler(
- this IEndpointRouteBuilder builder,
- string endpointRoute = "~/logging/level")
+ public static IEndpointConventionBuilder MapLogLevelHandler(this IEndpointRouteBuilder builder, string endpointRoute = "~/logging/level")
=> builder.MapPost(endpointRoute, LevelSwitch);
private static void MapOptions(
diff --git a/src/Genocs.Logging/Genocs.Logging.csproj b/src/Genocs.Logging/Genocs.Logging.csproj
index 94290039..a9afbaae 100644
--- a/src/Genocs.Logging/Genocs.Logging.csproj
+++ b/src/Genocs.Logging/Genocs.Logging.csproj
@@ -10,7 +10,7 @@
true
5.0.0
Nocco Giovanni Emanuele
- aggregate architecture boilerplate ddd ddd-architecture design-patterns domain-driven-design dotnet dotnetcore dotnet-core microservice microservices solid solid-principles
+ architecture boilerplate ddd ddd-architecture design-patterns domain-driven-design dotnet dotnetcore dotnet-core microservice microservices solid solid-principles
README_NUGET.md
Upgraded to NET9.0
True
@@ -22,17 +22,16 @@
-
+
+
-
-
@@ -44,7 +43,7 @@
-
+
diff --git a/src/Genocs.Logging/LoggingService.cs b/src/Genocs.Logging/LoggingService.cs
index bd535b59..ddc11382 100644
--- a/src/Genocs.Logging/LoggingService.cs
+++ b/src/Genocs.Logging/LoggingService.cs
@@ -6,6 +6,4 @@ public void SetLoggingLevel(string logEventLevel)
=> Extensions.LoggingLevelSwitch.MinimumLevel = Extensions.GetLogEventLevel(logEventLevel);
}
-public class LoggingService : ILoggingService
-{
-}
\ No newline at end of file
+public class LoggingService : ILoggingService;
\ No newline at end of file
diff --git a/src/Genocs.Logging/Startup.cs b/src/Genocs.Logging/Startup.cs
index d12034a6..dc435b4c 100644
--- a/src/Genocs.Logging/Startup.cs
+++ b/src/Genocs.Logging/Startup.cs
@@ -19,8 +19,15 @@ public static void EnsureInitialized()
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
- .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
- .MinimumLevel.Override("MassTransit", LogEventLevel.Information)
+ .MinimumLevel.Override("Microsoft", LogEventLevel.Debug)
+ .MinimumLevel.Override("MassTransit", LogEventLevel.Debug)
+ .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Debug)
+ .MinimumLevel.Override("System", LogEventLevel.Debug)
+ .MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Debug)
+ .MinimumLevel.Override("Microsoft.AspNetCore.Hosting", LogEventLevel.Debug)
+ .MinimumLevel.Override("Microsoft.AspNetCore.Routing", LogEventLevel.Debug)
+ .MinimumLevel.Override("Microsoft.AspNetCore.Http", LogEventLevel.Debug)
+ .MinimumLevel.Override("Microsoft.AspNetCore.Mvc", LogEventLevel.Debug)
.Enrich.FromLogContext()
.WriteTo.Console()
.CreateLogger();
diff --git a/src/Genocs.MessageBrokers.Outbox.MongoDB/Genocs.MessageBrokers.Outbox.MongoDB.csproj b/src/Genocs.MessageBrokers.Outbox.MongoDB/Genocs.MessageBrokers.Outbox.MongoDB.csproj
index 3720be9e..4e15c94c 100644
--- a/src/Genocs.MessageBrokers.Outbox.MongoDB/Genocs.MessageBrokers.Outbox.MongoDB.csproj
+++ b/src/Genocs.MessageBrokers.Outbox.MongoDB/Genocs.MessageBrokers.Outbox.MongoDB.csproj
@@ -23,8 +23,8 @@
-
-
+
+
diff --git a/src/Genocs.MessageBrokers.Outbox/Genocs.MessageBrokers.Outbox.csproj b/src/Genocs.MessageBrokers.Outbox/Genocs.MessageBrokers.Outbox.csproj
index 4de5ccb8..5feaf6e3 100644
--- a/src/Genocs.MessageBrokers.Outbox/Genocs.MessageBrokers.Outbox.csproj
+++ b/src/Genocs.MessageBrokers.Outbox/Genocs.MessageBrokers.Outbox.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.MessageBrokers.RabbitMQ/Genocs.MessageBrokers.RabbitMQ.csproj b/src/Genocs.MessageBrokers.RabbitMQ/Genocs.MessageBrokers.RabbitMQ.csproj
index e2b3fe1e..515b3e7a 100644
--- a/src/Genocs.MessageBrokers.RabbitMQ/Genocs.MessageBrokers.RabbitMQ.csproj
+++ b/src/Genocs.MessageBrokers.RabbitMQ/Genocs.MessageBrokers.RabbitMQ.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.MessageBrokers/Genocs.MessageBrokers.csproj b/src/Genocs.MessageBrokers/Genocs.MessageBrokers.csproj
index fc874807..38bc5ae2 100644
--- a/src/Genocs.MessageBrokers/Genocs.MessageBrokers.csproj
+++ b/src/Genocs.MessageBrokers/Genocs.MessageBrokers.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.Metrics/Genocs.Metrics.csproj b/src/Genocs.Metrics/Genocs.Metrics.csproj
index 8422e7ae..ec461269 100644
--- a/src/Genocs.Metrics/Genocs.Metrics.csproj
+++ b/src/Genocs.Metrics/Genocs.Metrics.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.Monitoring/Genocs.Monitoring.csproj b/src/Genocs.Monitoring/Genocs.Monitoring.csproj
index d20f92a3..3e84c837 100644
--- a/src/Genocs.Monitoring/Genocs.Monitoring.csproj
+++ b/src/Genocs.Monitoring/Genocs.Monitoring.csproj
@@ -40,9 +40,9 @@
-
-
-
+
+
+
diff --git a/src/Genocs.OpenTelemetry/Configurations/AzureOptions.cs b/src/Genocs.OpenTelemetry/Configurations/AzureOptions.cs
index f54652d1..8b3dcbcb 100644
--- a/src/Genocs.OpenTelemetry/Configurations/AzureOptions.cs
+++ b/src/Genocs.OpenTelemetry/Configurations/AzureOptions.cs
@@ -1,7 +1,7 @@
namespace Genocs.GnxOpenTelemetry.Configurations;
///
-/// ConsoleOptions Settings.
+/// Azure configuration Settings.
///
public class AzureOptions
{
diff --git a/src/Genocs.OpenTelemetry/Configurations/ConsoleOptions.cs b/src/Genocs.OpenTelemetry/Configurations/ConsoleOptions.cs
index b20a9aae..92cfb8cd 100644
--- a/src/Genocs.OpenTelemetry/Configurations/ConsoleOptions.cs
+++ b/src/Genocs.OpenTelemetry/Configurations/ConsoleOptions.cs
@@ -1,7 +1,7 @@
namespace Genocs.GnxOpenTelemetry.Configurations;
///
-/// ConsoleOptions Settings.
+/// Console Section Settings.
///
public class ConsoleOptions
{
diff --git a/src/Genocs.OpenTelemetry/Extensions.cs b/src/Genocs.OpenTelemetry/Extensions.cs
index 81f4ca5a..32b99a1b 100644
--- a/src/Genocs.OpenTelemetry/Extensions.cs
+++ b/src/Genocs.OpenTelemetry/Extensions.cs
@@ -15,8 +15,7 @@ namespace Genocs.GnxOpenTelemetry;
public static class OpenTelemetryExtensions
{
- public static IGenocsBuilder AddOpenTelemetry(
- this IGenocsBuilder builder)
+ public static IGenocsBuilder AddOpenTelemetry(this IGenocsBuilder builder)
{
AppOptions appOptions = builder.GetOptions(AppOptions.Position)
?? throw new GenocsException.InvalidConfigurationException("app config section is missing. AddOpenTelemetry requires those configuration.");
diff --git a/src/Genocs.OpenTelemetry/Genocs.OpenTelemetry.csproj b/src/Genocs.OpenTelemetry/Genocs.OpenTelemetry.csproj
index e5bf8fd6..fb1287a4 100644
--- a/src/Genocs.OpenTelemetry/Genocs.OpenTelemetry.csproj
+++ b/src/Genocs.OpenTelemetry/Genocs.OpenTelemetry.csproj
@@ -19,27 +19,20 @@
-
-
-
-
-
-
-
+
-
-
+
-
+
diff --git a/src/Genocs.Persistence.MongoDb.UnitTests/Genocs.Persistence.MongoDB.UnitTests.csproj b/src/Genocs.Persistence.MongoDb.UnitTests/Genocs.Persistence.MongoDB.UnitTests.csproj
index b9f15c88..3f91b258 100644
--- a/src/Genocs.Persistence.MongoDb.UnitTests/Genocs.Persistence.MongoDB.UnitTests.csproj
+++ b/src/Genocs.Persistence.MongoDb.UnitTests/Genocs.Persistence.MongoDB.UnitTests.csproj
@@ -24,7 +24,7 @@
-
+
diff --git a/src/Genocs.Persistence.MongoDb/Genocs.Persistence.MongoDb.csproj b/src/Genocs.Persistence.MongoDb/Genocs.Persistence.MongoDb.csproj
index 21194d2f..ccde14b7 100644
--- a/src/Genocs.Persistence.MongoDb/Genocs.Persistence.MongoDb.csproj
+++ b/src/Genocs.Persistence.MongoDb/Genocs.Persistence.MongoDb.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.Persistence.Redis/Genocs.Persistence.Redis.csproj b/src/Genocs.Persistence.Redis/Genocs.Persistence.Redis.csproj
index f45b3e31..65bc940c 100644
--- a/src/Genocs.Persistence.Redis/Genocs.Persistence.Redis.csproj
+++ b/src/Genocs.Persistence.Redis/Genocs.Persistence.Redis.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.QueryBuilder.UnitTests/Genocs.QueryBuilder.UnitTests.csproj b/src/Genocs.QueryBuilder.UnitTests/Genocs.QueryBuilder.UnitTests.csproj
index 1eef8226..faff4f15 100644
--- a/src/Genocs.QueryBuilder.UnitTests/Genocs.QueryBuilder.UnitTests.csproj
+++ b/src/Genocs.QueryBuilder.UnitTests/Genocs.QueryBuilder.UnitTests.csproj
@@ -31,8 +31,8 @@
-
-
+
+
diff --git a/src/Genocs.Secrets.AzureKeyVault/Genocs.Secrets.AzureKeyVault.csproj b/src/Genocs.Secrets.AzureKeyVault/Genocs.Secrets.AzureKeyVault.csproj
index 0cbc50fc..3387f1d0 100644
--- a/src/Genocs.Secrets.AzureKeyVault/Genocs.Secrets.AzureKeyVault.csproj
+++ b/src/Genocs.Secrets.AzureKeyVault/Genocs.Secrets.AzureKeyVault.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.Secrets.Vault/Genocs.Secrets.Vault.csproj b/src/Genocs.Secrets.Vault/Genocs.Secrets.Vault.csproj
index 108e258c..8e651515 100644
--- a/src/Genocs.Secrets.Vault/Genocs.Secrets.Vault.csproj
+++ b/src/Genocs.Secrets.Vault/Genocs.Secrets.Vault.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.Security/Genocs.Security.csproj b/src/Genocs.Security/Genocs.Security.csproj
index 3495f00b..935df786 100644
--- a/src/Genocs.Security/Genocs.Security.csproj
+++ b/src/Genocs.Security/Genocs.Security.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.ServiceBusAzure/Genocs.ServiceBusAzure.csproj b/src/Genocs.ServiceBusAzure/Genocs.ServiceBusAzure.csproj
index 780969f4..e90bc4c0 100644
--- a/src/Genocs.ServiceBusAzure/Genocs.ServiceBusAzure.csproj
+++ b/src/Genocs.ServiceBusAzure/Genocs.ServiceBusAzure.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.Tracing.Jaeger.RabbitMQ/Genocs.Tracing.Jaeger.RabbitMQ.csproj b/src/Genocs.Tracing.Jaeger.RabbitMQ/Genocs.Tracing.Jaeger.RabbitMQ.csproj
index b9cdd996..fe642205 100644
--- a/src/Genocs.Tracing.Jaeger.RabbitMQ/Genocs.Tracing.Jaeger.RabbitMQ.csproj
+++ b/src/Genocs.Tracing.Jaeger.RabbitMQ/Genocs.Tracing.Jaeger.RabbitMQ.csproj
@@ -23,8 +23,8 @@
-
-
+
+
diff --git a/src/Genocs.Tracing/Genocs.Tracing.csproj b/src/Genocs.Tracing/Genocs.Tracing.csproj
index 8ed366ca..d479fc3d 100644
--- a/src/Genocs.Tracing/Genocs.Tracing.csproj
+++ b/src/Genocs.Tracing/Genocs.Tracing.csproj
@@ -18,15 +18,13 @@
-
-
-
-
+
+
@@ -34,9 +32,9 @@
-
+
-
+
diff --git a/src/Genocs.WebApi.CQRS/Genocs.WebApi.CQRS.csproj b/src/Genocs.WebApi.CQRS/Genocs.WebApi.CQRS.csproj
index 8889331e..b00ac8e2 100644
--- a/src/Genocs.WebApi.CQRS/Genocs.WebApi.CQRS.csproj
+++ b/src/Genocs.WebApi.CQRS/Genocs.WebApi.CQRS.csproj
@@ -18,13 +18,11 @@
-
-
-
+
diff --git a/src/Genocs.WebApi.Security/Genocs.WebApi.Security.csproj b/src/Genocs.WebApi.Security/Genocs.WebApi.Security.csproj
index 6811de61..6b7566b2 100644
--- a/src/Genocs.WebApi.Security/Genocs.WebApi.Security.csproj
+++ b/src/Genocs.WebApi.Security/Genocs.WebApi.Security.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.WebApi.Swagger/Genocs.WebApi.Swagger.csproj b/src/Genocs.WebApi.Swagger/Genocs.WebApi.Swagger.csproj
index cad19449..ee9bcbd0 100644
--- a/src/Genocs.WebApi.Swagger/Genocs.WebApi.Swagger.csproj
+++ b/src/Genocs.WebApi.Swagger/Genocs.WebApi.Swagger.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Genocs.WebApi/Genocs.WebApi.csproj b/src/Genocs.WebApi/Genocs.WebApi.csproj
index e69f7aab..693ac148 100644
--- a/src/Genocs.WebApi/Genocs.WebApi.csproj
+++ b/src/Genocs.WebApi/Genocs.WebApi.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Genocs.APIGateway.csproj b/src/apps/api-gateway/APIGateway.WebApi/APIGateway.WebApi.csproj
similarity index 75%
rename from src/apps/api-gateway/Genocs.APIGateway/Genocs.APIGateway.csproj
rename to src/apps/api-gateway/APIGateway.WebApi/APIGateway.WebApi.csproj
index e8833e8c..7b56d0da 100644
--- a/src/apps/api-gateway/Genocs.APIGateway/Genocs.APIGateway.csproj
+++ b/src/apps/api-gateway/APIGateway.WebApi/APIGateway.WebApi.csproj
@@ -2,16 +2,17 @@
net9.0
- false
+ Genocs.APIGateway
+ Genocs.APIGateway
+ Genocs.APIGateway
false
-
-
+
@@ -19,15 +20,14 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Configurations/MessagingOptions.cs b/src/apps/api-gateway/APIGateway.WebApi/Configurations/MessagingOptions.cs
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/Configurations/MessagingOptions.cs
rename to src/apps/api-gateway/APIGateway.WebApi/Configurations/MessagingOptions.cs
diff --git a/src/apps/api-gateway/APIGateway.WebApi/Configurations/MongoDbOptions.cs b/src/apps/api-gateway/APIGateway.WebApi/Configurations/MongoDbOptions.cs
new file mode 100644
index 00000000..cb9f63bb
--- /dev/null
+++ b/src/apps/api-gateway/APIGateway.WebApi/Configurations/MongoDbOptions.cs
@@ -0,0 +1,13 @@
+namespace Genocs.APIGateway.Configurations;
+
+public class MongoDbOptions
+{
+ ///
+ /// Default section name.
+ ///
+ public const string Position = "yarp_mongodb";
+
+ public string RoutesCollection { get; set; } = "yarp_routes";
+
+ public string? ClustersCollection { get; set; } = "yarp_clusters";
+}
\ No newline at end of file
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Framework/CorrelationContext.cs b/src/apps/api-gateway/APIGateway.WebApi/Framework/CorrelationContext.cs
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/Framework/CorrelationContext.cs
rename to src/apps/api-gateway/APIGateway.WebApi/Framework/CorrelationContext.cs
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Framework/CorrelationContextBuilder.cs b/src/apps/api-gateway/APIGateway.WebApi/Framework/CorrelationContextBuilder.cs
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/Framework/CorrelationContextBuilder.cs
rename to src/apps/api-gateway/APIGateway.WebApi/Framework/CorrelationContextBuilder.cs
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Framework/CorrelationIdFactory.cs b/src/apps/api-gateway/APIGateway.WebApi/Framework/CorrelationIdFactory.cs
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/Framework/CorrelationIdFactory.cs
rename to src/apps/api-gateway/APIGateway.WebApi/Framework/CorrelationIdFactory.cs
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Framework/CustomForwarderHttpClientFactory.cs b/src/apps/api-gateway/APIGateway.WebApi/Framework/CustomForwarderHttpClientFactory.cs
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/Framework/CustomForwarderHttpClientFactory.cs
rename to src/apps/api-gateway/APIGateway.WebApi/Framework/CustomForwarderHttpClientFactory.cs
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Framework/ICorrelationContextBuilder.cs b/src/apps/api-gateway/APIGateway.WebApi/Framework/ICorrelationContextBuilder.cs
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/Framework/ICorrelationContextBuilder.cs
rename to src/apps/api-gateway/APIGateway.WebApi/Framework/ICorrelationContextBuilder.cs
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Framework/LogContextMiddleware.cs b/src/apps/api-gateway/APIGateway.WebApi/Framework/LogContextMiddleware.cs
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/Framework/LogContextMiddleware.cs
rename to src/apps/api-gateway/APIGateway.WebApi/Framework/LogContextMiddleware.cs
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Framework/MessagingMiddleware.cs b/src/apps/api-gateway/APIGateway.WebApi/Framework/MessagingMiddleware.cs
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/Framework/MessagingMiddleware.cs
rename to src/apps/api-gateway/APIGateway.WebApi/Framework/MessagingMiddleware.cs
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Framework/RouteMatcher.cs b/src/apps/api-gateway/APIGateway.WebApi/Framework/RouteMatcher.cs
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/Framework/RouteMatcher.cs
rename to src/apps/api-gateway/APIGateway.WebApi/Framework/RouteMatcher.cs
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Framework/UserMiddleware.cs b/src/apps/api-gateway/APIGateway.WebApi/Framework/UserMiddleware.cs
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/Framework/UserMiddleware.cs
rename to src/apps/api-gateway/APIGateway.WebApi/Framework/UserMiddleware.cs
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Program.cs b/src/apps/api-gateway/APIGateway.WebApi/Program.cs
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/Program.cs
rename to src/apps/api-gateway/APIGateway.WebApi/Program.cs
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Properties/launchSettings.json b/src/apps/api-gateway/APIGateway.WebApi/Properties/launchSettings.json
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/Properties/launchSettings.json
rename to src/apps/api-gateway/APIGateway.WebApi/Properties/launchSettings.json
diff --git a/src/apps/api-gateway/APIGateway.WebApi/Providers/IMongodbConfigProvider.cs b/src/apps/api-gateway/APIGateway.WebApi/Providers/IMongodbConfigProvider.cs
new file mode 100644
index 00000000..c41cb5f1
--- /dev/null
+++ b/src/apps/api-gateway/APIGateway.WebApi/Providers/IMongodbConfigProvider.cs
@@ -0,0 +1,5 @@
+using Yarp.ReverseProxy.Configuration;
+
+namespace Genocs.APIGateway.Providers;
+
+public interface IMongodbConfigProvider : IProxyConfigProvider;
diff --git a/src/apps/api-gateway/APIGateway.WebApi/Providers/MongoDbConfigProviderExtensions.cs b/src/apps/api-gateway/APIGateway.WebApi/Providers/MongoDbConfigProviderExtensions.cs
new file mode 100644
index 00000000..8c0f079c
--- /dev/null
+++ b/src/apps/api-gateway/APIGateway.WebApi/Providers/MongoDbConfigProviderExtensions.cs
@@ -0,0 +1,26 @@
+using Genocs.APIGateway.Configurations;
+using Genocs.Persistence.MongoDb;
+using Yarp.ReverseProxy.Configuration;
+
+namespace Genocs.APIGateway.Providers;
+
+public static class MongoDbConfigProviderExtensions
+{
+ ///
+ /// Adds an InMemoryConfigProvider.
+ ///
+ ///
+ public static IReverseProxyBuilder LoadFromDatabase(this IReverseProxyBuilder builder, IConfiguration configuration)
+ {
+ IConfiguration config = configuration ?? throw new ArgumentNullException("config");
+
+ MongoDbOptions options = new MongoDbOptions();
+
+ config.Bind(MongoDbOptions.Position, options);
+
+ builder.Services.AddSingleton((Func)((IServiceProvider sp)
+ => new MongodbConfigProvider(sp.GetRequiredService>(), sp.GetRequiredService(), options)));
+
+ return builder;
+ }
+}
\ No newline at end of file
diff --git a/src/apps/api-gateway/APIGateway.WebApi/Providers/MongodbConfigProvider.cs b/src/apps/api-gateway/APIGateway.WebApi/Providers/MongodbConfigProvider.cs
new file mode 100644
index 00000000..304bc556
--- /dev/null
+++ b/src/apps/api-gateway/APIGateway.WebApi/Providers/MongodbConfigProvider.cs
@@ -0,0 +1,121 @@
+using Genocs.APIGateway.Configurations;
+using Genocs.Persistence.MongoDb;
+using Microsoft.Extensions.Primitives;
+using MongoDB.Driver;
+using Yarp.ReverseProxy.Configuration;
+
+namespace Genocs.APIGateway.Providers;
+
+///
+/// Provides an implementation of IProxyConfigProvider to support config read from MongoDB.
+///
+public class MongodbConfigProvider : IMongodbConfigProvider
+{
+ // Marked as volatile so that updates are atomic
+ private InMemoryConfig _config;
+
+ private IMongoDatabaseProvider _mongoDbDatabase;
+
+ ///
+ /// Creates a new instance.
+ ///
+ public MongodbConfigProvider(ILogger logger, IMongoDatabaseProvider mongoDbDatabase, MongoDbOptions options)
+ {
+ _mongoDbDatabase = mongoDbDatabase;
+ var routes = _mongoDbDatabase.Database.GetCollection(options.RoutesCollection).Find(c => true).ToList();
+ var clusters = _mongoDbDatabase.Database.GetCollection(options.ClustersCollection).Find(c => true).ToList();
+ _config = new InMemoryConfig(routes, clusters, Guid.NewGuid().ToString());
+ }
+
+ ///
+ /// Creates a new instance.
+ ///
+ public MongodbConfigProvider(IReadOnlyList routes, IReadOnlyList clusters)
+ : this(routes, clusters, Guid.NewGuid().ToString())
+ {
+ }
+
+ ///
+ /// Creates a new instance, specifying a revision id of the configuration.
+ ///
+ public MongodbConfigProvider(IReadOnlyList routes, IReadOnlyList clusters, string revisionId)
+ {
+ _config = new InMemoryConfig(routes, clusters, revisionId);
+ }
+
+ ///
+ /// Swaps the config state with a new snapshot of the configuration, then signals that the old one is outdated.
+ ///
+ public void Update(IReadOnlyList routes, IReadOnlyList clusters)
+ {
+ var newConfig = new InMemoryConfig(routes, clusters);
+ UpdateInternal(newConfig);
+ }
+
+ ///
+ /// Swaps the config state with a new snapshot of the configuration, then signals that the old one is outdated.
+ ///
+ public void Update(IReadOnlyList routes, IReadOnlyList clusters, string revisionId)
+ {
+ var newConfig = new InMemoryConfig(routes, clusters, revisionId);
+ UpdateInternal(newConfig);
+ }
+
+ private void UpdateInternal(InMemoryConfig newConfig)
+ {
+ var oldConfig = Interlocked.Exchange(ref _config, newConfig);
+ oldConfig.SignalChange();
+ }
+
+ ///
+ /// Implementation of the IProxyConfigProvider.GetConfig method to supply the current snapshot of configuration.
+ ///
+ /// An immutable snapshot of the current configuration state.
+ public IProxyConfig GetConfig()
+ => _config;
+
+ ///
+ /// Implementation of IProxyConfig which is a snapshot of the current config state. The data for this class should be immutable.
+ ///
+ private class InMemoryConfig : IProxyConfig
+ {
+ // Used to implement the change token for the state
+ private readonly CancellationTokenSource _cts = new CancellationTokenSource();
+
+ public InMemoryConfig(IReadOnlyList routes, IReadOnlyList clusters)
+ : this(routes, clusters, Guid.NewGuid().ToString())
+ {
+ }
+
+ public InMemoryConfig(IReadOnlyList routes, IReadOnlyList clusters, string revisionId)
+ {
+ RevisionId = revisionId ?? throw new ArgumentNullException(nameof(revisionId));
+ Routes = routes;
+ Clusters = clusters;
+ ChangeToken = new CancellationChangeToken(_cts.Token);
+ }
+
+ ///
+ public string RevisionId { get; }
+
+ ///
+ /// A snapshot of the list of routes for the proxy.
+ ///
+ public IReadOnlyList Routes { get; }
+
+ ///
+ /// A snapshot of the list of Clusters which are collections of interchangeable destination endpoints.
+ ///
+ public IReadOnlyList Clusters { get; }
+
+ ///
+ /// Fired to indicate the proxy state has changed, and that this snapshot is now stale.
+ ///
+ public IChangeToken ChangeToken { get; }
+
+ internal void SignalChange()
+ {
+ _cts.Cancel();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/apps/api-gateway/Genocs.APIGateway/Startup.cs b/src/apps/api-gateway/APIGateway.WebApi/Startup.cs
similarity index 88%
rename from src/apps/api-gateway/Genocs.APIGateway/Startup.cs
rename to src/apps/api-gateway/APIGateway.WebApi/Startup.cs
index 8a8d006b..f41f3643 100644
--- a/src/apps/api-gateway/Genocs.APIGateway/Startup.cs
+++ b/src/apps/api-gateway/APIGateway.WebApi/Startup.cs
@@ -1,5 +1,6 @@
using Genocs.APIGateway.Configurations;
using Genocs.APIGateway.Framework;
+using Genocs.APIGateway.Providers;
using Genocs.Auth;
using Genocs.Core.Builders;
using Genocs.MessageBrokers.RabbitMQ;
@@ -7,6 +8,7 @@
using Genocs.Security;
using Genocs.Tracing;
using Genocs.WebApi;
+using Genocs.Persistence.MongoDb.Extensions;
using Yarp.ReverseProxy.Forwarder;
namespace Genocs.APIGateway;
@@ -31,13 +33,14 @@ private async Task ConfigureServicesAsync(IServiceCollection services)
services.AddSingleton();
services.AddSingleton();
services.Configure(Configuration.GetSection(MessagingOptions.Position));
- services.AddReverseProxy()
- .LoadFromConfig(Configuration.GetSection("ReverseProxy"));
+
services.AddSingleton();
IGenocsBuilder builder = services
- .AddGenocs()
+ .AddGenocs(Configuration)
.AddOpenTelemetry()
+ .AddMongo()
+ .AddMongoFast()
.AddJwt()
.AddPrometheus();
@@ -47,6 +50,10 @@ private async Task ConfigureServicesAsync(IServiceCollection services)
.AddWebApi()
.Build();
+ services.AddReverseProxy()
+ .LoadFromConfig(Configuration.GetSection("ReverseProxy"));
+ //.LoadFromDatabase(Configuration);
+
//services.AddAuthorization(options =>
//{
// options.AddPolicy("authenticatedUser", policy =>
diff --git a/src/apps/api-gateway/Genocs.APIGateway/appsettings.json b/src/apps/api-gateway/APIGateway.WebApi/appsettings.json
similarity index 98%
rename from src/apps/api-gateway/Genocs.APIGateway/appsettings.json
rename to src/apps/api-gateway/APIGateway.WebApi/appsettings.json
index 7a83b97f..8ed0c15e 100644
--- a/src/apps/api-gateway/Genocs.APIGateway/appsettings.json
+++ b/src/apps/api-gateway/APIGateway.WebApi/appsettings.json
@@ -8,7 +8,7 @@
"displayVersion": true
},
"consul": {
- "enabled": true,
+ "enabled": false,
"url": "http://localhost:8500",
"service": "api-gateway",
"address": "docker.for.mac.localhost",
@@ -20,7 +20,7 @@
"requestRetries": 3
},
"fabio": {
- "enabled": true,
+ "enabled": false,
"url": "http://localhost:9999",
"service": "api-gateway",
"requestRetries": 3
@@ -75,7 +75,7 @@
"interval": "day"
},
"seq": {
- "enabled": true,
+ "enabled": false,
"url": "http://localhost:5341",
"apiKey": "secret"
},
@@ -269,6 +269,10 @@
"allowedHosts": [ "localhost", "identity" ]
}
},
+ "yarp_mongodb": {
+ "routesCollection": "yarp_routes",
+ "clustersCollection": "yarp_clusters"
+ },
"reverseProxy": {
"routes": {
"identity-route": {
diff --git a/src/apps/api-gateway/Genocs.APIGateway/certs/localhost.cer b/src/apps/api-gateway/APIGateway.WebApi/certs/localhost.cer
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/certs/localhost.cer
rename to src/apps/api-gateway/APIGateway.WebApi/certs/localhost.cer
diff --git a/src/apps/api-gateway/Genocs.APIGateway/certs/localhost.key b/src/apps/api-gateway/APIGateway.WebApi/certs/localhost.key
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/certs/localhost.key
rename to src/apps/api-gateway/APIGateway.WebApi/certs/localhost.key
diff --git a/src/apps/api-gateway/Genocs.APIGateway/certs/localhost.pem b/src/apps/api-gateway/APIGateway.WebApi/certs/localhost.pem
similarity index 100%
rename from src/apps/api-gateway/Genocs.APIGateway/certs/localhost.pem
rename to src/apps/api-gateway/APIGateway.WebApi/certs/localhost.pem
diff --git a/src/apps/api-gateway/Genocs.APIGateway/README_NUGET.md b/src/apps/api-gateway/Genocs.APIGateway/README_NUGET.md
deleted file mode 100644
index a5eaef64..00000000
--- a/src/apps/api-gateway/Genocs.APIGateway/README_NUGET.md
+++ /dev/null
@@ -1,55 +0,0 @@
-# .NET Core API Gateway web api
-
-This package contains a set of functionalities to use http client for microservice, the library is designed by Genocs even thought a lot of insight came from community.
-First of all I have to say thanks to devmentors
-
-The libraries are built using .NET7.
-
-
-## Description
-
-Core NuGet package contains Open Telemetry and logging useful for DDD service.
-
-
-## Support
-
-Please check the GitHub repository getting more info.
-
-
-### DataProvider Settings
-Following are the project settings needed to enable monitoring
-
-``` json
- "AppSettings": {
- "ServiceName": "Demo WebApi",
- },
- "ConnectionStrings": {
- "ApplicationInsights": ""
- },
- "Monitoring": {
- "Jaeger": "localhost",
- }
-```
-
-## Release notes
-
-### [2023-03-04] 2.0.1
-- Updated nuget packages
-
-### [2023-03-04] 2.0.0
-- Revisited
-
-### [2023-02-06] 1.0.0-rc4.0
-- Updated Masstransit
-
-### [2023-01-01] 1.0.0-rc3.1
-- Updated Masstransit
-
-### [2023-01-01] 1.0.0-rc3.0
-- Moved to netstandart
-
-### [2023-01-01] 1.0.0-rc2.0
-- Refactory and standardization
-
-
-
diff --git a/src/apps/api-gateway/Genocs.APIGateway/appsettings.Docker.json b/src/apps/api-gateway/Genocs.APIGateway/appsettings.Docker.json
deleted file mode 100644
index 258ab8cd..00000000
--- a/src/apps/api-gateway/Genocs.APIGateway/appsettings.Docker.json
+++ /dev/null
@@ -1,83 +0,0 @@
-{
- "consul": {
- "enabled": true,
- "url": "http://consul:8500",
- "service": "api-gateway",
- "address": "api-gateway",
- "port": "80"
- },
- "fabio": {
- "enabled": true,
- "url": "http://localhost:9999",
- "service": "api-gateway"
- },
- "logger": {
- "seq": {
- "enabled": true,
- "url": "http://seq:5341"
- }
- },
- "monitoring": {
- "jaeger": "jaeger"
- },
- "jaeger": {
- "enabled": true,
- "serviceName": "orders",
- "endpoint": "http://localhost:4317",
- "protocol": "Grpc",
- "processorType": "Batch",
- "maxQueueSize": 2048,
- "scheduledDelayMilliseconds": 5000,
- "exporterTimeoutMilliseconds": 30000,
- "maxExportBatchSize": 512
- },
- "metrics": {
- "enabled": true,
- "influxEnabled": true,
- "prometheusEnabled": true,
- "influxUrl": "http://influxdb:8086",
- "env": "docker"
- },
- "prometheus": {
- "enabled": true
- },
- "mongodb": {
- "connectionString": "mongodb://mongodb:27017",
- "enableTracing": true
- },
- "redis": {
- "connectionString": "redis"
- },
- "reverseProxy": {
- "clusters": {
- "identity-cluster": {
- "destinations": {
- "destination1": {
- "address": "http://identity-service"
- }
- }
- },
- "products-cluster": {
- "destinations": {
- "destination1": {
- "address": "http://products-service"
- }
- }
- },
- "orders-cluster": {
- "destinations": {
- "destination1": {
- "address": "http://orders-service"
- }
- }
- },
- "signalr-cluster": {
- "destinations": {
- "destination1": {
- "address": "http://signalr-service"
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/apps/api-gateway/Genocs.APIGateway/certs/localhost.pfx b/src/apps/api-gateway/Genocs.APIGateway/certs/localhost.pfx
deleted file mode 100644
index 8e1885b6..00000000
Binary files a/src/apps/api-gateway/Genocs.APIGateway/certs/localhost.pfx and /dev/null differ
diff --git a/src/apps/apigateway.dockerfile b/src/apps/apigateway.dockerfile
index bc8ad175..47fd8490 100644
--- a/src/apps/apigateway.dockerfile
+++ b/src/apps/apigateway.dockerfile
@@ -2,23 +2,24 @@
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app
-EXPOSE 80
-EXPOSE 443
+EXPOSE 8080
+EXPOSE 8081
+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env
WORKDIR /src
+COPY ["Directory.Build.props", "."]
+COPY ["Directory.Build.targets", "."]
+COPY ["NuGet.config", "."]
+COPY ["dotnet.ruleset", "."]
+COPY ["stylecop.json", "."]
+
COPY ["api-gateway/Genocs.APIGateway", "Genocs.APIGateway/"]
-COPY ["Directory.Build.props", "Directory.Build.props"]
-COPY ["Directory.Build.targets", "Directory.Build.targets"]
-COPY ["NuGet.config", "NuGet.config"]
-COPY ["dotnet.ruleset", "dotnet.ruleset"]
-COPY ["stylecop.json", "stylecop.json"]
WORKDIR "/src/Genocs.APIGateway"
RUN dotnet build "Genocs.APIGateway.csproj" -c Release -o /app/build
-
FROM build-env AS publish
RUN dotnet publish "Genocs.APIGateway.csproj" -c Release -o /app/publish
diff --git a/src/apps/docker-compose.override.yml b/src/apps/docker-compose.override.yml
index d0f46c92..98f33d4b 100644
--- a/src/apps/docker-compose.override.yml
+++ b/src/apps/docker-compose.override.yml
@@ -7,19 +7,19 @@ services:
identity-service:
build:
context: .
- dockerfile: identity-webapi.dockerfile
+ dockerfile: identity.dockerfile
products-service:
build:
context: .
- dockerfile: product-webapi.dockerfile
+ dockerfile: products.dockerfile
orders-service:
build:
context: .
- dockerfile: order-webapi.dockerfile
+ dockerfile: orders.dockerfile
signalr-service:
build:
context: .
- dockerfile: signalr-webapi.dockerfile
+ dockerfile: signalr.dockerfile
diff --git a/src/apps/docker-compose.yml b/src/apps/docker-compose.yml
index 20ee5733..a94d8ee2 100644
--- a/src/apps/docker-compose.yml
+++ b/src/apps/docker-compose.yml
@@ -4,9 +4,20 @@ services:
hostname: api-gateway
container_name: api-gateway
environment:
- - ASPNETCORE_ENVIRONMENT=Docker
+ - ASPNETCORE_ENVIRONMENT=Development
+ - consul__url=http://consul:8500
+ - consul__address=api-gateway
+ - consul__port=8080
+ - fabio__url=http://fabio:9999
+ - jaeger__udpHost=http://jaeger:4317
+ - openTelemetry__otlpEndpoint=http://jaeger:4317
+ - mongodb__connectionString=mongodb://mongodb:27017
+ - reverseProxy__clusters__identity-cluster__destinations__destination1__address=http://identity-service:8080
+ - reverseProxy__clusters__products-cluster__destinations__destination1__address=http://products-service:8080
+ - reverseProxy__clusters__orders-cluster__destinations__destination1__address=http://orders-service:8080
+
ports:
- - 5500:80
+ - 5500:8080
networks:
- genocs
# network_mode: bridge
@@ -18,9 +29,17 @@ services:
hostname: identity-service
container_name: identity-service
environment:
- - ASPNETCORE_ENVIRONMENT=Docker
+ - ASPNETCORE_ENVIRONMENT=Development
+ - consul__url=http://consul:8500
+ - consul__address=identity-service
+ - consul__port=8080
+ - fabio__url=http://fabio:9999
+ - jaeger__udpHost=http://jaeger:4317
+ - openTelemetry__otlpEndpoint=http://jaeger:4317
+ - mongodb__connectionString=mongodb://mongodb:27017
+
ports:
- - 5500:80
+ - 5510:8080
networks:
- genocs
# network_mode: bridge
@@ -32,9 +51,17 @@ services:
hostname: products-service
container_name: products-service
environment:
- - ASPNETCORE_ENVIRONMENT=Docker
+ - ASPNETCORE_ENVIRONMENT=Development
+ - consul__url=http://consul:8500
+ - consul__address=products-service
+ - consul__port=8080
+ - fabio__url=http://fabio:9999
+ - jaeger__udpHost=http://jaeger:4317
+ - openTelemetry__otlpEndpoint=http://jaeger:4317
+ - mongodb__connectionString=mongodb://mongodb:27017
+
ports:
- - 5510:80
+ - 5520:8080
#ports:
networks:
- genocs
@@ -47,9 +74,17 @@ services:
hostname: orders-service
container_name: orders-service
environment:
- - ASPNETCORE_ENVIRONMENT=Docker
+ - ASPNETCORE_ENVIRONMENT=Development
+ - consul__url=http://consul:8500
+ - consul__address=orders-service
+ - consul__port=8080
+ - fabio__url=http://fabio:9999
+ - jaeger__udpHost=http://jaeger:4317
+ - openTelemetry__otlpEndpoint=http://jaeger:4317
+ - mongodb__connectionString=mongodb://mongodb:27017
+
ports:
- - 5530:80
+ - 5530:8080
#ports:
networks:
- genocs
@@ -62,9 +97,16 @@ services:
hostname: signalr-service
container_name: signalr-service
environment:
- - ASPNETCORE_ENVIRONMENT=Docker
+ - ASPNETCORE_ENVIRONMENT=Development
+ - consul__url=http://consul:8500
+ - consul__address=signalr-service
+ - consul__port=8080
+ - fabio__url=http://fabio:9999
+ - jaeger__udpHost=http://jaeger:4317
+ - openTelemetry__otlpEndpoint=http://jaeger:4317
+ - mongodb__connectionString=mongodb://mongodb:27017
ports:
- - 5540:80
+ - 5540:8080
#ports:
networks:
- genocs
diff --git a/src/apps/global.json b/src/apps/global.json
new file mode 100644
index 00000000..6d77f621
--- /dev/null
+++ b/src/apps/global.json
@@ -0,0 +1,7 @@
+{
+ "sdk": {
+ "version": "9.0.0",
+ "rollForward": "latestMajor",
+ "allowPrerelease": true
+ }
+}
diff --git a/src/apps/identity-webapi.dockerfile b/src/apps/identity.dockerfile
similarity index 74%
rename from src/apps/identity-webapi.dockerfile
rename to src/apps/identity.dockerfile
index e7b1b4e9..43621380 100644
--- a/src/apps/identity-webapi.dockerfile
+++ b/src/apps/identity.dockerfile
@@ -2,23 +2,24 @@
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app
-EXPOSE 80
-EXPOSE 443
+EXPOSE 8080
+EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env
WORKDIR /src
+
+COPY ["Directory.Build.props", "."]
+COPY ["Directory.Build.targets", "."]
+COPY ["NuGet.config", "."]
+COPY ["dotnet.ruleset", "."]
+COPY ["stylecop.json", "."]
+
COPY ["identity/Genocs.Identities.WebApi", "Genocs.Identities.WebApi/"]
COPY ["identity/Genocs.Identities.Application", "Genocs.Identities.Application/"]
-COPY ["Directory.Build.props", "Directory.Build.props"]
-COPY ["Directory.Build.targets", "Directory.Build.targets"]
-COPY ["NuGet.config", "NuGet.config"]
-COPY ["dotnet.ruleset", "dotnet.ruleset"]
-COPY ["stylecop.json", "stylecop.json"]
WORKDIR "/src/Genocs.Identities.WebApi"
RUN dotnet build "Genocs.Identities.WebApi.csproj" -c Release -o /app/build
-
FROM build-env AS publish
RUN dotnet publish "Genocs.Identities.WebApi.csproj" -c Release -o /app/publish
diff --git a/src/apps/identity/Genocs.Identities.WebApi/appsettings.Docker.json b/src/apps/identity/Genocs.Identities.WebApi/appsettings.Docker.json
deleted file mode 100644
index 77e1d860..00000000
--- a/src/apps/identity/Genocs.Identities.WebApi/appsettings.Docker.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "consul": {
- "enabled": true,
- "url": "http://consul:8500",
- "service": "identity-service",
- "address": "identity-service",
- "port": "80"
- },
- "fabio": {
- "enabled": true,
- "url": "http://localhost:9999",
- "service": "identity-service"
- },
- "logger": {
- "seq": {
- "enabled": true,
- "url": "http://seq:5341"
- }
- },
- "monitoring": {
- "jaeger": "jaeger"
- },
- "jaeger": {
- "enabled": true,
- "udpHost": "jaeger",
- "serviceName": "identity-service"
- },
- "metrics": {
- "enabled": true,
- "influxEnabled": true,
- "prometheusEnabled": true,
- "influxUrl": "http://influxdb:8086",
- "env": "docker"
- },
- "prometheus": {
- "enabled": true
- },
- "mongodb": {
- "connectionString": "mongodb://mongodb:27017"
- },
- "redis": {
- "connectionString": "redis"
- }
-}
\ No newline at end of file
diff --git a/src/apps/identity/Genocs.Identities.WebApi/certs/localhost.pfx b/src/apps/identity/Genocs.Identities.WebApi/certs/localhost.pfx
deleted file mode 100644
index 8e1885b6..00000000
Binary files a/src/apps/identity/Genocs.Identities.WebApi/certs/localhost.pfx and /dev/null differ
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/CreateAdmin.cs b/src/apps/identity/Identities.Application/Commands/CreateAdmin.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/CreateAdmin.cs
rename to src/apps/identity/Identities.Application/Commands/CreateAdmin.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/CreateUser.cs b/src/apps/identity/Identities.Application/Commands/CreateUser.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/CreateUser.cs
rename to src/apps/identity/Identities.Application/Commands/CreateUser.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/Handlers/CreateAdminHandler.cs b/src/apps/identity/Identities.Application/Commands/Handlers/CreateAdminHandler.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/Handlers/CreateAdminHandler.cs
rename to src/apps/identity/Identities.Application/Commands/Handlers/CreateAdminHandler.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/Handlers/CreateUserHandler.cs b/src/apps/identity/Identities.Application/Commands/Handlers/CreateUserHandler.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/Handlers/CreateUserHandler.cs
rename to src/apps/identity/Identities.Application/Commands/Handlers/CreateUserHandler.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/Handlers/LockUserHandler.cs b/src/apps/identity/Identities.Application/Commands/Handlers/LockUserHandler.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/Handlers/LockUserHandler.cs
rename to src/apps/identity/Identities.Application/Commands/Handlers/LockUserHandler.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/Handlers/RevokeAccessTokenHandler.cs b/src/apps/identity/Identities.Application/Commands/Handlers/RevokeAccessTokenHandler.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/Handlers/RevokeAccessTokenHandler.cs
rename to src/apps/identity/Identities.Application/Commands/Handlers/RevokeAccessTokenHandler.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/Handlers/RevokeRefreshTokenHandler.cs b/src/apps/identity/Identities.Application/Commands/Handlers/RevokeRefreshTokenHandler.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/Handlers/RevokeRefreshTokenHandler.cs
rename to src/apps/identity/Identities.Application/Commands/Handlers/RevokeRefreshTokenHandler.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/Handlers/SignInHandler.cs b/src/apps/identity/Identities.Application/Commands/Handlers/SignInHandler.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/Handlers/SignInHandler.cs
rename to src/apps/identity/Identities.Application/Commands/Handlers/SignInHandler.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/Handlers/UnlockUserHandler.cs b/src/apps/identity/Identities.Application/Commands/Handlers/UnlockUserHandler.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/Handlers/UnlockUserHandler.cs
rename to src/apps/identity/Identities.Application/Commands/Handlers/UnlockUserHandler.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/Handlers/UseRefreshTokenHandler.cs b/src/apps/identity/Identities.Application/Commands/Handlers/UseRefreshTokenHandler.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/Handlers/UseRefreshTokenHandler.cs
rename to src/apps/identity/Identities.Application/Commands/Handlers/UseRefreshTokenHandler.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/LockUser.cs b/src/apps/identity/Identities.Application/Commands/LockUser.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/LockUser.cs
rename to src/apps/identity/Identities.Application/Commands/LockUser.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/RevokeAccessToken.cs b/src/apps/identity/Identities.Application/Commands/RevokeAccessToken.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/RevokeAccessToken.cs
rename to src/apps/identity/Identities.Application/Commands/RevokeAccessToken.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/RevokeRefreshToken.cs b/src/apps/identity/Identities.Application/Commands/RevokeRefreshToken.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/RevokeRefreshToken.cs
rename to src/apps/identity/Identities.Application/Commands/RevokeRefreshToken.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/SignIn.cs b/src/apps/identity/Identities.Application/Commands/SignIn.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/SignIn.cs
rename to src/apps/identity/Identities.Application/Commands/SignIn.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/UnlockUser.cs b/src/apps/identity/Identities.Application/Commands/UnlockUser.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/UnlockUser.cs
rename to src/apps/identity/Identities.Application/Commands/UnlockUser.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Commands/UseRefreshToken.cs b/src/apps/identity/Identities.Application/Commands/UseRefreshToken.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Commands/UseRefreshToken.cs
rename to src/apps/identity/Identities.Application/Commands/UseRefreshToken.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/ContractAttribute.cs b/src/apps/identity/Identities.Application/ContractAttribute.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/ContractAttribute.cs
rename to src/apps/identity/Identities.Application/ContractAttribute.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/CorrelationContext.cs b/src/apps/identity/Identities.Application/CorrelationContext.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/CorrelationContext.cs
rename to src/apps/identity/Identities.Application/CorrelationContext.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/CorrelationIdFactory.cs b/src/apps/identity/Identities.Application/CorrelationIdFactory.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/CorrelationIdFactory.cs
rename to src/apps/identity/Identities.Application/CorrelationIdFactory.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/DTO/AuthDto.cs b/src/apps/identity/Identities.Application/DTO/AuthDto.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/DTO/AuthDto.cs
rename to src/apps/identity/Identities.Application/DTO/AuthDto.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/DTO/PagedDto.cs b/src/apps/identity/Identities.Application/DTO/PagedDto.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/DTO/PagedDto.cs
rename to src/apps/identity/Identities.Application/DTO/PagedDto.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/DTO/UserDetailsDto.cs b/src/apps/identity/Identities.Application/DTO/UserDetailsDto.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/DTO/UserDetailsDto.cs
rename to src/apps/identity/Identities.Application/DTO/UserDetailsDto.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/DTO/UserDto.cs b/src/apps/identity/Identities.Application/DTO/UserDto.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/DTO/UserDto.cs
rename to src/apps/identity/Identities.Application/DTO/UserDto.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Decorators/LoggingCommandHandlerDecorator.cs b/src/apps/identity/Identities.Application/Decorators/LoggingCommandHandlerDecorator.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Decorators/LoggingCommandHandlerDecorator.cs
rename to src/apps/identity/Identities.Application/Decorators/LoggingCommandHandlerDecorator.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Decorators/LoggingEventHandlerDecorator.cs b/src/apps/identity/Identities.Application/Decorators/LoggingEventHandlerDecorator.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Decorators/LoggingEventHandlerDecorator.cs
rename to src/apps/identity/Identities.Application/Decorators/LoggingEventHandlerDecorator.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Decorators/OutboxCommandHandlerDecorator.cs b/src/apps/identity/Identities.Application/Decorators/OutboxCommandHandlerDecorator.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Decorators/OutboxCommandHandlerDecorator.cs
rename to src/apps/identity/Identities.Application/Decorators/OutboxCommandHandlerDecorator.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Decorators/OutboxEventHandlerDecorator.cs b/src/apps/identity/Identities.Application/Decorators/OutboxEventHandlerDecorator.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Decorators/OutboxEventHandlerDecorator.cs
rename to src/apps/identity/Identities.Application/Decorators/OutboxEventHandlerDecorator.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Constants/Policies.cs b/src/apps/identity/Identities.Application/Domain/Constants/Policies.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Constants/Policies.cs
rename to src/apps/identity/Identities.Application/Domain/Constants/Policies.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Constants/Roles.cs b/src/apps/identity/Identities.Application/Domain/Constants/Roles.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Constants/Roles.cs
rename to src/apps/identity/Identities.Application/Domain/Constants/Roles.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Entities/AggregateId.cs b/src/apps/identity/Identities.Application/Domain/Entities/AggregateId.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Entities/AggregateId.cs
rename to src/apps/identity/Identities.Application/Domain/Entities/AggregateId.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Entities/AggregateRoot.cs b/src/apps/identity/Identities.Application/Domain/Entities/AggregateRoot.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Entities/AggregateRoot.cs
rename to src/apps/identity/Identities.Application/Domain/Entities/AggregateRoot.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Entities/RefreshToken.cs b/src/apps/identity/Identities.Application/Domain/Entities/RefreshToken.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Entities/RefreshToken.cs
rename to src/apps/identity/Identities.Application/Domain/Entities/RefreshToken.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Entities/Role.cs b/src/apps/identity/Identities.Application/Domain/Entities/Role.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Entities/Role.cs
rename to src/apps/identity/Identities.Application/Domain/Entities/Role.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Entities/User.cs b/src/apps/identity/Identities.Application/Domain/Entities/User.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Entities/User.cs
rename to src/apps/identity/Identities.Application/Domain/Entities/User.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/DomainException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/DomainException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/DomainException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/DomainException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/EmailInUseException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/EmailInUseException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/EmailInUseException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/EmailInUseException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/EmptyRefreshTokenException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/EmptyRefreshTokenException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/EmptyRefreshTokenException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/EmptyRefreshTokenException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidAggregateIdException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/InvalidAggregateIdException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidAggregateIdException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/InvalidAggregateIdException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidCredentialsException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/InvalidCredentialsException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidCredentialsException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/InvalidCredentialsException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidEmailException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/InvalidEmailException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidEmailException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/InvalidEmailException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidNameException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/InvalidNameException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidNameException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/InvalidNameException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidPasswordException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/InvalidPasswordException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidPasswordException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/InvalidPasswordException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidRefreshTokenException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/InvalidRefreshTokenException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidRefreshTokenException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/InvalidRefreshTokenException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidRoleException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/InvalidRoleException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/InvalidRoleException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/InvalidRoleException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/NameInUseException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/NameInUseException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/NameInUseException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/NameInUseException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/RevokedRefreshTokenException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/RevokedRefreshTokenException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/RevokedRefreshTokenException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/RevokedRefreshTokenException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/UserLockedException.cs b/src/apps/identity/Identities.Application/Domain/Exceptions/UserLockedException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Exceptions/UserLockedException.cs
rename to src/apps/identity/Identities.Application/Domain/Exceptions/UserLockedException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Repositories/IRefreshTokenRepository.cs b/src/apps/identity/Identities.Application/Domain/Repositories/IRefreshTokenRepository.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Repositories/IRefreshTokenRepository.cs
rename to src/apps/identity/Identities.Application/Domain/Repositories/IRefreshTokenRepository.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Domain/Repositories/IUserRepository.cs b/src/apps/identity/Identities.Application/Domain/Repositories/IUserRepository.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Domain/Repositories/IUserRepository.cs
rename to src/apps/identity/Identities.Application/Domain/Repositories/IUserRepository.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Events/SignedIn.cs b/src/apps/identity/Identities.Application/Events/SignedIn.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Events/SignedIn.cs
rename to src/apps/identity/Identities.Application/Events/SignedIn.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Events/UserCreated.cs b/src/apps/identity/Identities.Application/Events/UserCreated.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Events/UserCreated.cs
rename to src/apps/identity/Identities.Application/Events/UserCreated.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Events/UserLocked.cs b/src/apps/identity/Identities.Application/Events/UserLocked.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Events/UserLocked.cs
rename to src/apps/identity/Identities.Application/Events/UserLocked.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Events/UserUnlocked.cs b/src/apps/identity/Identities.Application/Events/UserUnlocked.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Events/UserUnlocked.cs
rename to src/apps/identity/Identities.Application/Events/UserUnlocked.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Exceptions/AppException.cs b/src/apps/identity/Identities.Application/Exceptions/AppException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Exceptions/AppException.cs
rename to src/apps/identity/Identities.Application/Exceptions/AppException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Exceptions/ExceptionToMessageMapper.cs b/src/apps/identity/Identities.Application/Exceptions/ExceptionToMessageMapper.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Exceptions/ExceptionToMessageMapper.cs
rename to src/apps/identity/Identities.Application/Exceptions/ExceptionToMessageMapper.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Exceptions/ExceptionToResponseMapper.cs b/src/apps/identity/Identities.Application/Exceptions/ExceptionToResponseMapper.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Exceptions/ExceptionToResponseMapper.cs
rename to src/apps/identity/Identities.Application/Exceptions/ExceptionToResponseMapper.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Exceptions/Extensions.cs b/src/apps/identity/Identities.Application/Exceptions/Extensions.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Exceptions/Extensions.cs
rename to src/apps/identity/Identities.Application/Exceptions/Extensions.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Exceptions/UserNotFoundException.cs b/src/apps/identity/Identities.Application/Exceptions/UserNotFoundException.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Exceptions/UserNotFoundException.cs
rename to src/apps/identity/Identities.Application/Exceptions/UserNotFoundException.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Extensions.cs b/src/apps/identity/Identities.Application/Extensions.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Extensions.cs
rename to src/apps/identity/Identities.Application/Extensions.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Genocs.Identities.Application.csproj b/src/apps/identity/Identities.Application/Identities.Application.csproj
similarity index 81%
rename from src/apps/identity/Genocs.Identities.Application/Genocs.Identities.Application.csproj
rename to src/apps/identity/Identities.Application/Identities.Application.csproj
index c80f6df4..25b1184d 100644
--- a/src/apps/identity/Genocs.Identities.Application/Genocs.Identities.Application.csproj
+++ b/src/apps/identity/Identities.Application/Identities.Application.csproj
@@ -2,7 +2,9 @@
net9.0
- false
+ Genocs.Identities.Application
+ Genocs.Identities.Application
+ Genocs.Identities.Application
false
@@ -21,17 +23,17 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/apps/identity/Genocs.Identities.Application/Logging/LogContextMiddleware.cs b/src/apps/identity/Identities.Application/Logging/LogContextMiddleware.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Logging/LogContextMiddleware.cs
rename to src/apps/identity/Identities.Application/Logging/LogContextMiddleware.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Mongo/Documents/RefreshTokenDocument.cs b/src/apps/identity/Identities.Application/Mongo/Documents/RefreshTokenDocument.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Mongo/Documents/RefreshTokenDocument.cs
rename to src/apps/identity/Identities.Application/Mongo/Documents/RefreshTokenDocument.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Mongo/Documents/UserDocument.cs b/src/apps/identity/Identities.Application/Mongo/Documents/UserDocument.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Mongo/Documents/UserDocument.cs
rename to src/apps/identity/Identities.Application/Mongo/Documents/UserDocument.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Mongo/Extensions.cs b/src/apps/identity/Identities.Application/Mongo/Extensions.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Mongo/Extensions.cs
rename to src/apps/identity/Identities.Application/Mongo/Extensions.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Mongo/Queries/Handlers/BrowseUsersHandler.cs b/src/apps/identity/Identities.Application/Mongo/Queries/Handlers/BrowseUsersHandler.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Mongo/Queries/Handlers/BrowseUsersHandler.cs
rename to src/apps/identity/Identities.Application/Mongo/Queries/Handlers/BrowseUsersHandler.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Mongo/Queries/Handlers/GetUserHandler.cs b/src/apps/identity/Identities.Application/Mongo/Queries/Handlers/GetUserHandler.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Mongo/Queries/Handlers/GetUserHandler.cs
rename to src/apps/identity/Identities.Application/Mongo/Queries/Handlers/GetUserHandler.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Mongo/Repositories/RefreshTokenRepository.cs b/src/apps/identity/Identities.Application/Mongo/Repositories/RefreshTokenRepository.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Mongo/Repositories/RefreshTokenRepository.cs
rename to src/apps/identity/Identities.Application/Mongo/Repositories/RefreshTokenRepository.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Mongo/Repositories/UserRepository.cs b/src/apps/identity/Identities.Application/Mongo/Repositories/UserRepository.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Mongo/Repositories/UserRepository.cs
rename to src/apps/identity/Identities.Application/Mongo/Repositories/UserRepository.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Queries/BrowseUsers.cs b/src/apps/identity/Identities.Application/Queries/BrowseUsers.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Queries/BrowseUsers.cs
rename to src/apps/identity/Identities.Application/Queries/BrowseUsers.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Queries/GetUser.cs b/src/apps/identity/Identities.Application/Queries/GetUser.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Queries/GetUser.cs
rename to src/apps/identity/Identities.Application/Queries/GetUser.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Services/IJwtProvider.cs b/src/apps/identity/Identities.Application/Services/IJwtProvider.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Services/IJwtProvider.cs
rename to src/apps/identity/Identities.Application/Services/IJwtProvider.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Services/IMessageBroker.cs b/src/apps/identity/Identities.Application/Services/IMessageBroker.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Services/IMessageBroker.cs
rename to src/apps/identity/Identities.Application/Services/IMessageBroker.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Services/IPasswordService.cs b/src/apps/identity/Identities.Application/Services/IPasswordService.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Services/IPasswordService.cs
rename to src/apps/identity/Identities.Application/Services/IPasswordService.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Services/IRng.cs b/src/apps/identity/Identities.Application/Services/IRng.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Services/IRng.cs
rename to src/apps/identity/Identities.Application/Services/IRng.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Services/ITokenStorage.cs b/src/apps/identity/Identities.Application/Services/ITokenStorage.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Services/ITokenStorage.cs
rename to src/apps/identity/Identities.Application/Services/ITokenStorage.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Services/JwtProvider.cs b/src/apps/identity/Identities.Application/Services/JwtProvider.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Services/JwtProvider.cs
rename to src/apps/identity/Identities.Application/Services/JwtProvider.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Services/MessageBroker.cs b/src/apps/identity/Identities.Application/Services/MessageBroker.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Services/MessageBroker.cs
rename to src/apps/identity/Identities.Application/Services/MessageBroker.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Services/PasswordService.cs b/src/apps/identity/Identities.Application/Services/PasswordService.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Services/PasswordService.cs
rename to src/apps/identity/Identities.Application/Services/PasswordService.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Services/Rng.cs b/src/apps/identity/Identities.Application/Services/Rng.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Services/Rng.cs
rename to src/apps/identity/Identities.Application/Services/Rng.cs
diff --git a/src/apps/identity/Genocs.Identities.Application/Services/TokenStorage.cs b/src/apps/identity/Identities.Application/Services/TokenStorage.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.Application/Services/TokenStorage.cs
rename to src/apps/identity/Identities.Application/Services/TokenStorage.cs
diff --git a/src/apps/identity/Genocs.Identities.WebApi/Genocs.Identities.WebApi.csproj b/src/apps/identity/Identities.WebApi/Identities.WebApi.csproj
similarity index 62%
rename from src/apps/identity/Genocs.Identities.WebApi/Genocs.Identities.WebApi.csproj
rename to src/apps/identity/Identities.WebApi/Identities.WebApi.csproj
index 065f72fe..d79a5931 100644
--- a/src/apps/identity/Genocs.Identities.WebApi/Genocs.Identities.WebApi.csproj
+++ b/src/apps/identity/Identities.WebApi/Identities.WebApi.csproj
@@ -2,21 +2,25 @@
net9.0
- false
+ Genocs.Identities.WebApi
+ Genocs.Identities.WebApi
+ Genocs.Identities.WebApi
false
Genocs
+
-
+
+
-
+
diff --git a/src/apps/identity/Genocs.Identities.WebApi/Program.cs b/src/apps/identity/Identities.WebApi/Program.cs
similarity index 100%
rename from src/apps/identity/Genocs.Identities.WebApi/Program.cs
rename to src/apps/identity/Identities.WebApi/Program.cs
diff --git a/src/apps/identity/Genocs.Identities.WebApi/Properties/launchSettings.json b/src/apps/identity/Identities.WebApi/Properties/launchSettings.json
similarity index 100%
rename from src/apps/identity/Genocs.Identities.WebApi/Properties/launchSettings.json
rename to src/apps/identity/Identities.WebApi/Properties/launchSettings.json
diff --git a/src/apps/identity/Genocs.Identities.WebApi/appsettings.json b/src/apps/identity/Identities.WebApi/appsettings.json
similarity index 100%
rename from src/apps/identity/Genocs.Identities.WebApi/appsettings.json
rename to src/apps/identity/Identities.WebApi/appsettings.json
diff --git a/src/apps/identity/Genocs.Identities.WebApi/certs/localhost.cer b/src/apps/identity/Identities.WebApi/certs/localhost.cer
similarity index 100%
rename from src/apps/identity/Genocs.Identities.WebApi/certs/localhost.cer
rename to src/apps/identity/Identities.WebApi/certs/localhost.cer
diff --git a/src/apps/identity/Genocs.Identities.WebApi/certs/localhost.key b/src/apps/identity/Identities.WebApi/certs/localhost.key
similarity index 100%
rename from src/apps/identity/Genocs.Identities.WebApi/certs/localhost.key
rename to src/apps/identity/Identities.WebApi/certs/localhost.key
diff --git a/src/apps/identity/Genocs.Identities.WebApi/certs/localhost.pem b/src/apps/identity/Identities.WebApi/certs/localhost.pem
similarity index 100%
rename from src/apps/identity/Genocs.Identities.WebApi/certs/localhost.pem
rename to src/apps/identity/Identities.WebApi/certs/localhost.pem
diff --git a/src/apps/launchSettings.json b/src/apps/launchSettings.json
new file mode 100644
index 00000000..dc2b791d
--- /dev/null
+++ b/src/apps/launchSettings.json
@@ -0,0 +1,11 @@
+{
+ "profiles": {
+ "Docker Compose": {
+ "commandName": "DockerCompose",
+ "commandVersion": "1.0",
+ "serviceActions": {
+ "genocs.demo.webapi": "StartDebugging"
+ }
+ }
+ }
+}
diff --git a/src/apps/local copy.env b/src/apps/local copy.env
deleted file mode 100644
index 14349d0a..00000000
--- a/src/apps/local copy.env
+++ /dev/null
@@ -1,10 +0,0 @@
-# Compose supports declaring default environment variables in an environment file named .env placed in the folder docker-compose command is executed from (current working directory).
-# Compose expects each line in an env file to be in VAR=VAL format. Lines beginning with # (i.e. comments) are ignored, as are blank lines.
-# Note: Values present in the environment at runtime will always override those defined inside the .env file. Similarly, values passed via command-line arguments take precedence as well.
-
-# The IP below should be swapped to your real IP or DNS name, like 192.168.88.248, etc. if testing from remote browsers or mobile devices
-
-PROJECT_EXTERNAL_DNS_NAME_OR_IP=localhost
-
-# The docker image version
-DOCKER_IMAGE_TAG=6.0.0
diff --git a/src/apps/local.env b/src/apps/local.env
index e700bc88..ffe61454 100644
--- a/src/apps/local.env
+++ b/src/apps/local.env
@@ -1 +1,2 @@
+# This is the image tag used during the docker build
IMAGE_VERSION=1.0.0
diff --git a/src/apps/order-webapi.dockerfile b/src/apps/orders.dockerfile
similarity index 68%
rename from src/apps/order-webapi.dockerfile
rename to src/apps/orders.dockerfile
index 7777f490..92d99683 100644
--- a/src/apps/order-webapi.dockerfile
+++ b/src/apps/orders.dockerfile
@@ -2,24 +2,23 @@
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app
-EXPOSE 80
-EXPOSE 443
+EXPOSE 8080
+EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env
WORKDIR /src
+
+COPY ["Directory.Build.props", "."]
+COPY ["Directory.Build.targets", "."]
+COPY ["NuGet.config", "."]
+COPY ["dotnet.ruleset", "."]
+COPY ["stylecop.json", "."]
+
COPY ["orders/Genocs.Orders.WebApi", "Genocs.Orders.WebApi/"]
-COPY ["Directory.Build.props", "Directory.Build.props"]
-COPY ["Directory.Build.targets", "Directory.Build.targets"]
-COPY ["NuGet.config", "NuGet.config"]
-COPY ["dotnet.ruleset", "dotnet.ruleset"]
-COPY ["stylecop.json", "stylecop.json"]
WORKDIR "/src/Genocs.Orders.WebApi"
-RUN dotnet restore "Genocs.Orders.WebApi.csproj"
-
RUN dotnet build "Genocs.Orders.WebApi.csproj" -c Release -o /app/build
-
FROM build-env AS publish
RUN dotnet publish "Genocs.Orders.WebApi.csproj" -c Release -o /app/publish
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Commands/CreateOrder.cs b/src/apps/orders/Genocs.Orders.WebApi/Commands/CreateOrder.cs
deleted file mode 100644
index 6f240821..00000000
--- a/src/apps/orders/Genocs.Orders.WebApi/Commands/CreateOrder.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Genocs.Core.CQRS.Commands;
-
-namespace Genocs.Orders.WebApi.Commands;
-
-public class CreateOrder : ICommand
-{
- public Guid OrderId { get; }
- public Guid CustomerId { get; }
- public Guid ProductId { get; }
-
- public CreateOrder(Guid orderId, Guid customerId, Guid productId)
- {
- OrderId = orderId == Guid.Empty ? Guid.NewGuid() : orderId;
- CustomerId = customerId;
- ProductId = productId;
- }
-}
\ No newline at end of file
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Domain/Order.cs b/src/apps/orders/Genocs.Orders.WebApi/Domain/Order.cs
deleted file mode 100644
index ad0cfb06..00000000
--- a/src/apps/orders/Genocs.Orders.WebApi/Domain/Order.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Genocs.Core.Domain.Entities;
-
-namespace Genocs.Orders.WebApi.Domain;
-
-public class Order : IEntity
-{
- public Guid Id { get; private set; }
- public Guid CustomerId { get; private set; }
- public decimal TotalAmount { get; private set; }
-
- public Order(Guid id, Guid customerId, decimal totalAmount)
- {
- Id = id;
- CustomerId = customerId;
- TotalAmount = totalAmount;
- }
-
- public bool IsTransient()
- {
- throw new NotImplementedException();
- }
-}
\ No newline at end of file
diff --git a/src/apps/orders/Genocs.Orders.WebApi/appsettings.Docker.json b/src/apps/orders/Genocs.Orders.WebApi/appsettings.Docker.json
deleted file mode 100644
index 3e7e1474..00000000
--- a/src/apps/orders/Genocs.Orders.WebApi/appsettings.Docker.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "consul": {
- "enabled": true,
- "url": "http://consul:8500",
- "service": "orders-service",
- "address": "orders-service",
- "port": "80"
- },
- "fabio": {
- "enabled": true,
- "url": "http://fabio:9999",
- "service": "orders-service"
- },
- "logger": {
- "seq": {
- "enabled": true,
- "url": "http://seq:5341"
- }
- },
- "monitoring": {
- "jaeger": "jaeger"
- },
- "jaeger": {
- "enabled": true,
- "udpHost": "jaeger",
- "serviceName": "orders-service"
- },
- "metrics": {
- "enabled": true,
- "influxEnabled": true,
- "prometheusEnabled": true,
- "influxUrl": "http://influxdb:8086",
- "env": "docker"
- },
- "prometheus": {
- "enabled": true
- },
- "mongodb": {
- "connectionString": "mongodb://mongodb:27017"
- },
- "redis": {
- "connectionString": "redis"
- },
- "httpClient": {
- "services": {
- "products": "product"
- }
- }
-}
\ No newline at end of file
diff --git a/src/apps/orders/Orders.WebApi/Commands/CreateOrder.cs b/src/apps/orders/Orders.WebApi/Commands/CreateOrder.cs
new file mode 100644
index 00000000..7f4b35cc
--- /dev/null
+++ b/src/apps/orders/Orders.WebApi/Commands/CreateOrder.cs
@@ -0,0 +1,10 @@
+using Genocs.Core.CQRS.Commands;
+
+namespace Genocs.Orders.WebApi.Commands;
+
+public class CreateOrder(Guid orderId, Guid customerId, List products) : ICommand
+{
+ public Guid OrderId { get; } = orderId == Guid.Empty ? Guid.NewGuid() : orderId;
+ public Guid CustomerId { get; } = customerId;
+ public List Products { get; } = products;
+}
\ No newline at end of file
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Commands/Handlers/CreateOrderHandler.cs b/src/apps/orders/Orders.WebApi/Commands/Handlers/CreateOrderHandler.cs
similarity index 80%
rename from src/apps/orders/Genocs.Orders.WebApi/Commands/Handlers/CreateOrderHandler.cs
rename to src/apps/orders/Orders.WebApi/Commands/Handlers/CreateOrderHandler.cs
index 29bc880d..cff85de2 100644
--- a/src/apps/orders/Genocs.Orders.WebApi/Commands/Handlers/CreateOrderHandler.cs
+++ b/src/apps/orders/Orders.WebApi/Commands/Handlers/CreateOrderHandler.cs
@@ -38,11 +38,17 @@ public async Task HandleAsync(CreateOrder command, CancellationToken cancellatio
throw new InvalidOperationException($"Order with given id: {command.OrderId} already exists!");
}
- _logger.LogInformation($"Fetching the product for order with id: {command.OrderId}...");
- var productDto = await _productServiceClient.GetAsync(command.ProductId) ?? throw new InvalidOperationException($"Product '{command.ProductId}' was not found. Requested for order '{command.OrderId}'");
- _logger.LogInformation($"Order '{command.OrderId}' will cost '{productDto.UnitPrice}'$.");
+ _logger.LogInformation($"Fetching products for order with id: {command.OrderId}...");
- var order = new Order(command.OrderId, command.CustomerId, productDto.UnitPrice);
+ List productItems = [];
+
+ foreach (var productId in command.Products)
+ {
+ var productDto = await _productServiceClient.GetAsync(productId) ?? throw new InvalidOperationException($"Product '{productId}' was not found. Requested for order '{command.OrderId}'");
+ productItems.Add(new OrderItem(productId, productDto.UnitPrice, 1));
+ }
+
+ var order = new Order(command.OrderId, command.CustomerId, productItems);
await _repository.AddAsync(order);
_logger.LogInformation($"Created order '{command.OrderId}' for customer '{command.CustomerId}'.");
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Controllers/OrdersController.cs b/src/apps/orders/Orders.WebApi/Controllers/OrdersController.cs
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/Controllers/OrdersController.cs
rename to src/apps/orders/Orders.WebApi/Controllers/OrdersController.cs
diff --git a/src/apps/orders/Genocs.Orders.WebApi/DTO/OrderDto.cs b/src/apps/orders/Orders.WebApi/DTO/OrderDto.cs
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/DTO/OrderDto.cs
rename to src/apps/orders/Orders.WebApi/DTO/OrderDto.cs
diff --git a/src/apps/orders/Genocs.Orders.WebApi/DTO/ProductDto.cs b/src/apps/orders/Orders.WebApi/DTO/ProductDto.cs
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/DTO/ProductDto.cs
rename to src/apps/orders/Orders.WebApi/DTO/ProductDto.cs
diff --git a/src/apps/orders/Orders.WebApi/Domain/Order.cs b/src/apps/orders/Orders.WebApi/Domain/Order.cs
new file mode 100644
index 00000000..944876a8
--- /dev/null
+++ b/src/apps/orders/Orders.WebApi/Domain/Order.cs
@@ -0,0 +1,23 @@
+using Genocs.Core.Domain.Entities;
+
+namespace Genocs.Orders.WebApi.Domain;
+
+public class Order(Guid id, Guid customerId, List items ) : IEntity
+{
+ public Guid Id { get; private set; } = id;
+ public Guid CustomerId { get; private set; } = customerId;
+ public List Items { get; private set; } = items;
+ public decimal TotalAmount { get; private set; } = items.Sum(c => c.UnitPrice * c.Quantity);
+
+ public bool IsTransient()
+ {
+ throw new NotImplementedException();
+ }
+}
+
+public class OrderItem(Guid productId, decimal unitPrice, int quantity)
+{
+ public Guid ProductId { get; private set; } = productId;
+ public decimal UnitPrice { get; private set; } = unitPrice;
+ public int Quantity { get; private set; } = quantity;
+}
\ No newline at end of file
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Events/External/DeliveryStarted.cs b/src/apps/orders/Orders.WebApi/Events/External/DeliveryStarted.cs
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/Events/External/DeliveryStarted.cs
rename to src/apps/orders/Orders.WebApi/Events/External/DeliveryStarted.cs
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Events/External/Handlers/DeliveryStartedHandler.cs b/src/apps/orders/Orders.WebApi/Events/External/Handlers/DeliveryStartedHandler.cs
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/Events/External/Handlers/DeliveryStartedHandler.cs
rename to src/apps/orders/Orders.WebApi/Events/External/Handlers/DeliveryStartedHandler.cs
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Events/OrderCreated.cs b/src/apps/orders/Orders.WebApi/Events/OrderCreated.cs
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/Events/OrderCreated.cs
rename to src/apps/orders/Orders.WebApi/Events/OrderCreated.cs
diff --git a/src/apps/orders/Genocs.Orders.WebApi/ExceptionToResponseMapper.cs b/src/apps/orders/Orders.WebApi/ExceptionToResponseMapper.cs
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/ExceptionToResponseMapper.cs
rename to src/apps/orders/Orders.WebApi/ExceptionToResponseMapper.cs
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Extensions.cs b/src/apps/orders/Orders.WebApi/Extensions.cs
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/Extensions.cs
rename to src/apps/orders/Orders.WebApi/Extensions.cs
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Genocs.Orders.WebApi.csproj b/src/apps/orders/Orders.WebApi/Orders.WebApi.csproj
similarity index 82%
rename from src/apps/orders/Genocs.Orders.WebApi/Genocs.Orders.WebApi.csproj
rename to src/apps/orders/Orders.WebApi/Orders.WebApi.csproj
index ba5d1d8e..a11d73dd 100644
--- a/src/apps/orders/Genocs.Orders.WebApi/Genocs.Orders.WebApi.csproj
+++ b/src/apps/orders/Orders.WebApi/Orders.WebApi.csproj
@@ -2,9 +2,11 @@
net9.0
- false
+ Genocs.Orders.WebApi
+ Genocs.Orders.WebApi
+ Genocs.Orders.WebApi
false
- _genocs
+ Genocs
Linux
..\..
@@ -29,30 +31,30 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Program.cs b/src/apps/orders/Orders.WebApi/Program.cs
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/Program.cs
rename to src/apps/orders/Orders.WebApi/Program.cs
index c74adb39..5768dfa3 100644
--- a/src/apps/orders/Genocs.Orders.WebApi/Program.cs
+++ b/src/apps/orders/Orders.WebApi/Program.cs
@@ -39,14 +39,14 @@
IGenocsBuilder gnxBuilder = await builder
.AddGenocs()
- .AddErrorHandler()
- .AddServices()
+ .AddOpenTelemetry()
+ .AddMetrics()
.AddHttpClient()
- .AddCorrelationContextLogging()
.AddConsul()
.AddFabio()
- .AddOpenTelemetry()
- .AddMetrics()
+ .AddErrorHandler()
+ .AddServices()
+ .AddCorrelationContextLogging()
.AddMongo()
.AddMongoRepository("orders")
.AddCommandHandlers()
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Properties/launchSettings.json b/src/apps/orders/Orders.WebApi/Properties/launchSettings.json
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/Properties/launchSettings.json
rename to src/apps/orders/Orders.WebApi/Properties/launchSettings.json
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Queries/GetOrder.cs b/src/apps/orders/Orders.WebApi/Queries/GetOrder.cs
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/Queries/GetOrder.cs
rename to src/apps/orders/Orders.WebApi/Queries/GetOrder.cs
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Queries/Handlers/GetOrderHandler.cs b/src/apps/orders/Orders.WebApi/Queries/Handlers/GetOrderHandler.cs
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/Queries/Handlers/GetOrderHandler.cs
rename to src/apps/orders/Orders.WebApi/Queries/Handlers/GetOrderHandler.cs
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Services/IProductServiceClient.cs b/src/apps/orders/Orders.WebApi/Services/IProductServiceClient.cs
similarity index 100%
rename from src/apps/orders/Genocs.Orders.WebApi/Services/IProductServiceClient.cs
rename to src/apps/orders/Orders.WebApi/Services/IProductServiceClient.cs
diff --git a/src/apps/orders/Genocs.Orders.WebApi/Services/ProductServiceClient.cs b/src/apps/orders/Orders.WebApi/Services/ProductServiceClient.cs
similarity index 91%
rename from src/apps/orders/Genocs.Orders.WebApi/Services/ProductServiceClient.cs
rename to src/apps/orders/Orders.WebApi/Services/ProductServiceClient.cs
index c2754e4b..c89525e6 100644
--- a/src/apps/orders/Genocs.Orders.WebApi/Services/ProductServiceClient.cs
+++ b/src/apps/orders/Orders.WebApi/Services/ProductServiceClient.cs
@@ -19,14 +19,14 @@ public class ProductServiceClient : IProductServiceClient
/// The standard constructor.
///
/// The http client.
+ /// The client Options.
/// The certification service.
- ///
- ///
- ///
+ /// The Key Vault Options.
+ /// The Security Options like Certificates.
public ProductServiceClient(
IHttpClient client,
- ICertificatesService certificatesService,
HttpClientOptions httpClientOptions,
+ ICertificatesService certificatesService,
VaultOptions vaultOptions,
SecurityOptions securityOptions)
{
diff --git a/src/apps/orders/Genocs.Orders.WebApi/appsettings.json b/src/apps/orders/Orders.WebApi/appsettings.json
similarity index 99%
rename from src/apps/orders/Genocs.Orders.WebApi/appsettings.json
rename to src/apps/orders/Orders.WebApi/appsettings.json
index 024b63f3..18907c4f 100644
--- a/src/apps/orders/Genocs.Orders.WebApi/appsettings.json
+++ b/src/apps/orders/Orders.WebApi/appsettings.json
@@ -8,7 +8,7 @@
"displayVersion": true
},
"consul": {
- "enabled": true,
+ "enabled": false,
"url": "http://localhost:8500",
"service": "orders-service",
"address": "docker.for.mac.localhost",
@@ -20,13 +20,13 @@
"requestRetries": 3
},
"fabio": {
- "enabled": true,
+ "enabled": false,
"url": "http://localhost:9999",
"service": "orders-service",
"requestRetries": 3
},
"httpClient": {
- "type": "fabio",
+ "type": "",
"retries": 3,
"services": {
"products": "products-service"
diff --git a/src/apps/product-webapi.dockerfile b/src/apps/products.dockerfile
similarity index 63%
rename from src/apps/product-webapi.dockerfile
rename to src/apps/products.dockerfile
index 7adc2bf9..dcca17f1 100644
--- a/src/apps/product-webapi.dockerfile
+++ b/src/apps/products.dockerfile
@@ -2,28 +2,27 @@
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app
-EXPOSE 80
-EXPOSE 443
+EXPOSE 8080
+EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env
WORKDIR /src
+
+COPY ["Directory.Build.props", "."]
+COPY ["Directory.Build.targets", "."]
+COPY ["NuGet.config", "."]
+COPY ["dotnet.ruleset", "."]
+COPY ["stylecop.json", "."]
+
COPY ["products/Genocs.Products.WebApi", "Genocs.Products.WebApi/"]
-COPY ["Directory.Build.props", "Directory.Build.props"]
-COPY ["Directory.Build.targets", "Directory.Build.targets"]
-COPY ["NuGet.config", "NuGet.config"]
-COPY ["dotnet.ruleset", "dotnet.ruleset"]
-COPY ["stylecop.json", "stylecop.json"]
WORKDIR "/src/Genocs.Products.WebApi"
-RUN dotnet restore "Genocs.Products.WebApi.csproj"
-
RUN dotnet build "Genocs.Products.WebApi.csproj" -c Release -o /app/build
-
FROM build-env AS publish
RUN dotnet publish "Genocs.Products.WebApi.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
-ENTRYPOINT ["dotnet", "Genocs.Products.WebApi.dll"]
\ No newline at end of file
+ENTRYPOINT ["dotnet", "Genocs.Products.WebApi.dll"]
diff --git a/src/apps/products/Genocs.Products.WebApi/Commands/CreateProduct.cs b/src/apps/products/Genocs.Products.WebApi/Commands/CreateProduct.cs
deleted file mode 100644
index 4f101e6c..00000000
--- a/src/apps/products/Genocs.Products.WebApi/Commands/CreateProduct.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Genocs.Core.CQRS.Commands;
-
-namespace Genocs.Products.WebApi.Commands;
-
-public class CreateProduct : ICommand
-{
- public Guid ProductId { get; }
- public string SKU { get; }
- public decimal UnitPrice { get; }
-
- public CreateProduct(Guid productId, string sku, decimal unitPrice)
- {
- ProductId = productId == Guid.Empty ? Guid.NewGuid() : productId;
- SKU = sku;
- UnitPrice = unitPrice;
- }
-}
\ No newline at end of file
diff --git a/src/apps/products/Genocs.Products.WebApi/Domain/Product.cs b/src/apps/products/Genocs.Products.WebApi/Domain/Product.cs
deleted file mode 100644
index 087a076f..00000000
--- a/src/apps/products/Genocs.Products.WebApi/Domain/Product.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using Genocs.Core.Domain.Entities;
-
-namespace Genocs.Products.WebApi.Domain;
-
-///
-/// The product definition.
-///
-public class Product : IEntity
-{
- public Guid Id { get; private set; }
- public string SKU { get; private set; }
- public decimal UnitPrice { get; private set; }
-
- public Product(Guid id, string sku, decimal unitPrice)
- {
- Id = id;
- SKU = sku;
- UnitPrice = unitPrice;
- }
-
- public bool IsTransient()
- {
- throw new NotImplementedException();
- }
-}
\ No newline at end of file
diff --git a/src/apps/products/Genocs.Products.WebApi/appsettings.Docker.json b/src/apps/products/Genocs.Products.WebApi/appsettings.Docker.json
deleted file mode 100644
index b68c544e..00000000
--- a/src/apps/products/Genocs.Products.WebApi/appsettings.Docker.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "consul": {
- "enabled": true,
- "url": "http://consul:8500",
- "service": "products-service",
- "address": "products-service",
- "port": "80"
- },
- "fabio": {
- "enabled": true,
- "url": "http://fabio:9999",
- "service": "products-service"
- },
- "logger": {
- "seq": {
- "enabled": true,
- "url": "http://seq:5341"
- }
- },
- "monitoring": {
- "jaeger": "jaeger"
- },
- "jaeger": {
- "enabled": true,
- "udpHost": "jaeger",
- "serviceName": "orders-service"
- },
- "metrics": {
- "enabled": true,
- "influxEnabled": true,
- "prometheusEnabled": true,
- "influxUrl": "http://influxdb:8086",
- "env": "docker"
- },
- "prometheus": {
- "enabled": true
- },
- "mongodb": {
- "connectionString": "mongodb://mongodb:27017"
- },
- "redis": {
- "connectionString": "redis"
- }
-}
\ No newline at end of file
diff --git a/src/apps/products/Products.WebApi/Commands/CreateProduct.cs b/src/apps/products/Products.WebApi/Commands/CreateProduct.cs
new file mode 100644
index 00000000..a378a6c3
--- /dev/null
+++ b/src/apps/products/Products.WebApi/Commands/CreateProduct.cs
@@ -0,0 +1,12 @@
+using Genocs.Core.CQRS.Commands;
+
+namespace Genocs.Products.WebApi.Commands;
+
+public class CreateProduct(Guid productId, string sku, decimal unitPrice, string? name, string? description) : ICommand
+{
+ public Guid ProductId { get; } = productId == Guid.Empty ? Guid.NewGuid() : productId;
+ public string SKU { get; } = sku;
+ public decimal UnitPrice { get; } = unitPrice;
+ public string? Name { get; } = name;
+ public string? Description { get; } = description;
+}
\ No newline at end of file
diff --git a/src/apps/products/Genocs.Products.WebApi/Commands/Handlers/CreateProductHandler.cs b/src/apps/products/Products.WebApi/Commands/Handlers/CreateProductHandler.cs
similarity index 97%
rename from src/apps/products/Genocs.Products.WebApi/Commands/Handlers/CreateProductHandler.cs
rename to src/apps/products/Products.WebApi/Commands/Handlers/CreateProductHandler.cs
index 51ac3aec..edc82040 100644
--- a/src/apps/products/Genocs.Products.WebApi/Commands/Handlers/CreateProductHandler.cs
+++ b/src/apps/products/Products.WebApi/Commands/Handlers/CreateProductHandler.cs
@@ -34,7 +34,7 @@ public async Task HandleAsync(CreateProduct command, CancellationToken cancellat
throw new InvalidOperationException($"Product with given id: {command.ProductId} already exists!");
}
- var product = new Product(command.ProductId, command.SKU, command.UnitPrice);
+ var product = new Product(command.ProductId, command.SKU, command.UnitPrice, command.Name, command.Description);
await _repository.AddAsync(product);
_logger.LogInformation($"Created a product with id: {command.ProductId}, sku: {command.SKU}, unitPrice: {command.UnitPrice}.");
diff --git a/src/apps/products/Genocs.Products.WebApi/DTO/ProductDto.cs b/src/apps/products/Products.WebApi/DTO/ProductDto.cs
similarity index 69%
rename from src/apps/products/Genocs.Products.WebApi/DTO/ProductDto.cs
rename to src/apps/products/Products.WebApi/DTO/ProductDto.cs
index 90c573a9..2300f8f7 100644
--- a/src/apps/products/Genocs.Products.WebApi/DTO/ProductDto.cs
+++ b/src/apps/products/Products.WebApi/DTO/ProductDto.cs
@@ -4,6 +4,7 @@ public class ProductDto
{
public Guid Id { get; set; }
public string SKU { get; set; } = default!;
-
+ public string? Name { get; set; }
+ public string? Description { get; set; }
public decimal UnitPrice { get; set; }
}
\ No newline at end of file
diff --git a/src/apps/products/Products.WebApi/Domain/Product.cs b/src/apps/products/Products.WebApi/Domain/Product.cs
new file mode 100644
index 00000000..0fbd865d
--- /dev/null
+++ b/src/apps/products/Products.WebApi/Domain/Product.cs
@@ -0,0 +1,28 @@
+using Genocs.Core.Domain.Entities;
+
+namespace Genocs.Products.WebApi.Domain;
+
+///
+/// The product definition.
+///
+public class Product(Guid id, string sku, decimal unitPrice) : IEntity
+{
+ public Guid Id { get; private set; } = id;
+ public string? Name { get; private set; }
+ public string? Description { get; private set; }
+
+ public string SKU { get; private set; } = sku;
+ public decimal UnitPrice { get; private set; } = unitPrice;
+
+ public Product(Guid id, string sku, decimal unitPrice, string? name, string? description)
+ : this(id, sku, unitPrice)
+ {
+ Name = name;
+ Description = description;
+ }
+
+ public bool IsTransient()
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
diff --git a/src/apps/products/Genocs.Products.WebApi/Events/ProductCreated.cs b/src/apps/products/Products.WebApi/Events/ProductCreated.cs
similarity index 100%
rename from src/apps/products/Genocs.Products.WebApi/Events/ProductCreated.cs
rename to src/apps/products/Products.WebApi/Events/ProductCreated.cs
diff --git a/src/apps/products/Genocs.Products.WebApi/ExceptionToResponseMapper.cs b/src/apps/products/Products.WebApi/ExceptionToResponseMapper.cs
similarity index 100%
rename from src/apps/products/Genocs.Products.WebApi/ExceptionToResponseMapper.cs
rename to src/apps/products/Products.WebApi/ExceptionToResponseMapper.cs
diff --git a/src/apps/products/Genocs.Products.WebApi/Extensions.cs b/src/apps/products/Products.WebApi/Extensions.cs
similarity index 100%
rename from src/apps/products/Genocs.Products.WebApi/Extensions.cs
rename to src/apps/products/Products.WebApi/Extensions.cs
diff --git a/src/apps/products/Genocs.Products.WebApi/Genocs.Products.WebApi.csproj b/src/apps/products/Products.WebApi/Products.WebApi.csproj
similarity index 83%
rename from src/apps/products/Genocs.Products.WebApi/Genocs.Products.WebApi.csproj
rename to src/apps/products/Products.WebApi/Products.WebApi.csproj
index ef9addda..0a25fe23 100644
--- a/src/apps/products/Genocs.Products.WebApi/Genocs.Products.WebApi.csproj
+++ b/src/apps/products/Products.WebApi/Products.WebApi.csproj
@@ -2,7 +2,9 @@
net9.0
- false
+ Genocs.Products.WebApi
+ Genocs.Products.WebApi
+ Genocs.Products.WebApi
false
Genocs
@@ -10,7 +12,6 @@
-
@@ -28,26 +29,24 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/src/apps/products/Genocs.Products.WebApi/Program.cs b/src/apps/products/Products.WebApi/Program.cs
similarity index 100%
rename from src/apps/products/Genocs.Products.WebApi/Program.cs
rename to src/apps/products/Products.WebApi/Program.cs
index b3bec71a..3adab090 100644
--- a/src/apps/products/Genocs.Products.WebApi/Program.cs
+++ b/src/apps/products/Products.WebApi/Program.cs
@@ -37,14 +37,14 @@
IGenocsBuilder gnxBuilder = await builder
.AddGenocs()
- .AddErrorHandler()
- .AddServices()
+ .AddOpenTelemetry()
+ .AddMetrics()
.AddHttpClient()
- .AddCorrelationContextLogging()
.AddConsul()
.AddFabio()
- .AddOpenTelemetry()
- .AddMetrics()
+ .AddErrorHandler()
+ .AddServices()
+ .AddCorrelationContextLogging()
.AddMongo()
.AddMongoRepository("products")
.AddCommandHandlers()
diff --git a/src/apps/products/Genocs.Products.WebApi/Properties/launchSettings.json b/src/apps/products/Products.WebApi/Properties/launchSettings.json
similarity index 100%
rename from src/apps/products/Genocs.Products.WebApi/Properties/launchSettings.json
rename to src/apps/products/Products.WebApi/Properties/launchSettings.json
diff --git a/src/apps/products/Genocs.Products.WebApi/Queries/BrowseProducts.cs b/src/apps/products/Products.WebApi/Queries/BrowseProducts.cs
similarity index 100%
rename from src/apps/products/Genocs.Products.WebApi/Queries/BrowseProducts.cs
rename to src/apps/products/Products.WebApi/Queries/BrowseProducts.cs
diff --git a/src/apps/products/Genocs.Products.WebApi/Queries/GetProduct.cs b/src/apps/products/Products.WebApi/Queries/GetProduct.cs
similarity index 100%
rename from src/apps/products/Genocs.Products.WebApi/Queries/GetProduct.cs
rename to src/apps/products/Products.WebApi/Queries/GetProduct.cs
diff --git a/src/apps/products/Genocs.Products.WebApi/Queries/Handlers/BrowseProductsHandler.cs b/src/apps/products/Products.WebApi/Queries/Handlers/BrowseProductsHandler.cs
similarity index 100%
rename from src/apps/products/Genocs.Products.WebApi/Queries/Handlers/BrowseProductsHandler.cs
rename to src/apps/products/Products.WebApi/Queries/Handlers/BrowseProductsHandler.cs
diff --git a/src/apps/products/Genocs.Products.WebApi/Queries/Handlers/GetProductHandler.cs b/src/apps/products/Products.WebApi/Queries/Handlers/GetProductHandler.cs
similarity index 100%
rename from src/apps/products/Genocs.Products.WebApi/Queries/Handlers/GetProductHandler.cs
rename to src/apps/products/Products.WebApi/Queries/Handlers/GetProductHandler.cs
diff --git a/src/apps/products/Genocs.Products.WebApi/appsettings.json b/src/apps/products/Products.WebApi/appsettings.json
similarity index 99%
rename from src/apps/products/Genocs.Products.WebApi/appsettings.json
rename to src/apps/products/Products.WebApi/appsettings.json
index 03cfeee9..de9690c7 100644
--- a/src/apps/products/Genocs.Products.WebApi/appsettings.json
+++ b/src/apps/products/Products.WebApi/appsettings.json
@@ -8,7 +8,7 @@
"displayVersion": true
},
"consul": {
- "enabled": true,
+ "enabled": false,
"url": "http://localhost:8500",
"service": "products-service",
"address": "docker.for.mac.localhost",
@@ -20,13 +20,13 @@
"requestRetries": 3
},
"fabio": {
- "enabled": true,
+ "enabled": false,
"url": "http://localhost:9999",
"service": "products-service",
"requestRetries": 3
},
"httpClient": {
- "type": "fabio",
+ "type": "",
"retries": 3,
"services": {
},
diff --git a/src/apps/signalr-webapi.dockerfile b/src/apps/signalr.dockerfile
similarity index 81%
rename from src/apps/signalr-webapi.dockerfile
rename to src/apps/signalr.dockerfile
index abf8892c..e890a6e8 100644
--- a/src/apps/signalr-webapi.dockerfile
+++ b/src/apps/signalr.dockerfile
@@ -10,8 +10,8 @@
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app
-EXPOSE 80
-EXPOSE 443
+EXPOSE 8080
+EXPOSE 8081
# FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build-env
# FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build-env
@@ -20,21 +20,19 @@ EXPOSE 443
# FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
# FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env
-
WORKDIR /src
+
+COPY ["Directory.Build.props", "."]
+COPY ["Directory.Build.targets", "."]
+COPY ["NuGet.config", "."]
+COPY ["dotnet.ruleset", "."]
+COPY ["stylecop.json", "."]
+
COPY ["signalr/Genocs.SignalR.WebApi", "Genocs.SignalR.WebApi/"]
-COPY ["Directory.Build.props", "Directory.Build.props"]
-COPY ["Directory.Build.targets", "Directory.Build.targets"]
-COPY ["NuGet.config", "NuGet.config"]
-COPY ["dotnet.ruleset", "dotnet.ruleset"]
-COPY ["stylecop.json", "stylecop.json"]
WORKDIR "/src/Genocs.SignalR.WebApi"
-RUN dotnet restore "Genocs.SignalR.WebApi.csproj"
-
RUN dotnet build "Genocs.SignalR.WebApi.csproj" -c Release -o /app/build
-
FROM build-env AS publish
RUN dotnet publish "Genocs.SignalR.WebApi.csproj" -c Release -o /app/publish
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/appsettings.docker.json b/src/apps/signalr/Genocs.SignalR.WebApi/appsettings.docker.json
deleted file mode 100644
index d88f7d05..00000000
--- a/src/apps/signalr/Genocs.SignalR.WebApi/appsettings.docker.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "consul": {
- "enabled": true,
- "url": "http://consul:8500",
- "service": "signalr-service",
- "address": "signalr-service",
- "port": "80"
- },
- "fabio": {
- "enabled": true,
- "url": "http://fabio:9999",
- "service": "signalr-service"
- },
- "logger": {
- "seq": {
- "enabled": true,
- "url": "http://seq:5341"
- }
- },
- "monitoring": {
- "jaeger": "jaeger"
- },
- "jaeger": {
- "enabled": true,
- "udpHost": "jaeger",
- "serviceName": "signalr-service"
- },
- "metrics": {
- "enabled": true,
- "influxEnabled": true,
- "prometheusEnabled": true,
- "influxUrl": "http://influxdb:8086",
- "env" :"docker"
- },
- "prometheus": {
- "enabled": true
- },
- "mongodb": {
- "connectionString": "mongodb://mongodb:27017"
- },
- "redis": {
- "connectionString": "redis"
- }
-}
\ No newline at end of file
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Commands/Handlers/PublishNotificationHandler.cs b/src/apps/signalr/SignalR.WebApi/Commands/Handlers/PublishNotificationHandler.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Commands/Handlers/PublishNotificationHandler.cs
rename to src/apps/signalr/SignalR.WebApi/Commands/Handlers/PublishNotificationHandler.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Commands/PublishNotification.cs b/src/apps/signalr/SignalR.WebApi/Commands/PublishNotification.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Commands/PublishNotification.cs
rename to src/apps/signalr/SignalR.WebApi/Commands/PublishNotification.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Configurations/SignalROptions.cs b/src/apps/signalr/SignalR.WebApi/Configurations/SignalROptions.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Configurations/SignalROptions.cs
rename to src/apps/signalr/SignalR.WebApi/Configurations/SignalROptions.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Events/NotificationPosted.cs b/src/apps/signalr/SignalR.WebApi/Events/NotificationPosted.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Events/NotificationPosted.cs
rename to src/apps/signalr/SignalR.WebApi/Events/NotificationPosted.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Exceptions/AppException.cs b/src/apps/signalr/SignalR.WebApi/Exceptions/AppException.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Exceptions/AppException.cs
rename to src/apps/signalr/SignalR.WebApi/Exceptions/AppException.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Exceptions/ExceptionToResponseMapper.cs b/src/apps/signalr/SignalR.WebApi/Exceptions/ExceptionToResponseMapper.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Exceptions/ExceptionToResponseMapper.cs
rename to src/apps/signalr/SignalR.WebApi/Exceptions/ExceptionToResponseMapper.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Framework/Extensions.cs b/src/apps/signalr/SignalR.WebApi/Framework/Extensions.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Framework/Extensions.cs
rename to src/apps/signalr/SignalR.WebApi/Framework/Extensions.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Handlers/OperationUpdatedHandler.cs b/src/apps/signalr/SignalR.WebApi/Handlers/OperationUpdatedHandler.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Handlers/OperationUpdatedHandler.cs
rename to src/apps/signalr/SignalR.WebApi/Handlers/OperationUpdatedHandler.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Hubs/GenocsHub.cs b/src/apps/signalr/SignalR.WebApi/Hubs/GenocsHub.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Hubs/GenocsHub.cs
rename to src/apps/signalr/SignalR.WebApi/Hubs/GenocsHub.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Messages/Events/OperationCompleted.cs b/src/apps/signalr/SignalR.WebApi/Messages/Events/OperationCompleted.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Messages/Events/OperationCompleted.cs
rename to src/apps/signalr/SignalR.WebApi/Messages/Events/OperationCompleted.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Messages/Events/OperationPending.cs b/src/apps/signalr/SignalR.WebApi/Messages/Events/OperationPending.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Messages/Events/OperationPending.cs
rename to src/apps/signalr/SignalR.WebApi/Messages/Events/OperationPending.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Messages/Events/OperationRejected.cs b/src/apps/signalr/SignalR.WebApi/Messages/Events/OperationRejected.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Messages/Events/OperationRejected.cs
rename to src/apps/signalr/SignalR.WebApi/Messages/Events/OperationRejected.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Program.cs b/src/apps/signalr/SignalR.WebApi/Program.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Program.cs
rename to src/apps/signalr/SignalR.WebApi/Program.cs
index b563d9bb..fe751715 100644
--- a/src/apps/signalr/Genocs.SignalR.WebApi/Program.cs
+++ b/src/apps/signalr/SignalR.WebApi/Program.cs
@@ -32,11 +32,11 @@
IGenocsBuilder gnxBuilder = await builder
.AddGenocs()
- .AddCorrelationContextLogging()
- .AddJwt()
- .AddErrorHandler()
.AddOpenTelemetry()
.AddMetrics()
+ .AddJwt()
+ .AddCorrelationContextLogging()
+ .AddErrorHandler()
.AddMongo()
.AddCommandHandlers()
.AddEventHandlers()
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Properties/launchSettings.json b/src/apps/signalr/SignalR.WebApi/Properties/launchSettings.json
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Properties/launchSettings.json
rename to src/apps/signalr/SignalR.WebApi/Properties/launchSettings.json
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Services/HubService.cs b/src/apps/signalr/SignalR.WebApi/Services/HubService.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Services/HubService.cs
rename to src/apps/signalr/SignalR.WebApi/Services/HubService.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Services/HubWrapper.cs b/src/apps/signalr/SignalR.WebApi/Services/HubWrapper.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Services/HubWrapper.cs
rename to src/apps/signalr/SignalR.WebApi/Services/HubWrapper.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Services/IHubService.cs b/src/apps/signalr/SignalR.WebApi/Services/IHubService.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Services/IHubService.cs
rename to src/apps/signalr/SignalR.WebApi/Services/IHubService.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Services/IHubWrapper.cs b/src/apps/signalr/SignalR.WebApi/Services/IHubWrapper.cs
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Services/IHubWrapper.cs
rename to src/apps/signalr/SignalR.WebApi/Services/IHubWrapper.cs
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/Genocs.SignalR.WebApi.csproj b/src/apps/signalr/SignalR.WebApi/SignalR.WebApi.csproj
similarity index 82%
rename from src/apps/signalr/Genocs.SignalR.WebApi/Genocs.SignalR.WebApi.csproj
rename to src/apps/signalr/SignalR.WebApi/SignalR.WebApi.csproj
index dda61a2f..2dfdf9cd 100644
--- a/src/apps/signalr/Genocs.SignalR.WebApi/Genocs.SignalR.WebApi.csproj
+++ b/src/apps/signalr/SignalR.WebApi/SignalR.WebApi.csproj
@@ -2,7 +2,9 @@
net9.0
- false
+ Genocs.SignalR.WebApi
+ Genocs.SignalR.WebApi
+ Genocs.SignalR.WebApi
false
Genocs
@@ -11,7 +13,6 @@
-
@@ -29,23 +30,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -53,6 +53,6 @@
-
+
\ No newline at end of file
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/appsettings.json b/src/apps/signalr/SignalR.WebApi/appsettings.json
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/appsettings.json
rename to src/apps/signalr/SignalR.WebApi/appsettings.json
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/certs/localhost.cer b/src/apps/signalr/SignalR.WebApi/certs/localhost.cer
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/certs/localhost.cer
rename to src/apps/signalr/SignalR.WebApi/certs/localhost.cer
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/certs/localhost.key b/src/apps/signalr/SignalR.WebApi/certs/localhost.key
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/certs/localhost.key
rename to src/apps/signalr/SignalR.WebApi/certs/localhost.key
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/certs/localhost.pem b/src/apps/signalr/SignalR.WebApi/certs/localhost.pem
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/certs/localhost.pem
rename to src/apps/signalr/SignalR.WebApi/certs/localhost.pem
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/wwwroot/signalr/index.html b/src/apps/signalr/SignalR.WebApi/wwwroot/signalr/index.html
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/wwwroot/signalr/index.html
rename to src/apps/signalr/SignalR.WebApi/wwwroot/signalr/index.html
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/wwwroot/signalr/js/app.js b/src/apps/signalr/SignalR.WebApi/wwwroot/signalr/js/app.js
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/wwwroot/signalr/js/app.js
rename to src/apps/signalr/SignalR.WebApi/wwwroot/signalr/js/app.js
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/wwwroot/signalr/js/appV2.js b/src/apps/signalr/SignalR.WebApi/wwwroot/signalr/js/appV2.js
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/wwwroot/signalr/js/appV2.js
rename to src/apps/signalr/SignalR.WebApi/wwwroot/signalr/js/appV2.js
diff --git a/src/apps/signalr/Genocs.SignalR.WebApi/wwwroot/signalr/js/signalr.js b/src/apps/signalr/SignalR.WebApi/wwwroot/signalr/js/signalr.js
similarity index 100%
rename from src/apps/signalr/Genocs.SignalR.WebApi/wwwroot/signalr/js/signalr.js
rename to src/apps/signalr/SignalR.WebApi/wwwroot/signalr/js/signalr.js