diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index ab0818f..0000000 --- a/.dockerignore +++ /dev/null @@ -1,63 +0,0 @@ -# Build artifacts -**/bin/ -**/obj/ -**/out/ -**/publish/ - -# IDE and editor files -**/.vs/ -**/.vscode/ -**/.idea/ -**/.DS_Store -**/*.user -**/*.suo -**/*.userosscache -**/*.sln.docstates -**/*.userprefs -**/.fleet/ - -# Database files -**/*.dbmdl -**/*.jfm -**/*.mdf -**/*.ldf - -# Temp and swap files -**/*.swp -**/*.swo -**/*~ -**/*.tmp -**/*.temp - -# Logs -**/*.log - -# Node modules (if any frontend dependencies) -**/node_modules/ - -# Git files -.git/ -.gitignore -.gitattributes -.git-crypt/ - -# Documentation -README.md -**/*.md -LICENSE - -# Docker files -docker-compose.yml -docker-compose.*.yml -**/Dockerfile -**/.dockerignore - -# Development databases -docker/ - -# Test results -**/TestResults/ -**/*.trx - -# macOS -.DS_Store \ No newline at end of file diff --git a/.git-crypt/.gitattributes b/.git-crypt/.gitattributes deleted file mode 100644 index 665b10e..0000000 --- a/.git-crypt/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -# Do not edit this file. To specify the files to encrypt, create your own -# .gitattributes file in the directory where your files are. -* !filter !diff -*.gpg binary diff --git a/.git-crypt/keys/default/0/A5054453396157A650BCEF41413B052D24F5B418.gpg b/.git-crypt/keys/default/0/A5054453396157A650BCEF41413B052D24F5B418.gpg deleted file mode 100644 index 5868b80..0000000 Binary files a/.git-crypt/keys/default/0/A5054453396157A650BCEF41413B052D24F5B418.gpg and /dev/null differ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 92c30c8..0000000 --- a/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -BimAI.API/appsettings.Development.json filter=git-crypt diff=git-crypt -BimAI.UI.Web/appsettings.Development.json filter=git-crypt diff=git-crypt -BimAI.UI.Mobile/appsettings.Development.json filter=git-crypt diff=git-crypt \ No newline at end of file diff --git a/BimAI.API/BimAI.API.csproj b/BimAI.API/BimAI.API.csproj index 2374ce7..226964b 100644 --- a/BimAI.API/BimAI.API.csproj +++ b/BimAI.API/BimAI.API.csproj @@ -1,29 +1,29 @@ - - - - net8.0 - enable - enable - - - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - - - - - + + + + net8.0 + enable + enable + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + diff --git a/BimAI.API/BimAI.API.http b/BimAI.API/BimAI.API.http index 79ef21c..b08c02d 100644 --- a/BimAI.API/BimAI.API.http +++ b/BimAI.API/BimAI.API.http @@ -1,6 +1,6 @@ -@BimAI.API_HostAddress = http://localhost:5090 - -GET {{BimAI.API_HostAddress}}/weatherforecast/ -Accept: application/json - -### +@BimAI.API_HostAddress = http://localhost:5090 + +GET {{BimAI.API_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/BimAI.API/Program.cs b/BimAI.API/Program.cs index b3c729f..1ae4034 100644 --- a/BimAI.API/Program.cs +++ b/BimAI.API/Program.cs @@ -1,145 +1,145 @@ -using System.Text; -using BimAI.API.Services; -using BimAI.Infrastructure.Data; -using BimAI.Infrastructure.Jobs; -using BimAI.Infrastructure.Sync; -using Hangfire; -using Hangfire.SqlServer; -using Microsoft.EntityFrameworkCore; -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.IdentityModel.Tokens; - - -var builder = WebApplication.CreateBuilder(args); - -var connectionString = builder.Configuration.GetConnectionString("DefaultConnection"); -builder.Services.AddDbContext(options => options.UseSqlServer(connectionString)); -builder.Services.AddScoped(); - -builder.Services.AddHttpClient(); -builder.Services.AddControllers(); -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); - -// Start Hangfire section -builder.Services.AddHangfire(configuration => configuration - .SetDataCompatibilityLevel(CompatibilityLevel.Version_180) - .UseSimpleAssemblyNameTypeSerializer() - .UseRecommendedSerializerSettings() - .UseSqlServerStorage(builder.Configuration.GetConnectionString("HangfireConnection"), - new SqlServerStorageOptions - { - CommandBatchMaxTimeout = TimeSpan.FromMinutes(5), - SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5), - QueuePollInterval = TimeSpan.Zero, - UseRecommendedIsolationLevel = true, - DisableGlobalLocks = true, - SchemaName = "Hangfire" - } - ) -); -builder.Services.AddHangfireServer(options => -{ - options.ServerName = builder.Configuration["Hangfire:ServerName"]; - options.WorkerCount = builder.Configuration.GetValue("Hangfire:WorkerCount", 5); -}); -// End Hangfire section -// Start auth section -var jwtSettings = builder.Configuration.GetSection("JwtSettings"); -var secretKey = jwtSettings["SecretKey"]; -var issuer = jwtSettings["Issuer"]; -var audience = jwtSettings["Audience"]; - -builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) - .AddJwtBearer(options => - { - options.TokenValidationParameters = new TokenValidationParameters - { - ValidateIssuer = true, - ValidateAudience = true, - ValidateLifetime = true, - ValidateIssuerSigningKey = true, - ValidIssuer = issuer, - ValidAudience = audience, - IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(secretKey)), - ClockSkew = TimeSpan.Zero, - }; - }); -builder.Services.AddAuthentication(); - -builder.Services.AddScoped(); -builder.Services.AddScoped(); - -builder.Services.AddCors(options => -{ - options.AddPolicy("AllowAll", policy => - { - policy.AllowAnyOrigin() - .AllowAnyMethod() - .AllowAnyHeader(); - }); -}); -// End auth section - -var app = builder.Build(); - -// Auto-apply migrations on startup -using (var scope = app.Services.CreateScope()) -{ - var db = scope.ServiceProvider.GetRequiredService(); - - try - { - var pending = await db.Database.GetPendingMigrationsAsync(); - if (pending.Any()) - { - app.Logger.LogWarning("Applying {Count} pending migrations: {List}", - pending.Count(), string.Join(", ", pending)); - await db.Database.MigrateAsync(); - app.Logger.LogInformation("Migrations applied successfully."); - } - else - { - app.Logger.LogInformation("No pending migrations."); - } - } - catch (Exception ex) - { - app.Logger.LogCritical(ex, "Migration failed - application will not start."); - throw; // stop startup - } -} - -if (app.Environment.IsDevelopment()) -{ - app.UseSwagger(); - app.UseSwaggerUI(); -} - -app.UseHttpsRedirection(); -app.UseCors("AllowAll"); -app.UseHangfireDashboard(builder.Configuration["Hangfire:DashboardPath"] ?? "/hangfire", new DashboardOptions -{ - AsyncAuthorization = new[] { new HangfireAuthorizationFilter() }, - DashboardTitle = "BimAI - Job Dashboard" -}); -app.UseAuthorization(); -app.UseAuthorization(); -app.MapControllers(); - -app.MapGet("/health", () => Results.Ok(new { status = "OK", timestamp = DateTime.UtcNow })) - .AllowAnonymous(); - -RecurringJob.AddOrUpdate( - "product-sync", - job => job.ExecuteAsync(), - Cron.Daily(2, 0), // Every day at 2:00 AM - new RecurringJobOptions - { - TimeZone = TimeZoneInfo.Local, - MisfireHandling = app.Environment.IsDevelopment() - ? MisfireHandlingMode.Relaxed - : MisfireHandlingMode.Strict - }); - +using System.Text; +using BimAI.API.Services; +using BimAI.Infrastructure.Data; +using BimAI.Infrastructure.Jobs; +using BimAI.Infrastructure.Sync; +using Hangfire; +using Hangfire.SqlServer; +using Microsoft.EntityFrameworkCore; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.IdentityModel.Tokens; + + +var builder = WebApplication.CreateBuilder(args); + +var connectionString = builder.Configuration.GetConnectionString("DefaultConnection"); +builder.Services.AddDbContext(options => options.UseSqlServer(connectionString)); +builder.Services.AddScoped(); + +builder.Services.AddHttpClient(); +builder.Services.AddControllers(); +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +// Start Hangfire section +builder.Services.AddHangfire(configuration => configuration + .SetDataCompatibilityLevel(CompatibilityLevel.Version_180) + .UseSimpleAssemblyNameTypeSerializer() + .UseRecommendedSerializerSettings() + .UseSqlServerStorage(builder.Configuration.GetConnectionString("HangfireConnection"), + new SqlServerStorageOptions + { + CommandBatchMaxTimeout = TimeSpan.FromMinutes(5), + SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5), + QueuePollInterval = TimeSpan.Zero, + UseRecommendedIsolationLevel = true, + DisableGlobalLocks = true, + SchemaName = "Hangfire" + } + ) +); +builder.Services.AddHangfireServer(options => +{ + options.ServerName = builder.Configuration["Hangfire:ServerName"]; + options.WorkerCount = builder.Configuration.GetValue("Hangfire:WorkerCount", 5); +}); +// End Hangfire section +// Start auth section +var jwtSettings = builder.Configuration.GetSection("JwtSettings"); +var secretKey = jwtSettings["SecretKey"]; +var issuer = jwtSettings["Issuer"]; +var audience = jwtSettings["Audience"]; + +builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + .AddJwtBearer(options => + { + options.TokenValidationParameters = new TokenValidationParameters + { + ValidateIssuer = true, + ValidateAudience = true, + ValidateLifetime = true, + ValidateIssuerSigningKey = true, + ValidIssuer = issuer, + ValidAudience = audience, + IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(secretKey)), + ClockSkew = TimeSpan.Zero, + }; + }); +builder.Services.AddAuthentication(); + +builder.Services.AddScoped(); +builder.Services.AddScoped(); + +builder.Services.AddCors(options => +{ + options.AddPolicy("AllowAll", policy => + { + policy.AllowAnyOrigin() + .AllowAnyMethod() + .AllowAnyHeader(); + }); +}); +// End auth section + +var app = builder.Build(); + +// Auto-apply migrations on startup +using (var scope = app.Services.CreateScope()) +{ + var db = scope.ServiceProvider.GetRequiredService(); + + try + { + var pending = await db.Database.GetPendingMigrationsAsync(); + if (pending.Any()) + { + app.Logger.LogWarning("Applying {Count} pending migrations: {List}", + pending.Count(), string.Join(", ", pending)); + await db.Database.MigrateAsync(); + app.Logger.LogInformation("Migrations applied successfully."); + } + else + { + app.Logger.LogInformation("No pending migrations."); + } + } + catch (Exception ex) + { + app.Logger.LogCritical(ex, "Migration failed - application will not start."); + throw; // stop startup + } +} + +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); +app.UseCors("AllowAll"); +app.UseHangfireDashboard(builder.Configuration["Hangfire:DashboardPath"] ?? "/hangfire", new DashboardOptions +{ + AsyncAuthorization = new[] { new HangfireAuthorizationFilter() }, + DashboardTitle = "BimAI - Job Dashboard" +}); +app.UseAuthorization(); +app.UseAuthorization(); +app.MapControllers(); + +app.MapGet("/health", () => Results.Ok(new { status = "OK", timestamp = DateTime.UtcNow })) + .AllowAnonymous(); + +RecurringJob.AddOrUpdate( + "product-sync", + job => job.ExecuteAsync(), + Cron.Daily(2, 0), // Every day at 2:00 AM + new RecurringJobOptions + { + TimeZone = TimeZoneInfo.Local, + MisfireHandling = app.Environment.IsDevelopment() + ? MisfireHandlingMode.Relaxed + : MisfireHandlingMode.Strict + }); + app.Run(); \ No newline at end of file diff --git a/BimAI.API/Properties/launchSettings.json b/BimAI.API/Properties/launchSettings.json index 59e80da..6fe39d5 100644 --- a/BimAI.API/Properties/launchSettings.json +++ b/BimAI.API/Properties/launchSettings.json @@ -1,14 +1,14 @@ -{ - "profiles": { - "dev": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "http://localhost:7142;http://0.0.0.0:7142", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } +{ + "profiles": { + "dev": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:7142;http://0.0.0.0:7142", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } } \ No newline at end of file diff --git a/BimAI.API/appsettings.Development.json b/BimAI.API/appsettings.Development.json index e288f74..1183cd3 100644 Binary files a/BimAI.API/appsettings.Development.json and b/BimAI.API/appsettings.Development.json differ diff --git a/BimAI.API/appsettings.Production.json b/BimAI.API/appsettings.Production.json index 25a1fd0..d5ca3f4 100644 --- a/BimAI.API/appsettings.Production.json +++ b/BimAI.API/appsettings.Production.json @@ -1,38 +1,25 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning", - "Microsoft.EntityFrameworkCore": "Warning" - } - }, - "AllowedHosts": "*", - "ConnectionStrings": { - "DefaultConnection": "#{db-connection-string}#", - "HangfireConnection": "#{hangfire-connection-string}#" - }, - "E5_CRM": { - "ApiKey": "#{e5-crm-api-key}#" - }, - "GoogleAuth": { - "ClientId": "#{google-auth-client-id}#" - }, - "JwtSettings": { - "SecretKey": "#{jwt-secret-key}#", - "Issuer": "#{jwt-issuer}#", - "Audience": "#{jwt-audience}#", - "ExpiryDays": 7 - }, - "Hangfire": { - "ServerName": "#{hangfire-server-name}#", - "WorkerCount": 5, - "DashboardPath": "/hangfire" - }, - "Kestrel": { - "Endpoints": { - "Http": { - "Url": "http://0.0.0.0:7142" - } - } - } -} \ No newline at end of file +{ + "ConnectionStrings": { + "DefaultConnection": "", + "HangfireConnection": "" + }, + "E5_CRM": { + "ApiKey": "" + }, + "GoogleAuth": { + "ClientId": "" + }, + "JwtSettings": { + "SecretKey": "" + }, + "Hangfire": { + "ServerName": "BimAI-Production" + }, + "Kestrel": { + "Endpoints": { + "Http": { + "Url": "http://0.0.0.0:7142" + } + } + } +} diff --git a/BimAI.API/appsettings.json b/BimAI.API/appsettings.json new file mode 100644 index 0000000..0867fcf --- /dev/null +++ b/BimAI.API/appsettings.json @@ -0,0 +1,21 @@ +{ + "AllowedHosts": "*", + "JwtSettings": { + "Issuer": "BimAI.API", + "Audience": "BimAI.Clients", + "ExpiryDays": 7 + }, + "Hangfire": { + "WorkerCount": 5, + "DashboardPath": "/hangfire" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Microsoft.EntityFrameworkCore": "Warning", + "Microsoft.EntityFrameworkCore.Database.Command": "Warning", + "Microsoft.EntityFrameworkCore.Infrastructure": "Warning" + } + } +} diff --git a/BimAI.Application/BimAI.Application.csproj b/BimAI.Application/BimAI.Application.csproj index e16c50a..cc5734f 100644 --- a/BimAI.Application/BimAI.Application.csproj +++ b/BimAI.Application/BimAI.Application.csproj @@ -1,13 +1,13 @@ - - - - - - - - net8.0 - enable - enable - - - + + + + + + + + net8.0 + enable + enable + + + diff --git a/BimAI.Domain/BimAI.Domain.csproj b/BimAI.Domain/BimAI.Domain.csproj index fa71b7a..bb23fb7 100644 --- a/BimAI.Domain/BimAI.Domain.csproj +++ b/BimAI.Domain/BimAI.Domain.csproj @@ -1,9 +1,9 @@ - - - - net8.0 - enable - enable - - - + + + + net8.0 + enable + enable + + + diff --git a/BimAI.Infrastructure/BimAI.Infrastructure.csproj b/BimAI.Infrastructure/BimAI.Infrastructure.csproj index 5b7cb5e..2953e1d 100644 --- a/BimAI.Infrastructure/BimAI.Infrastructure.csproj +++ b/BimAI.Infrastructure/BimAI.Infrastructure.csproj @@ -1,23 +1,23 @@ - - - - - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - net8.0 - enable - enable - - - + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + net8.0 + enable + enable + + + diff --git a/BimAI.UI.Mobile/appsettings.Development.json b/BimAI.UI.Mobile/appsettings.Development.json index 52f5415..550f264 100644 Binary files a/BimAI.UI.Mobile/appsettings.Development.json and b/BimAI.UI.Mobile/appsettings.Development.json differ diff --git a/BimAI.UI.Shared/BimAI.UI.Shared.csproj b/BimAI.UI.Shared/BimAI.UI.Shared.csproj index 9fbbeed..2ca0c6a 100644 --- a/BimAI.UI.Shared/BimAI.UI.Shared.csproj +++ b/BimAI.UI.Shared/BimAI.UI.Shared.csproj @@ -1,30 +1,30 @@ - - - - net8.0 - enable - enable - - - - - - - - - - - - - - - - - - - - - - - - + + + + net8.0 + enable + enable + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BimAI.UI.Shared/_Imports.razor b/BimAI.UI.Shared/_Imports.razor index 1405344..735b66c 100644 --- a/BimAI.UI.Shared/_Imports.razor +++ b/BimAI.UI.Shared/_Imports.razor @@ -1,12 +1,12 @@ -@using System.Net.Http -@using System.Net.Http.Json -@using Microsoft.AspNetCore.Components.Forms -@using Microsoft.AspNetCore.Components.Routing -@using Microsoft.AspNetCore.Components.Web -@using static Microsoft.AspNetCore.Components.Web.RenderMode -@using Microsoft.AspNetCore.Components.Web.Virtualization -@using Microsoft.JSInterop -@using BimAI.UI.Shared +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using static Microsoft.AspNetCore.Components.Web.RenderMode +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.JSInterop +@using BimAI.UI.Shared @using MudBlazor@using BimAI.Application.DTOModels @using BimAI.Application.DTOModels.Common @using BimAI.UI.Shared.Components diff --git a/BimAI.UI.Web/appsettings.Development.json b/BimAI.UI.Web/appsettings.Development.json index ee0eac4..2582959 100644 Binary files a/BimAI.UI.Web/appsettings.Development.json and b/BimAI.UI.Web/appsettings.Development.json differ diff --git a/BimAI.UI.Web/appsettings.Production.json b/BimAI.UI.Web/appsettings.Production.json index b2c34ee..978a255 100644 --- a/BimAI.UI.Web/appsettings.Production.json +++ b/BimAI.UI.Web/appsettings.Production.json @@ -1,16 +1,9 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "ApiSettings": { - "BaseUrl": "#{api-base-url}#" - }, "GoogleAuth": { - "ClientId": "#{google-auth-client-id}#" + "ClientId": "" + }, + "ApiSettings": { + "BaseUrl": "" }, "Kestrel": { "Endpoints": { @@ -19,4 +12,4 @@ } } } -} \ No newline at end of file +} diff --git a/BimAI.UI.Web/appsettings.json b/BimAI.UI.Web/appsettings.json new file mode 100644 index 0000000..5d8ba2e --- /dev/null +++ b/BimAI.UI.Web/appsettings.json @@ -0,0 +1,9 @@ +{ + "AllowedHosts": "*", + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/BimAI.sln b/BimAI.sln index 01e72f8..b8ee62d 100644 --- a/BimAI.sln +++ b/BimAI.sln @@ -1,58 +1,58 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.Domain", "BimAI.Domain\BimAI.Domain.csproj", "{190E3B1F-C91F-430F-BE32-4E7221574D36}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.Application", "BimAI.Application\BimAI.Application.csproj", "{2E61A11C-851F-47D6-A8B6-329078CF1AFC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.Infrastructure", "BimAI.Infrastructure\BimAI.Infrastructure.csproj", "{1049E8B5-6965-4CCD-A989-88E44D40BF48}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.API", "BimAI.API\BimAI.API.csproj", "{02FF9A1C-6D22-4CD1-8FE6-DD5BCDD621DA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.UI.Shared", "BimAI.UI.Shared\BimAI.UI.Shared.csproj", "{0EB8CFFF-97BA-48D1-BEC1-2DFD6C934946}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.UI.Web", "BimAI.UI.Web\BimAI.UI.Web.csproj", "{7ACBFE74-E72C-4033-9172-30512233A518}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.UI.Mobile", "BimAI.UI.Mobile\BimAI.UI.Mobile.csproj", "{12FB8E56-08C1-47CF-B0FC-4BE9F01F020A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {190E3B1F-C91F-430F-BE32-4E7221574D36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {190E3B1F-C91F-430F-BE32-4E7221574D36}.Debug|Any CPU.Build.0 = Debug|Any CPU - {190E3B1F-C91F-430F-BE32-4E7221574D36}.Release|Any CPU.ActiveCfg = Release|Any CPU - {190E3B1F-C91F-430F-BE32-4E7221574D36}.Release|Any CPU.Build.0 = Release|Any CPU - {2E61A11C-851F-47D6-A8B6-329078CF1AFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E61A11C-851F-47D6-A8B6-329078CF1AFC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E61A11C-851F-47D6-A8B6-329078CF1AFC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E61A11C-851F-47D6-A8B6-329078CF1AFC}.Release|Any CPU.Build.0 = Release|Any CPU - {1049E8B5-6965-4CCD-A989-88E44D40BF48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1049E8B5-6965-4CCD-A989-88E44D40BF48}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1049E8B5-6965-4CCD-A989-88E44D40BF48}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1049E8B5-6965-4CCD-A989-88E44D40BF48}.Release|Any CPU.Build.0 = Release|Any CPU - {02FF9A1C-6D22-4CD1-8FE6-DD5BCDD621DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {02FF9A1C-6D22-4CD1-8FE6-DD5BCDD621DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {02FF9A1C-6D22-4CD1-8FE6-DD5BCDD621DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {02FF9A1C-6D22-4CD1-8FE6-DD5BCDD621DA}.Release|Any CPU.Build.0 = Release|Any CPU - {0EB8CFFF-97BA-48D1-BEC1-2DFD6C934946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0EB8CFFF-97BA-48D1-BEC1-2DFD6C934946}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0EB8CFFF-97BA-48D1-BEC1-2DFD6C934946}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0EB8CFFF-97BA-48D1-BEC1-2DFD6C934946}.Release|Any CPU.Build.0 = Release|Any CPU - {7ACBFE74-E72C-4033-9172-30512233A518}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7ACBFE74-E72C-4033-9172-30512233A518}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7ACBFE74-E72C-4033-9172-30512233A518}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7ACBFE74-E72C-4033-9172-30512233A518}.Release|Any CPU.Build.0 = Release|Any CPU - {12FB8E56-08C1-47CF-B0FC-4BE9F01F020A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {12FB8E56-08C1-47CF-B0FC-4BE9F01F020A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {12FB8E56-08C1-47CF-B0FC-4BE9F01F020A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {12FB8E56-08C1-47CF-B0FC-4BE9F01F020A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.Domain", "BimAI.Domain\BimAI.Domain.csproj", "{190E3B1F-C91F-430F-BE32-4E7221574D36}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.Application", "BimAI.Application\BimAI.Application.csproj", "{2E61A11C-851F-47D6-A8B6-329078CF1AFC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.Infrastructure", "BimAI.Infrastructure\BimAI.Infrastructure.csproj", "{1049E8B5-6965-4CCD-A989-88E44D40BF48}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.API", "BimAI.API\BimAI.API.csproj", "{02FF9A1C-6D22-4CD1-8FE6-DD5BCDD621DA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.UI.Shared", "BimAI.UI.Shared\BimAI.UI.Shared.csproj", "{0EB8CFFF-97BA-48D1-BEC1-2DFD6C934946}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.UI.Web", "BimAI.UI.Web\BimAI.UI.Web.csproj", "{7ACBFE74-E72C-4033-9172-30512233A518}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BimAI.UI.Mobile", "BimAI.UI.Mobile\BimAI.UI.Mobile.csproj", "{12FB8E56-08C1-47CF-B0FC-4BE9F01F020A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {190E3B1F-C91F-430F-BE32-4E7221574D36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {190E3B1F-C91F-430F-BE32-4E7221574D36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {190E3B1F-C91F-430F-BE32-4E7221574D36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {190E3B1F-C91F-430F-BE32-4E7221574D36}.Release|Any CPU.Build.0 = Release|Any CPU + {2E61A11C-851F-47D6-A8B6-329078CF1AFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E61A11C-851F-47D6-A8B6-329078CF1AFC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E61A11C-851F-47D6-A8B6-329078CF1AFC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E61A11C-851F-47D6-A8B6-329078CF1AFC}.Release|Any CPU.Build.0 = Release|Any CPU + {1049E8B5-6965-4CCD-A989-88E44D40BF48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1049E8B5-6965-4CCD-A989-88E44D40BF48}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1049E8B5-6965-4CCD-A989-88E44D40BF48}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1049E8B5-6965-4CCD-A989-88E44D40BF48}.Release|Any CPU.Build.0 = Release|Any CPU + {02FF9A1C-6D22-4CD1-8FE6-DD5BCDD621DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {02FF9A1C-6D22-4CD1-8FE6-DD5BCDD621DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {02FF9A1C-6D22-4CD1-8FE6-DD5BCDD621DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {02FF9A1C-6D22-4CD1-8FE6-DD5BCDD621DA}.Release|Any CPU.Build.0 = Release|Any CPU + {0EB8CFFF-97BA-48D1-BEC1-2DFD6C934946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0EB8CFFF-97BA-48D1-BEC1-2DFD6C934946}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EB8CFFF-97BA-48D1-BEC1-2DFD6C934946}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0EB8CFFF-97BA-48D1-BEC1-2DFD6C934946}.Release|Any CPU.Build.0 = Release|Any CPU + {7ACBFE74-E72C-4033-9172-30512233A518}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7ACBFE74-E72C-4033-9172-30512233A518}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7ACBFE74-E72C-4033-9172-30512233A518}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7ACBFE74-E72C-4033-9172-30512233A518}.Release|Any CPU.Build.0 = Release|Any CPU + {12FB8E56-08C1-47CF-B0FC-4BE9F01F020A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12FB8E56-08C1-47CF-B0FC-4BE9F01F020A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12FB8E56-08C1-47CF-B0FC-4BE9F01F020A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12FB8E56-08C1-47CF-B0FC-4BE9F01F020A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/docker-compose.yml b/docker-compose.yml index 96ad1b5..89ed8e3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,38 +11,34 @@ services: - "1433:1433" volumes: - mssql-data:/var/opt/mssql - - ./docker/mssql/init:/docker-entrypoint-initdb.d networks: - bimai-network healthcheck: - test: /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "BimAI_Dev_Pass_2024!" -Q "SELECT 1" || exit 1 + test: /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "BimAI_Dev_Pass_2024!" -C -Q "SELECT 1" || exit 1 interval: 10s timeout: 3s retries: 10 start_period: 10s - mongodb: - image: mongo:7.0 - container_name: bimai-mongodb - hostname: bimai-mongodb - environment: - - MONGO_INITDB_ROOT_USERNAME=admin - - MONGO_INITDB_ROOT_PASSWORD=BimAI_Mongo_2024! - - MONGO_INITDB_DATABASE=bimai - ports: - - "27017:27017" - volumes: - - mongodb-data:/data/db - - mongodb-config:/data/configdb - - ./docker/mongodb/init:/docker-entrypoint-initdb.d + init-mssql: + image: mcr.microsoft.com/mssql/server:2022-latest + container_name: bimai-init-mssql + restart: "no" networks: - bimai-network - healthcheck: - test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet - interval: 10s - timeout: 5s - retries: 5 - start_period: 10s + depends_on: + mssql: + condition: service_healthy + environment: + - MSSQL_SA_PASSWORD=BimAI_Dev_Pass_2024! + entrypoint: >- + bash -lc " + set -e + for i in {1..30}; do + /opt/mssql-tools18/bin/sqlcmd -S bimai-mssql -U sa -P \"$$MSSQL_SA_PASSWORD\" -C -Q \"SELECT 1\" && break || sleep 2; + done; + /opt/mssql-tools18/bin/sqlcmd -S bimai-mssql -U sa -P \"$$MSSQL_SA_PASSWORD\" -C -Q \"IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = N'bimai') CREATE DATABASE [bimai];\" + " networks: bimai-network: @@ -51,7 +47,3 @@ networks: volumes: mssql-data: name: bimai-mssql-data - mongodb-data: - name: bimai-mongodb-data - mongodb-config: - name: bimai-mongodb-config \ No newline at end of file