Compare commits

...

4 Commits

Author SHA1 Message Date
James Wampler
e3b8cd9067 Fix build errors and enable TreatWarningsAsErrors across all projects
Remove duplicate source files from old ApiKeys/, Authentication/, and
Authorization/ folders that were already migrated to Common/Security/.
Update test namespace usings to match. Pin EFC Relational 10.0.5 to
resolve MSB3277 version conflict with Npgsql's transitive dependency.
Add LangVersion and TreatWarningsAsErrors to AppHost and ServiceDefaults.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 13:19:59 -07:00
James Wampler
570ab363c2 WIP 2026-06-10 13:06:55 -07:00
James Wampler
4621e8380b Add MicCheck.Api.Tests.Integration project
NUnit integration tests that target a running API by URL and seed/clean
data directly in Postgres. Settings (BaseUrl, DbConnectionString) come
from .runsettings or environment variables so tests can be pointed at
any environment. HTTP requests live in HttpFiles/*.http; assertion
failures include a fresh DB snapshot of the relevant rows. First test
covers the flag-enabled path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-03 19:12:47 -07:00
James Wampler
d3b36956e4 New project file, added Aspire, moved security 2026-06-03 18:44:48 -07:00
965 changed files with 21622 additions and 38760 deletions

0
.editorconfig Normal file → Executable file
View File

0
.gitignore vendored Normal file → Executable file
View File

0
.vscode/settings.json vendored Normal file → Executable file
View File

7
CLAUDE.md Normal file → Executable file
View File

@@ -24,10 +24,17 @@ MicCheck: open source. asp.net, c#, typescript, VueJS. Manages feature flags, pr
# Coding
- Descriptive names for all classes/methods. No generic names: Provider, Manager, Helper
- Match formatting/style from `.editorconfig`
- Wrap lines at 220 characters, leave single line if fewer
- Place interfaces that are implemented by a single class at the bottom of the class file. An interface with multiple implementations of an interface should be in a seperate file.
- Do not use tuples for return types. Prefer records or classes for multiple values
- Do not use `sealed` on classes-
- Use `record` for data objects, `class` for objects with behavior. Avoid mutable state where possible.
## Testing
- BDD-style unit tests, end-to-end as possible, no external resources (DB, filesystem). e.g. `WhenAUserDoesSomething_ThenAThingAppears`
- Mock external deps with Moq
- New features need unit tests covering as much logic as possible
- Any modified file: evaluate for missing test coverage-
- No "Mock" in mocked object names
- No Arrange/Act/Assert comments

0
CLAUDE.original.md Normal file → Executable file
View File

19098
MicCheck.slnx Normal file → Executable file

File diff suppressed because it is too large Load Diff

0
docker-compose.yml Normal file → Executable file
View File

0
docs/admin/00-New-Website-output.md Normal file → Executable file
View File

0
docs/admin/00-New-Website.md Normal file → Executable file
View File

0
docs/admin/01-admin-site_plan.md Normal file → Executable file
View File

0
docs/api/00 - new-aspnet-project.md Normal file → Executable file
View File

0
docs/api/00-output.md Normal file → Executable file
View File

0
docs/api/01_project_setup.md Normal file → Executable file
View File

0
docs/api/01_project_setup_output.md Normal file → Executable file
View File

0
docs/api/02_core_domain_models.md Normal file → Executable file
View File

0
docs/api/02_core_domain_models_output.md Normal file → Executable file
View File

0
docs/api/03_database_and_repositories.md Normal file → Executable file
View File

0
docs/api/03_database_and_repositories_output.md Normal file → Executable file
View File

0
docs/api/04_authentication_and_authorization.md Normal file → Executable file
View File

0
docs/api/04_authentication_and_authorization_output.md Normal file → Executable file
View File

0
docs/api/05_flags_api.md Normal file → Executable file
View File

0
docs/api/05_flags_api_output.md Normal file → Executable file
View File

0
docs/api/06_admin_api.md Normal file → Executable file
View File

0
docs/api/06_admin_api_output.md Normal file → Executable file
View File

0
docs/api/07_audit_and_webhooks.md Normal file → Executable file
View File

0
docs/api/07_audit_and_webhooks_output.md Normal file → Executable file
View File

0
docs/api/08_testing_strategy.md Normal file → Executable file
View File

0
dotnet-install.sh vendored Normal file → Executable file
View File

0
dotnet-tools.json Normal file → Executable file
View File

0
readme.md Normal file → Executable file
View File

View File

@@ -0,0 +1,9 @@
var builder = DistributedApplication.CreateBuilder(args);
var postgres = builder.AddPostgres("postgres").WithDataVolume("miccheck-pgdata").WithPgAdmin();
var miccheckDb = postgres.AddDatabase("miccheck");
builder.AddProject<Projects.MicCheck_Api>("api").WithReference(miccheckDb).WaitFor(miccheckDb);
builder.Build().Run();

View File

@@ -0,0 +1,22 @@
<Project Sdk="Aspire.AppHost.Sdk/13.4.0">
<ItemGroup>
<ProjectReference Include="..\api\MicCheck.Api\MicCheck.Api.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Aspire.Hosting.JavaScript" Version="13.4.2" />
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="13.4.0" />
</ItemGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<UserSecretsId>d10a4485-2ac0-4ba7-bda5-8eb63e417567</UserSecretsId>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,29 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:17244;http://localhost:15050",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21229",
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22051"
}
},
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:15050",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19033",
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20209"
}
}
}
}

View File

@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.Dcp": "Warning"
}
}
}

View File

@@ -0,0 +1,5 @@
{
"appHost": {
"path": "MicCheck.AppHost.csproj"
}
}

View File

@@ -0,0 +1,127 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.ServiceDiscovery;
using OpenTelemetry;
using OpenTelemetry.Metrics;
using OpenTelemetry.Trace;
namespace Microsoft.Extensions.Hosting;
// Adds common Aspire services: service discovery, resilience, health checks, and OpenTelemetry.
// This project should be referenced by each service project in your solution.
// To learn more about using this project, see https://aka.ms/aspire/service-defaults
public static class Extensions
{
private const string HealthEndpointPath = "/health";
private const string AlivenessEndpointPath = "/alive";
public static TBuilder AddServiceDefaults<TBuilder>(this TBuilder builder) where TBuilder : IHostApplicationBuilder
{
builder.ConfigureOpenTelemetry();
builder.AddDefaultHealthChecks();
builder.Services.AddServiceDiscovery();
builder.Services.ConfigureHttpClientDefaults(http =>
{
// Turn on resilience by default
http.AddStandardResilienceHandler();
// Turn on service discovery by default
http.AddServiceDiscovery();
});
// Uncomment the following to restrict the allowed schemes for service discovery.
// builder.Services.Configure<ServiceDiscoveryOptions>(options =>
// {
// options.AllowedSchemes = ["https"];
// });
return builder;
}
public static TBuilder ConfigureOpenTelemetry<TBuilder>(this TBuilder builder) where TBuilder : IHostApplicationBuilder
{
builder.Logging.AddOpenTelemetry(logging =>
{
logging.IncludeFormattedMessage = true;
logging.IncludeScopes = true;
});
builder.Services.AddOpenTelemetry()
.WithMetrics(metrics =>
{
metrics.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddRuntimeInstrumentation();
})
.WithTracing(tracing =>
{
tracing.AddSource(builder.Environment.ApplicationName)
.AddAspNetCoreInstrumentation(tracing =>
// Exclude health check requests from tracing
tracing.Filter = context =>
!context.Request.Path.StartsWithSegments(HealthEndpointPath)
&& !context.Request.Path.StartsWithSegments(AlivenessEndpointPath)
)
// Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package)
//.AddGrpcClientInstrumentation()
.AddHttpClientInstrumentation();
});
builder.AddOpenTelemetryExporters();
return builder;
}
private static TBuilder AddOpenTelemetryExporters<TBuilder>(this TBuilder builder) where TBuilder : IHostApplicationBuilder
{
var useOtlpExporter = !string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]);
if (useOtlpExporter)
{
builder.Services.AddOpenTelemetry().UseOtlpExporter();
}
// Uncomment the following lines to enable the Azure Monitor exporter (requires the Azure.Monitor.OpenTelemetry.AspNetCore package)
//if (!string.IsNullOrEmpty(builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"]))
//{
// builder.Services.AddOpenTelemetry()
// .UseAzureMonitor();
//}
return builder;
}
public static TBuilder AddDefaultHealthChecks<TBuilder>(this TBuilder builder) where TBuilder : IHostApplicationBuilder
{
builder.Services.AddHealthChecks()
// Add a default liveness check to ensure app is responsive
.AddCheck("self", () => HealthCheckResult.Healthy(), ["live"]);
return builder;
}
public static WebApplication MapDefaultEndpoints(this WebApplication app)
{
// Adding health checks endpoints to applications in non-development environments has security implications.
// See https://aka.ms/aspire/healthchecks for details before enabling these endpoints in non-development environments.
if (app.Environment.IsDevelopment())
{
// All health checks must pass for app to be considered ready to accept traffic after starting
app.MapHealthChecks(HealthEndpointPath);
// Only health checks tagged with the "live" tag must pass for app to be considered alive
app.MapHealthChecks(AlivenessEndpointPath, new HealthCheckOptions
{
Predicate = r => r.Tags.Contains("live")
});
}
return app;
}
}

View File

@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsAspireSharedProject>true</IsAspireSharedProject>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.6.0" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="10.6.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.3" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.15.3" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.2" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.15.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.15.1" />
</ItemGroup>
</Project>

0
src/admin/.dockerignore Normal file → Executable file
View File

11
src/admin/Admin.esproj Executable file
View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.VisualStudio.JavaScript.Sdk/1.0.2752196">
<PropertyGroup>
<StartupCommand>npm run serve</StartupCommand>
<JavaScriptTestRoot>.\</JavaScriptTestRoot>
<JavaScriptTestFramework>Jest</JavaScriptTestFramework>
<!-- Allows the build (or compile) script located on package.json to run on Build -->
<ShouldRunBuildScript>false</ShouldRunBuildScript>
<!-- Folder where production build objects will be placed -->
<BuildOutputFolder>$(MSBuildProjectDirectory)\dist</BuildOutputFolder>
</PropertyGroup>
</Project>

0
src/admin/Dockerfile Normal file → Executable file
View File

0
src/admin/babel.config.js Normal file → Executable file
View File

0
src/admin/index.html Normal file → Executable file
View File

0
src/admin/jest.config.js Normal file → Executable file
View File

0
src/admin/nginx.conf Normal file → Executable file
View File

22617
src/admin/package-lock.json generated Normal file → Executable file

File diff suppressed because it is too large Load Diff

95
src/admin/package.json Normal file → Executable file
View File

@@ -1,47 +1,48 @@
{
"name": "mic-check-admin",
"version": "1.0.0",
"private": true,
"scripts": {
"build": "vite build",
"build:dev": "vite build --mode development",
"serve": "vite",
"preview": "vite preview",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@iconify-json/bxl": "^1.2.0",
"@iconify-json/ri": "^1.2.0",
"@iconify/vue": "^4.1.0",
"@vueuse/core": "^11.0.0",
"axios": "^1.15.0",
"pinia": "^3.0.4",
"vue": "^3.4.0",
"vue-router": "^4.3.0",
"vue3-perfect-scrollbar": "^2.0.0",
"vuetify": "^3.7.5"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/preset-typescript": "^7.24.0",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.0",
"@vitejs/plugin-vue": "^6.0.6",
"@vue/test-utils": "^2.4.6",
"@vue/vue3-jest": "^29.2.6",
"babel-jest": "^29.7.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"sass": "^1.77.2",
"sass-embedded": "^1.77.0",
"ts-jest": "^29.1.4",
"typescript": "^5.4.5",
"vite": "^8.0.8",
"vite-plugin-vuetify": "^2.1.3",
"vite-svg-loader": "^5.1.0"
},
"overrides": {
"brace-expansion": "^5.0.5"
}
}
{
"name": "mic-check-admin",
"version": "1.0.0",
"private": true,
"scripts": {
"build": "vite build",
"build:dev": "vite build --mode development",
"serve": "vite",
"preview": "vite preview",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@iconify-json/bxl": "^1.2.0",
"@iconify-json/ri": "^1.2.0",
"@iconify/vue": "^4.1.0",
"@vueuse/core": "^11.0.0",
"axios": "^1.15.0",
"pinia": "^3.0.4",
"vue": "^3.4.0",
"vue-router": "^4.3.0",
"vue3-perfect-scrollbar": "^2.0.0",
"vuetify": "^3.7.5"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/preset-typescript": "^7.24.0",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.0",
"@vitejs/plugin-vue": "^6.0.6",
"@vue/test-utils": "^2.4.6",
"@vue/vue3-jest": "^29.2.6",
"babel-jest": "^29.7.0",
"eslint": "^10.4.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"sass": "^1.77.2",
"sass-embedded": "^1.77.0",
"ts-jest": "^29.1.4",
"typescript": "^5.4.5",
"vite": "^8.0.8",
"vite-plugin-vuetify": "^2.1.3",
"vite-svg-loader": "^5.1.0"
},
"overrides": {
"brace-expansion": "^5.0.5"
}
}

0
src/admin/src/@core/components/MoreBtn.vue Normal file → Executable file
View File

0
src/admin/src/@core/components/ThemeSwitcher.vue Normal file → Executable file
View File

View File

View File

View File

0
src/admin/src/@core/scss/base/_components.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/base/_dark.scss Normal file → Executable file
View File

View File

0
src/admin/src/@core/scss/base/_default-layout.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/base/_index.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/base/_layouts.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/base/_misc.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/base/_mixins.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/base/_utilities.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/base/_utils.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/base/_variables.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/base/_vertical-nav.scss Normal file → Executable file
View File

View File

0
src/admin/src/@core/scss/base/libs/vuetify/_index.scss Normal file → Executable file
View File

View File

View File

View File

0
src/admin/src/@core/scss/base/placeholders/_index.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/base/placeholders/_misc.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/base/placeholders/_nav.scss Normal file → Executable file
View File

View File

View File

0
src/admin/src/@core/scss/template/_mixins.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/template/_utilities.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/template/_utils.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/template/_variables.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/template/_vertical-nav.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/template/index.scss Normal file → Executable file
View File

0
src/admin/src/@core/scss/template/libs/apex-chart.scss Normal file → Executable file
View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

Some files were not shown because too many files have changed in this diff Show More