Skip to content

Commit

Permalink
Merge pull request #42 from falberthen/fix/full_framework_update
Browse files Browse the repository at this point in the history
Fix/full framework update
  • Loading branch information
i-moonlight committed Dec 14, 2023
2 parents 987db8a + 8bc00ec commit 3f12c83
Show file tree
Hide file tree
Showing 57 changed files with 15,625 additions and 7,339 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ecommerceddd-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore EcommerceDDD.sln
- name: Build
Expand Down
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,33 +59,32 @@ A lightweight Angular-based `SPA` providing a functional and user-friendly UI.
## Technologies used
<ul>
<li>
<a href='https://get.asp.net' target="_blank">ASP.NET</a> and <a href='https://msdn.microsoft.com/en-us/library/67ef8sbd.aspx' target="_blank">C# 10</a>
<a href='https://get.asp.net' target="_blank">ASP.NET Core API</a> and <a href='https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12' target="_blank">C# 12</a>
for cross-platform backend with:
<ul>
<li>.NET 7</li>
<li>Ocelot 19.0.3</li>
<li>Marten 6.2.0</li>
<li>Entity Framework Core 7.0.11</li>
<li>Postgres for Entity Framework Core 7.0.11</li>
<li>ASP.NET Core Identity 7.0.11</li>
<li>ASP.NET Core Authentication JwtBearer 7.0.11</li>
<li>Duende IdentityServer 6.3.5</li>
<li>MediatR 12.1.1</li>
<li>Polly 8.0.0</li>
<li>Fluent Assertions 6.12.0</li>
<li>XUnit 2.5.1</li>
<li>.NET 8</li>
<li>Ocelot 22.0.1</li>
<li>Marten 6.4.0</li>
<li>Entity Framework Core 8.0.0</li>
<li>Postgres for Entity Framework Core 8.0.0</li>
<li>ASP.NET Core Identity 8.0.0</li>
<li>ASP.NET Core Authentication JwtBearer 8.0.0</li>
<li>Duende IdentityServer 6.3.6</li>
<li>MediatR 12.2.0</li>
<li>Polly 8.2.0</li>
<li>Fluent Assertions 6.12.0</li>
<li>XUnit 2.6.3</li>
<li>NSubstitute 5.1.0</li>
<li>Swagger 6.5.0</li>
<li>Confluent Kafka 2.2.0</li>
<li>Docker Compose</li>
<li>Confluent Kafka 2.3.0</li>
</ul>
</li>
<li>
<a href='https://angular.io/' target="_blank">Angular 16</a> and <a href='http://www.typescriptlang.org/' target="_blank">TypeScript</a> for the frontend with:
<a href='https://angular.io/' target="_blank">Angular 17</a> and <a href='http://www.typescriptlang.org/' target="_blank">TypeScript 5.2.0</a> for the frontend with:
<ul>
<li>NgBootstrap / Bootstrap 5.2.3</li>
<li>Font Awesome</li>
<li>Toastr</li>
<li>NgBootstrap 16.0.0/ Bootstrap 5.2.3</li>
<li>Font Awesome 6.4.</li>
<li>Toastr 17.0.2</li>
</ul>
</li>
</ul>
Expand Down
86 changes: 36 additions & 50 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,6 @@ services:
volumes:
- './scripts/db_init.sql:/docker-entrypoint-initdb.d/db_init.sql'

connect:
image: debezium/connect
container_name: connect
ports:
- '8083:8083'
restart: on-failure
environment:
BOOTSTRAP_SERVERS: 'kafka:9092'
GROUP_ID: 1
CONFIG_STORAGE_TOPIC: CONNECT_CONFIGS
OFFSET_STORAGE_TOPIC: CONNECT_OFFSETS
STATUS_STORAGE_TOPIC: CONNECT_STATUSES
depends_on:
- postgres
- kafka
networks:
- ecommercedddnet

pgadmin:
image: dpage/pgadmin4
container_name: pgadmin_container
environment:
PGADMIN_DEFAULT_EMAIL: '${PGADMIN_DEFAULT_EMAIL:-pgadmintest@pgadmin.org}'
PGADMIN_DEFAULT_PASSWORD: '${PGADMIN_DEFAULT_PASSWORD:-@dm1n}'
PGADMIN_CONFIG_SERVER_MODE: 'False'
volumes:
- 'pgadmin:/var/lib/pgadmin'
ports:
- '${PGADMIN_PORT:-5050}:80'
depends_on:
- postgres
networks:
- ecommercedddnet

zookeeper:
image: confluentinc/cp-zookeeper:7.0.1
hostname: zookeeper
Expand All @@ -63,7 +29,7 @@ services:
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000

kafka:
image: confluentinc/cp-kafka:7.0.1
hostname: kafka
Expand All @@ -83,21 +49,6 @@ services:
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
depends_on:
- zookeeper


init-kafka:
image: confluentinc/cp-kafka:7.0.1
entrypoint:
- /bin/sh
- '-c'
networks:
- ecommercedddnet
command: >
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic Payments --replication-factor 1 --partitions 1 &&
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic Shipments --replication-factor 1 --partitions 1
restart: on-failure
depends_on:
- kafka

kafka_topics_ui:
image: provectuslabs/kafka-ui:latest
Expand All @@ -113,6 +64,40 @@ services:
depends_on:
- kafka

