Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Roslynator.Analyzers" Version="4.12.9">
<PackageReference Include="Roslynator.Analyzers" Version="4.12.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
93 changes: 68 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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/)
Expand All @@ -133,37 +134,53 @@ 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`
- [Jaeger](localhost:16686): `localhost:16686`
- [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.
Expand All @@ -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
Expand All @@ -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
},
Expand All @@ -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",
Expand Down Expand Up @@ -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
Expand All @@ -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 |


![Architecture](./assets/architecture_01.png)

### 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
Expand All @@ -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
Expand Down Expand Up @@ -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)!


[![buy-me-a-coffee](https://raw.githubusercontent.com/Genocs/blazor-template/main/assets/buy-me-a-coffee.png "buy-me-a-coffee")](https://www.buymeacoffee.com/genocs)
[![buy-me-a-coffee](https://raw.githubusercontent.com/Genocs/genocs-library/main/assets/buy-me-a-coffee.png "buy-me-a-coffee")](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)

[![genocs contributors](https://contrib.rocks/image?repo=Genocs/blazor-template "genocs contributors")](https://github.com/genocs/blazor-template/graphs/contributors)
[![genocs contributors](https://contrib.rocks/image?repo=Genocs/genocs-library "genocs contributors")](https://github.com/genocs/genocs-library/graphs/contributors)

## Financial Contributors

Expand Down
Binary file removed assets/Genocs-Library-Overview.drawio.png
Binary file not shown.
Binary file added assets/architecture_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 22 additions & 20 deletions genocs.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand All @@ -95,27 +105,19 @@ 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
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Genocs.LoadBalancing.Fabio", "src\Genocs.LoadBalancing.Fabio\Genocs.LoadBalancing.Fabio.csproj", "{51C9BA95-7731-4D53-92D3-5BF6DF4147D6}"
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
Expand Down
4 changes: 1 addition & 3 deletions src/Genocs.Auth/Genocs.Auth.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
</PropertyGroup>

<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<ProjectReference Include="..\Genocs.Core\Genocs.Core.csproj" />
<ProjectReference Include="..\Genocs.Security\Genocs.Security.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="Genocs.Core" Version="7.2.1" />
<PackageReference Include="Genocs.Security" Version="7.2.1" />
<PackageReference Include="Genocs.Security" Version="7.2.*" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="Genocs.Core" Version="7.2.1" />
<PackageReference Include="Genocs.Core" Version="7.2.*" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/Genocs.Core.Demo.Domain/Genocs.Core.Demo.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="Genocs.Persistence.MongoDb" Version="7.2.1" />
<PackageReference Include="Genocs.Core" Version="7.2.1" />
<PackageReference Include="Genocs.Persistence.MongoDb" Version="7.2.*" />
<PackageReference Include="Genocs.Core" Version="7.2.*" />
</ItemGroup>

</Project>
20 changes: 10 additions & 10 deletions src/Genocs.Core.Demo.WebApi/Genocs.Core.Demo.WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="Genocs.ServiceBusAzure" Version="7.2.1" />
<PackageReference Include="Genocs.Auth" Version="7.2.1" />
<PackageReference Include="Genocs.Logging" Version="7.2.1" />
<PackageReference Include="Genocs.Tracing" Version="7.2.1" />
<PackageReference Include="Genocs.HTTP" Version="7.2.1" />
<PackageReference Include="Genocs.Security" Version="7.2.1" />
<PackageReference Include="Genocs.WebApi" Version="7.2.1" />
<PackageReference Include="Genocs.WebApi.Security" Version="7.2.1" />
<PackageReference Include="Genocs.Secrets.AzureKeyVault" Version="7.2.1" />
<PackageReference Include="Genocs.ServiceBusAzure" Version="7.2.*" />
<PackageReference Include="Genocs.Auth" Version="7.2.*" />
<PackageReference Include="Genocs.Logging" Version="7.2.*" />
<PackageReference Include="Genocs.Tracing" Version="7.2.*" />
<PackageReference Include="Genocs.HTTP" Version="7.2.*" />
<PackageReference Include="Genocs.Security" Version="7.2.*" />
<PackageReference Include="Genocs.WebApi" Version="7.2.*" />
<PackageReference Include="Genocs.WebApi.Security" Version="7.2.*" />
<PackageReference Include="Genocs.Secrets.AzureKeyVault" Version="7.2.*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MassTransit.RabbitMQ" Version="8.3.3" />
<PackageReference Include="MassTransit.RabbitMQ" Version="8.3.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Certificate" Version="9.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/Genocs.Core.Demo.Worker/Genocs.Core.Demo.Worker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="Genocs.ServiceBusAzure" Version="7.2.1" />
<PackageReference Include="Genocs.Logging" Version="7.2.1" />
<PackageReference Include="Genocs.Tracing" Version="7.2.1" />
<PackageReference Include="Genocs.ServiceBusAzure" Version="7.2.*" />
<PackageReference Include="Genocs.Logging" Version="7.2.*" />
<PackageReference Include="Genocs.Tracing" Version="7.2.*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="7.3.1" />
<PackageReference Include="MassTransit.RabbitMQ" Version="8.3.3" />
<PackageReference Include="MassTransit.RabbitMQ" Version="8.3.4" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="4.0.0" />
</ItemGroup>
Expand Down
Loading