Skip to content

Commit

Permalink
Merge pull request #202 from TimeWarpEngineering/Cramer/2024-05-21/As…
Browse files Browse the repository at this point in the history
…pire

Replace Tye with Aspire :)
  • Loading branch information
StevenTCramer authored May 23, 2024
2 parents a9d6816 + d68cde6 commit 91df4ab
Show file tree
Hide file tree
Showing 61 changed files with 1,021 additions and 970 deletions.
17 changes: 17 additions & 0 deletions .idea/.idea.timewarp-architecture.dir/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.timewarp-architecture.dir/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion TimeWarp.Architecture/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dlldata.c
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
#**/Properties/launchSettings.json

*_i.c
*_p.c
Expand Down Expand Up @@ -313,3 +313,5 @@ GeneratedCode/
/Documentation/Developer/HowToGuides/Api_Contracts/Handling_Mutability_in_API_Contracts.pdf
/Documentation/Developer/HowToGuides/Api_Contracts/Handling_Nullability_in_API_Contracts.pdf
/Documentation/Developer/HowToGuides/Api_Contracts/HowToWrite_BFF_API_Contracts.pdf
/output.txt
/Source/ContainerApps/Web/Web.Spa/wwwroot/css/site.css
72 changes: 0 additions & 72 deletions TimeWarp.Architecture/DevOps/Tye/tye.yaml

This file was deleted.

53 changes: 31 additions & 22 deletions TimeWarp.Architecture/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
<PackageVersion Include="Ardalis.GuardClauses" Version="4.5.0" />
<PackageVersion Include="Asp.Versioning.Http" Version="7.0.0" />
<PackageVersion Include="Asp.Versioning.Mvc" Version="7.0.0" />
<PackageVersion Include="Aspire.Hosting.AppHost" Version="8.0.0-preview.7.24251.11" />
<PackageVersion Include="AutoFixture" Version="4.18.1" />
<PackageVersion Include="AutoFixture.AutoFakeItEasy" Version="4.18.1" />
<PackageVersion Include="AutoMapper" Version="13.0.1" />
<PackageVersion Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.2" />
<PackageVersion Include="Azure.Identity" Version="1.11.2" />
<PackageVersion Include="Azure.Identity" Version="1.11.3" />
<PackageVersion Include="Blazor-State" Version="11.0.0-beta.31" />
<PackageVersion Include="BlazorComponentUtilities" Version="1.8.0" />
<PackageVersion Include="FakeItEasy" Version="8.2.0" />
Expand All @@ -24,50 +25,57 @@
<PackageVersion Include="Grpc.Net.Client" Version="2.62.0" />
<PackageVersion Include="Grpc.Net.Client.Web" Version="2.62.0" />
<PackageVersion Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageVersion Include="libphonenumber-csharp" Version="8.13.37" />
<PackageVersion Include="MediatR" Version="12.2.0" />
<PackageVersion Include="MediatR.Contracts" Version="2.0.1" />
<PackageVersion Include="MicroElements.Swashbuckle.FluentValidation" Version="6.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.5" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.5" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.5" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.5" />
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.5" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.5" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Core" Version="1.1.0" />
<PackageVersion Include="Microsoft.Authentication.WebAssembly.Msal" Version="8.0.4" />
<PackageVersion Include="Microsoft.Authentication.WebAssembly.Msal" Version="8.0.5" />
<PackageVersion Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="7.2.0" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.9.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Cosmos" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Cosmos" Version="8.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.5" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.5" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.5.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="8.0.0-preview.7.24251.11" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery.Yarp" Version="8.0.1" />
<PackageVersion Include="Microsoft.FeatureManagement.AspNetCore" Version="2.5.1" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.7.2" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Emoji" Version="4.6.0" />
<PackageVersion Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.7.2" />
<PackageVersion Include="Microsoft.Identity.Web" Version="2.18.1" />
<PackageVersion Include="Microsoft.Playwright" Version="1.43.0" />
<PackageVersion Include="Microsoft.Tye.Extensions.Configuration" Version="0.10.0-alpha.21420.1" />
<PackageVersion Include="Microsoft.Identity.Web" Version="2.18.2" />
<PackageVersion Include="Microsoft.Playwright" Version="1.44.0" />
<PackageVersion Include="Microsoft.TypeScript.MSBuild" Version="4.6.2" />
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageVersion Include="Morris.Blazor.ControlFlow" Version="2.0.0" />
<PackageVersion Include="Morris.Blazor.FluentValidation" Version="3.0.0" />
<PackageVersion Include="Morris.Moxy" Version="1.10.0" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageVersion Include="Oakton" Version="6.1.0" />
<PackageVersion Include="Octokit.Webhooks.AspNetCore" Version="1.0.0" />
<PackageVersion Include="OneOf" Version="3.0.263" />
<PackageVersion Include="OneOf" Version="3.0.271" />
<PackageVersion Include="OneOf.SourceGenerator" Version="3.0.243" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.8.1" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.8.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.1" />
<PackageVersion Include="Riok.Mapperly" Version="3.5.1" />
<PackageVersion Include="Scrutor" Version="4.2.0" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.1" />
Expand All @@ -78,11 +86,11 @@
<PackageVersion Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.3.1" />
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="6.6.1" />
<PackageVersion Include="Swashbuckle.AspNetCore.Filters" Version="7.0.2" />
<PackageVersion Include="Swashbuckle.AspNetCore.Swagger" Version="6.5.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.Swagger" Version="6.6.1" />
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.6.1" />
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.6.1" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.0" />
<PackageVersion Include="System.ServiceModel.Primitives" Version="8.0.0" />
Expand All @@ -91,11 +99,12 @@
<PackageVersion Include="TimeWarp.State.Plus" Version="11.0.0-beta.31" />
<PackageVersion Include="Timewarp.OptionsValidation" Version="1.0.0-beta.2" />
<PackageVersion Include="Yarp.ReverseProxy" Version="2.1.0" />
<PackageVersion Include="libphonenumber-csharp" Version="8.13.37" />
<PackageVersion Include="protobuf-net.Grpc" Version="1.1.1" />
<PackageVersion Include="protobuf-net.Grpc.AspNetCore" Version="1.1.1" />
<PackageVersion Include="protobuf-net.Grpc.AspNetCore.Reflection" Version="1.1.1" />
<PackageVersion Include="protobuf-net.Grpc.Reflection" Version="1.1.1" />
<PackageVersion Include="timewarp-heroicons" Version="2.0.19" />
<PackageVersion Include="timewarp-simple-icons" Version="11.11.0" />
<PackageVersion Include="timewarp-simple-icons" Version="11.15.0" />
</ItemGroup>
</Project>
20 changes: 7 additions & 13 deletions TimeWarp.Architecture/Run.ps1
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
# Run.ps1
$Env:ASPNETCORE_ENVIRONMENT = "Development"