connect:
image: debezium/connect
container_name: connect
ports:
- '8083:8083'
restart: on-failure
environment:
BOOTSTRAP_SERVERS: 'kafka:9092'
GROUP_ID: 1
CONFIG_STORAGE_TOPIC: CONNECT_CONFIGS
OFFSET_STORAGE_TOPIC: CONNECT_OFFSETS
STATUS_STORAGE_TOPIC: CONNECT_STATUSES
depends_on:
- postgres
- kafka
networks:
- ecommercedddnet

pgadmin:
image: dpage/pgadmin4
container_name: pgadmin_container
environment:
PGADMIN_DEFAULT_EMAIL: '${PGADMIN_DEFAULT_EMAIL:-pgadmintest@pgadmin.org}'
PGADMIN_DEFAULT_PASSWORD: '${PGADMIN_DEFAULT_PASSWORD:-@dm1n}'
PGADMIN_CONFIG_SERVER_MODE: 'False'
volumes:
- 'pgadmin:/var/lib/pgadmin'
ports:
- '$PGADMIN_PORT:80'
depends_on:
- postgres
networks:
- ecommercedddnet

ecommerceddd-identityserver:
image: ecommerceddd-identityserver
container_name: ecommerceddd-identityserver
Expand Down Expand Up @@ -146,6 +131,7 @@ services:
networks:
- ecommercedddnet

# Services
ecommerceddd-customers:
image: ecommerceddd-customers
container_name: ecommerceddd-customers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoMapper" Version="12.0.1" />
<PackageReference Include="Confluent.Kafka" Version="2.2.0" />
<PackageReference Include="Duende.IdentityServer" Version="6.3.5" />
<PackageReference Include="Duende.IdentityServer.AspNetIdentity" Version="6.3.5" />
<PackageReference Include="Duende.IdentityServer.EntityFramework" Version="6.3.5" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="7.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.11">
<PackageReference Include="Confluent.Kafka" Version="2.3.0" />
<PackageReference Include="Duende.IdentityServer" Version="6.3.6" />
<PackageReference Include="Duende.IdentityServer.AspNetIdentity" Version="6.3.6" />
<PackageReference Include="Duende.IdentityServer.EntityFramework" Version="6.3.6" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.Design" Version="1.1.0" />
<PackageReference Include="Polly" Version="8.0.0" />
<PackageReference Include="Polly" Version="8.2.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
namespace EcommerceDDD.Core.Infrastructure.Kafka.Serialization;

public class JsonEventSerializer<T> : ISerializer<T>, IDeserializer<T?>
public class JsonEventSerializer<T> : ISerializer<T>, IDeserializer<T>
where T : class
{
public byte[] Serialize(T data, SerializationContext context)
=> Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(data));

public T? Deserialize(ReadOnlySpan<byte> data, bool isNull, SerializationContext context)
public T Deserialize(ReadOnlySpan<byte> data, bool isNull, SerializationContext context)
{
if (isNull)
return null;

var eventType = GetEventType(context);
if (eventType == null)
if (eventType is null)
return null;

var message = Encoding.UTF8.GetString(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class OutboxMessageService : IOutboxMessageService

public async Task SaveAsOutboxMessageAsync(IntegrationEvent @event, bool saveChanges = false)
{
if (@event == null)
if (@event is null)
throw new ArgumentNullException(nameof(@event));

_logger.LogInformation("Adding event {@event} to outboxmessages...", @event);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
9 changes: 5 additions & 4 deletions src/Core/EcommerceDDD.Core/EcommerceDDD.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7</TargetFramework>
<Platforms>AnyCPU;x64</Platforms>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,8 +14,8 @@

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Marten" Version="6.2.0" />
<PackageReference Include="MediatR" Version="12.1.1" />
<PackageReference Include="Marten" Version="6.4.0" />
<PackageReference Include="MediatR" Version="12.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/Crosscutting/EcommerceDDD.ApiGateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["src/Crosscutting/EcommerceDDD.ApiGateway/EcommerceDDD.ApiGateway.csproj", "src/Crosscutting/EcommerceDDD.ApiGateway/"]
RUN dotnet restore "src/Crosscutting/EcommerceDDD.ApiGateway/EcommerceDDD.ApiGateway.csproj"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>3f5a05c6-8494-4c36-883b-9953af266395</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
Expand All @@ -11,8 +12,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Ocelot" Version="19.0.3" />
<PackageReference Include="Ocelot.Cache.CacheManager" Version="19.0.3" />
<PackageReference Include="Ocelot" Version="22.0.1" />
<PackageReference Include="Ocelot.Cache.CacheManager" Version="22.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Crosscutting/EcommerceDDD.IdentityServer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["src/Crosscutting/EcommerceDDD.IdentityServer/EcommerceDDD.IdentityServer.csproj", "src/Crosscutting/EcommerceDDD.IdentityServer/"]
COPY ["src/Core/EcommerceDDD.Core/EcommerceDDD.Core.csproj", "src/Core/EcommerceDDD.Core/"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>4d8d1881-5c43-4ce3-8224-a30b3e79f498</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..\..</DockerfileContext>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.11">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Loading

0 comments on commit 3f12c83

Please sign in to comment.