Skip to content
Open
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
8 changes: 4 additions & 4 deletions Client.Wasm/Components/StudentCard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
</CardHeader>
<CardBody>
<UnorderedList Unstyled>
<UnorderedListItem>Номер <Strong>№X "Название лабораторной"</Strong></UnorderedListItem>
<UnorderedListItem>Вариант <Strong>№Х "Название варианта"</Strong></UnorderedListItem>
<UnorderedListItem>Выполнена <Strong>Фамилией Именем 65ХХ</Strong> </UnorderedListItem>
<UnorderedListItem><Link To="https://puginarug.com/">Ссылка на форк</Link></UnorderedListItem>
<UnorderedListItem>Номер <Strong>№3 "«Интеграционное тестирование» - Реализация файлового сервиса и объектного хранилища, интеграционное тестирование бекенда"</Strong></UnorderedListItem>
<UnorderedListItem>Вариант <Strong>№41 "Кредитная заявка "</Strong></UnorderedListItem>
<UnorderedListItem>Выполнена <Strong>Кадниковым Егором 6513</Strong> </UnorderedListItem>
<UnorderedListItem><Link To="https://github.com/acebiscuits/cloud-development">Ссылка на форк</Link></UnorderedListItem>
</UnorderedList>
</CardBody>
</Card>
16 changes: 8 additions & 8 deletions Client.Wasm/wwwroot/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"BaseAddress": "https://localhost:7170/land-plot"
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"BaseAddress": "https://localhost:7124/api/orders"
}
71 changes: 71 additions & 0 deletions CloudDevelopment.AppHost/AppHost.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using Amazon;
using Amazon.CDK.AWS.Servicecatalog;
using Aspire.Hosting.LocalStack.Container;
using LocalStack.Client.Enums;
using Microsoft.Extensions.Configuration;

var builder = DistributedApplication.CreateBuilder(args);

var ports = builder.Configuration.GetSection("ApiService:Ports").Get<int[]>()
?? throw new InvalidOperationException("ApiService:Ports is not configured.");

var cache = builder.AddRedis("credit-order-cache")
.WithRedisInsight(containerName: "credit-order-insight");

var awsConfig = builder.AddAWSSDKConfig()
.WithProfile("default")
.WithRegion(RegionEndpoint.EUCentral1);

var localstack = builder
.AddLocalStack("credid-order-localstack", awsConfig: awsConfig, configureContainer: container =>
{
container.Lifetime = ContainerLifetime.Session;
container.DebugLevel = 1;
container.LogLevel = LocalStackLogLevel.Debug;
container.Port = 4566;
container.AdditionalEnvironmentVariables
.Add("DEBUG", "1");
container.AdditionalEnvironmentVariables
.Add("SNS_CERT_URL_HOST", "sns.eu-central-1.amazonaws.com");
});

var cloudFormationTemplate = "CloudFormation/sqs-s3.yml";
var awsResources = builder.AddAWSCloudFormationTemplate("resources", cloudFormationTemplate, "credit-order")
.WithReference(awsConfig);

var gateway = builder.AddProject<Projects.Api_Gateway>("gateway");
for (var i = 0; i < ports.Length; i++)
{
var httpsPort = ports[i];
var httpPort = ports[i] - 1000;

var generator = builder.AddProject<Projects.Service_Api>($"generator-r{i + 1}", launchProfileName: null)
.WithReference(cache, "RedisCache")
.WithHttpEndpoint(httpPort)
.WithReference(awsResources)
.WithHttpsEndpoint(httpsPort)
.WaitFor(cache)
.WaitFor(awsResources);

gateway.WaitFor(generator);
}

builder.AddProject<Projects.Client_Wasm>("credit-order-wasm")
.WaitFor(gateway);

var sink = builder.AddProject<Projects.Service_Storage>("credit-order-sink")
.WithHttpEndpoint(5444)
.WithReference(awsResources)
.WithEnvironment("Settings__MessageBroker", "SQS")
.WithEnvironment("Settings__S3Hosting", "Minio")
.WaitFor(awsResources);

var minio = builder.AddMinioContainer("credit-order-minio");

sink.WithEnvironment("AWS__Resources__MinioBucketName", "credit-order-bucket")
.WithReference(minio)
.WaitFor(minio);

builder.UseLocalStack(localstack);

builder.Build().Run();
37 changes: 37 additions & 0 deletions CloudDevelopment.AppHost/CloudDevelopment.AppHost.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">

<Sdk Name="Aspire.AppHost.Sdk" Version="9.5.0" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UserSecretsId>2f419979-4dcb-43a3-bf86-3b5579f994b9</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.5.0" />
<PackageReference Include="Aspire.Hosting.Redis" Version="9.5.0" />
<PackageReference Include="CommunityToolkit.Aspire.Hosting.Minio" Version="9.9.0" />
<PackageReference Include="LocalStack.Aspire.Hosting" Version="9.5.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CreditOrder.Gateway\Api.Gateway.csproj" />
<ProjectReference Include="..\Generator\Service.Api.csproj" />
<ProjectReference Include="..\Client.Wasm\Client.Wasm.csproj" />
<ProjectReference Include="..\Service.Storage\Service.Storage.csproj" />
</ItemGroup>

<ItemGroup>
<Content Include="CloudFormation\sqs-s3.yml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<Folder Include="CloudFormation\" />
</ItemGroup>

</Project>
62 changes: 62 additions & 0 deletions CloudDevelopment.AppHost/CloudFormation/sqs-s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Cloud formation template for credit order project'

Parameters:
BucketName:
Type: String
Description: Name for the S3 bucket
Default: 'credit-order-bucket'

QueueName:
Type: String
Description: Name for the SQS queue
Default: 'credit-order-queue'

Resources:
CreditOrderBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref BucketName
VersioningConfiguration:
Status: Suspended
Tags:
- Key: Name
Value: !Ref BucketName
- Key: Environment
Value: Sample
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true

CreditOrderQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: !Ref QueueName
VisibilityTimeout: 30
MessageRetentionPeriod: 345600
DelaySeconds: 0
ReceiveMessageWaitTimeSeconds: 0
Tags:
- Key: Name
Value: !Ref QueueName
- Key: Environment
Value: Sample

Outputs:
S3BucketName:
Description: Name of the S3 bucket
Value: !Ref CreditOrderBucket

S3BucketArn:
Description: ARN of the S3 bucket
Value: !GetAtt CreditOrderBucket.Arn

SQSQueueName:
Description: Name of the SQS queue
Value: !GetAtt CreditOrderQueue.QueueName

SQSQueueArn:
Description: ARN of the SQS queue
Value: !GetAtt CreditOrderQueue.Arn
29 changes: 29 additions & 0 deletions CloudDevelopment.AppHost/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:17129;http://localhost:15221",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21101",
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22255"
}
},
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:15221",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19083",
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20274"
}
}
}
}
8 changes: 8 additions & 0 deletions CloudDevelopment.AppHost/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
8 changes: 8 additions & 0 deletions CloudDevelopment.AppHost/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ApiService": {
"Ports": [ 7241, 7242, 7243, 7244, 7245 ]
},
"LocalStack": {
"UseLocalStack": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireSharedProject>true</IsAspireSharedProject>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />

<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.9.0" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="9.5.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
</ItemGroup>

</Project>
Loading
Loading