Skip to content

Configuration

The Tech Strategy Tool is configured via standard ASP.NET Core configuration — appsettings.json files and environment variables. This page documents the available settings and their defaults.

The only configuration the application reads from settings is the PostgreSQL connection string:

ConnectionStrings:DefaultConnection

This is used by the TechStratDbContext registered in Program.cs with UseNpgsql().

The base configuration file is minimal — it contains only logging defaults and no connection string:

{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

The development configuration adds the connection string matching the Docker Compose PostgreSQL credentials:

{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Port=5432;Database=techstrat;Username=techstrat;Password=techstrat_dev"
}
}

ASP.NET Core’s configuration system supports __ (double underscore) as a section separator in environment variables:

Terminal window
ConnectionStrings__DefaultConnection="Host=mydb;Port=5432;Database=techstrat;Username=app;Password=secret"

There is no explicit environment variable handling in the codebase — no GetEnvironmentVariable() calls, no .env file loading, no custom config providers. All environment variable support comes from ASP.NET Core’s built-in configuration system.

All operational settings beyond the connection string are hardcoded as constructor defaults or constants. There are no configuration sections for these values.

SettingValueLocation
Checkpoint threshold100 applied eventsEventProcessor constructor default
Session expiry7 daysAuthEndpoints.cs (TimeSpan.FromDays(7))
Login rate limit5 attemptsLoginRateLimiter constructor default
Login lockout duration15 minutesLoginRateLimiter constructor default
Session cache TTL5 minutesSessionCache constant (TimeSpan.FromMinutes(5))
SSE heartbeat interval15 secondsSseHeartbeatService

When ASPNETCORE_ENVIRONMENT=Development:

  • Auto-migration: EF Core migrations are applied automatically on startup via db.Database.MigrateAsync()
  • User seeding: Three default users are created if the users table is empty:
    • admin / admin (role: admin)
    • editor / editor (role: editor)
    • viewer / viewer (role: viewer)
  • Developer certificate: HTTPS uses the .NET developer certificate (dotnet dev-certs)

Both auto-migration and user seeding are gated behind app.Environment.IsDevelopment() in Program.cs. They do not run in any other environment.

When ASPNETCORE_ENVIRONMENT is anything other than Development:

  • No auto-migration — apply migrations manually or via a deployment pipeline
  • No user seeding — create the initial admin user via direct database access or a setup script
  • HTTPS requires a proper certificate (see below)

In development, the .NET developer certificate is used automatically. Ensure it is trusted:

Terminal window
dotnet dev-certs https --trust

The application URL is configured in launchSettings.json:

https://localhost:5001;http://localhost:5000

The session cookie is configured with Secure = true and SameSite = Strict. This means the browser will not send the cookie over plain HTTP. Authentication only works over HTTPS.

For production, you would need to either:

  • Use a reverse proxy (nginx, Caddy, etc.) to terminate TLS in front of the application
  • Configure Kestrel with a real certificate via appsettings.json or environment variables
PortServiceConfigurable
5001ASP.NET Core (HTTPS)Via launchSettings.json or Kestrel config
5000ASP.NET Core (HTTP)Via launchSettings.json or Kestrel config
5432PostgreSQLVia docker-compose.yml port mapping

SSE runs over the same HTTP/HTTPS connection — no additional ports are required.

Modify Properties/launchSettings.json in the API project, or set the ASPNETCORE_URLS environment variable:

Terminal window
ASPNETCORE_URLS=https://localhost:6001 dotnet watch --project src/TechStrat.Api

The application uses ASP.NET Core’s built-in ILogger with structured logging. Key log points:

ComponentWhat is logged
EventEndpointsEvent applied/rejected, checkpoints, restores
SseConnectionManagerConnection open/close
AuthEndpointsLogin success/failure/lockout
ProcessorInitializerCold start progress (checkpoint load, replay count)

Configure log levels in appsettings.json:

{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

GET /health returns a basic health response:

{
"status": "healthy"
}

This endpoint does not check database connectivity — it only confirms the application is running and accepting requests.

SettingSourceOverride
Connection stringappsettings.Development.jsonEnvironment variable
API portlaunchSettings.jsonASPNETCORE_URLS env var
Log levelsappsettings.jsonEnvironment-specific config
PostgreSQL portdocker-compose.ymlEdit file directly
Auto-migrationGated on IsDevelopment()Set ASPNETCORE_ENVIRONMENT
User seedingGated on IsDevelopment()Set ASPNETCORE_ENVIRONMENT
All other settingsHardcoded (see table above)Requires code change