Push-Location $PSScriptRoot
try {
# Start Cosmos DB emulator
# see https://timewarpengineering.github.io/timewarp-architecture/#prerequisites
# Start-CosmosDbEmulator
# TODO add check for CosmosDB emulator to be running

Push-Location DevOps/Tye
# dotnet build -c Release
# tye run --dashboard --logs console -v Debug --no-build
tye run --dashboard --watch --logs console -v Debug
# Start-Process pwsh -argument '-nologo -noprofile -executionpolicy bypass -command tye run --dashboard --logs console'
Pop-Location
try
{
$projectPath = "Source/ContainerApps/Aspire/Aspire.AppHost/Aspire.AppHost.csproj"
dotnet run --project $projectPath
}
finally {
finally
{
Pop-Location
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
namespace TimeWarp.Architecture.Configuration;
public static class Constants
public static class ServiceNames
{
public const string ApiServiceName = "api-server";
public const string GrpcServiceName = "grpc-server";
public const string WebServiceName = "web-server";
public const string YarpServiceName = "yarp";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace TimeWarp.Architecture.Extensions;

public static class ServiceUriHelper
{
public static Uri? GetServiceHttpUri(string resourceName, int index = 0) =>
GetServiceUri(resourceName,"http", index);

public static Uri? GetServiceHttpsUri(string resourceName, int index = 0) =>
GetServiceUri(resourceName, "https", index);

private static Uri? GetServiceUri(string resourceName, string endpointName, int index)
{
Guard.Against.NullOrWhiteSpace(resourceName, nameof(resourceName));
Guard.Against.NullOrWhiteSpace(endpointName, nameof(endpointName));
Guard.Against.Negative(index, nameof(index));

string? url = Environment.GetEnvironmentVariable($"services__{resourceName}__{endpointName}__{index}");

return url is null ? null : new Uri(url);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
global using Azure.Identity;
global using Ardalis.GuardClauses;
global using Azure.Identity;
global using FluentValidation;
global using MediatR;
global using MicroElements.Swashbuckle.FluentValidation.AspNetCore;
global using Microsoft.AspNetCore.Builder;
global using Microsoft.AspNetCore.Http;
global using Microsoft.AspNetCore.Mvc;
global using Microsoft.AspNetCore.Routing;
global using Microsoft.Extensions.Configuration;
global using Microsoft.Extensions.DependencyInjection;
global using Microsoft.Extensions.Hosting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<ItemGroup>
<ProjectReference Include="..\..\..\Common\Common.Server\Common.Server.csproj" />
<ProjectReference Include="..\..\Aspire\Aspire.ServiceDefaults\Aspire.ServiceDefaults.csproj" />
<ProjectReference Include="..\Api.Infrastructure\Api.Infrastructure.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ public class Program : IAspNetProgram
public static Task<int> Main(string[] aArgumentArray)
{
WebApplicationBuilder builder = WebApplication.CreateBuilder(aArgumentArray);
builder.AddServiceDefaults();

ConfigureConfiguration(builder.Configuration);
ConfigureServices(builder.Services, builder.Configuration);

WebApplication webApplication = builder.Build();

webApplication.MapDefaultEndpoints();

webApplication.Services.ValidateOptions(builder.Services, webApplication.Logger);

ConfigureMiddleware(webApplication);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"profiles": {
"Api.Server": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:63612;http://localhost:63622"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireHost>true</IsAspireHost>
<UserSecretsId>a3d4de92-958f-4e04-b927-9d7605bee60e</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Api\Api.Server\Api.Server.csproj" />
<ProjectReference Include="..\..\Grpc\Grpc.Server\Grpc.Server.csproj" />
<ProjectReference Include="..\..\Web\Web.Server\Web.Server.csproj" />
<ProjectReference Include="..\..\Yarp\Yarp.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
IDistributedApplicationBuilder builder = DistributedApplication.CreateBuilder(args);

IResourceBuilder<ProjectResource> apiServer =builder.AddProject<Projects.Api_Server>("api-server");
IResourceBuilder<ProjectResource> grpcServer = builder.AddProject<Projects.Grpc_Server>("grpc-server");

IResourceBuilder<ProjectResource> webServer =
builder
.AddProject<Projects.Web_Server>("web-server")
.WithExternalHttpEndpoints()
.WithReference(apiServer)
.WithReference(grpcServer);

webServer.WithReference(webServer);

builder.AddProject<Projects.Yarp>("yarp")
.WithReference(apiServer)
.WithReference(webServer)
.WithReference(grpcServer);

builder.Build().Run();
Loading

0 comments on commit 91df4ab

Please sign in to comment.