Skip to content

Commit

Permalink
feat: create web entry point for the app #58
Browse files Browse the repository at this point in the history
  • Loading branch information
GenjiruSUchiwa committed Nov 23, 2024
1 parent 1da6953 commit 048835d
Show file tree
Hide file tree
Showing 29 changed files with 317 additions and 290 deletions.
25 changes: 0 additions & 25 deletions .dockerignore

This file was deleted.

1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<PackageVersion Include="NWebsec.AspNetCore.Core" Version="3.0.1" />
<PackageVersion Include="NWebsec.AspNetCore.Middleware" Version="3.0.0" />
<PackageVersion Include="Respawn" Version="6.2.1" />
<PackageVersion Include="Scalar.AspNetCore" Version="1.2.43" />
<PackageVersion Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Serilog.Settings.Configuration" Version="8.0.4" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.9.0" />
Expand Down
10 changes: 10 additions & 0 deletions Place.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DA61C0F8-3DDC-47E1-93A9-3ACB68AF4AEE}"
ProjectSection(SolutionItems) = preProject
Directory.Packages.props = Directory.Packages.props
compose.yaml = compose.yaml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Account", "Account", "{5B48E2F5-D7CC-48EA-94FE-A2F132650C8F}"
Expand Down Expand Up @@ -55,6 +56,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.MediatR", "src\Common\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{4B354D87-FCA4-46F3-A64E-76376D3C68C2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Api", "Api", "{CC68CA38-62BE-4535-9BB4-AB1597AFC90A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Place.API", "src\Place.API\Place.API.csproj", "{C4DD7B27-138C-4DFC-BC57-69BFC70853CA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -79,6 +84,7 @@ Global
{5453898F-4A78-4AD6-89B5-BAB204FF67FF} = {25654B5F-D4E9-4019-B307-8759C38E94A8}
{5B48E2F5-D7CC-48EA-94FE-A2F132650C8F} = {4B354D87-FCA4-46F3-A64E-76376D3C68C2}
{C3F80B30-C2DE-41DC-933A-A24E04827504} = {4B354D87-FCA4-46F3-A64E-76376D3C68C2}
{C4DD7B27-138C-4DFC-BC57-69BFC70853CA} = {CC68CA38-62BE-4535-9BB4-AB1597AFC90A}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1DFC8537-6B29-4BB5-8449-1910496DB479}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -143,5 +149,9 @@ Global
{5453898F-4A78-4AD6-89B5-BAB204FF67FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5453898F-4A78-4AD6-89B5-BAB204FF67FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5453898F-4A78-4AD6-89B5-BAB204FF67FF}.Release|Any CPU.Build.0 = Release|Any CPU
{C4DD7B27-138C-4DFC-BC57-69BFC70853CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C4DD7B27-138C-4DFC-BC57-69BFC70853CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4DD7B27-138C-4DFC-BC57-69BFC70853CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4DD7B27-138C-4DFC-BC57-69BFC70853CA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
place.api:
image: place.api
build:
context: .
dockerfile: src/Place.API/Dockerfile
7 changes: 4 additions & 3 deletions src/Account/AccountModule.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Threading.Tasks;
using Account.Data.Configurations;
using Account.Data.Seed;
using Core.EF;
Expand All @@ -22,17 +23,17 @@ IConfiguration configuration
nameof(Core.Identity),
configuration
);
services.AddScoped<IDataSeeder, AccountDataSeeder>();
services.AddScoped<IDataSeeder<AccountDbContext>, AccountDataSeeder>();
return services;
}

public static WebApplication UseAccountModule(
public static async Task<WebApplication> UseAccountModule(
this WebApplication app,
IWebHostEnvironment environment
)
{
app.UseCoreFramework();
app.UseMigration<AccountDbContext>(environment);
await app.UseMigrationAsync<AccountDbContext>(environment);
return app;
}
}
119 changes: 0 additions & 119 deletions src/Account/Data/Configurations/DatabaseInitializer.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Account/Data/Seed/AccountDataSeeder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Account.Data.Seed;

public class AccountDataSeeder(AccountDbContext context) : IDataSeeder
public class AccountDataSeeder(AccountDbContext context) : IDataSeeder<AccountDbContext>
{
public async Task SeedAllAsync()
{
Expand Down
3 changes: 3 additions & 0 deletions src/Account/IAccountRoot.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Account;

public interface IAccountRoot { }
3 changes: 0 additions & 3 deletions src/Account/IAssemblyMarker.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Account/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

WebApplication app = builder.Build();

app.UseAccountModule(environment);
await app.UseAccountModule(environment);

await app.RunAsync();
7 changes: 0 additions & 7 deletions src/Account/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,5 @@
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"Postgres": {
"Host": "localhost",
"Port": 5489,
"Username": "postgres",
"Password": "postgres",
"Database": "PlaceApiProfile"
}
}
25 changes: 5 additions & 20 deletions src/Account/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,10 @@
"app": {
"name": "Place Profile Api"
},
"serilog": {
"Serilog": {
"applicationName": "identity-service",
"excludePaths": ["/ping", "/metrics"],
"level": "information",
"overrides": {
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore.Database.Command": "Warning",
"Microsoft.EntityFrameworkCore.Infrastructure": "Warning"
},
"excludePaths": [
"/",
"/metrics",
"/ping"
],
"excludeProperties": [
"api_key",
"access_key",
"password",
"email"
],
"console": {
"enabled": true
},
Expand All @@ -37,9 +23,8 @@
"seq": {
"enabled": true,
"url": "http://localhost:5341",
"apiKey": "secret"
},
"tags": {}
"token": "secret"
}
},
"Swagger": {
"Title": "Place Profile Api",
Expand Down
4 changes: 3 additions & 1 deletion src/Common/Core.EF/IDataSeeder.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;

namespace Core.EF;

public interface IDataSeeder
public interface IDataSeeder<TContext>
where TContext : DbContext
{
Task SeedAllAsync();
}
Loading

0 comments on commit 048835d

Please sign in to comment.