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.
Connection String
Section titled “Connection String”The only configuration the application reads from settings is the PostgreSQL connection string:
ConnectionStrings:DefaultConnectionThis is used by the TechStratDbContext registered in Program.cs with UseNpgsql().
appsettings.json (base)
Section titled “appsettings.json (base)”The base configuration file is minimal — it contains only logging defaults and no connection string:
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "AllowedHosts": "*"}appsettings.Development.json
Section titled “appsettings.Development.json”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" }}Override via environment variable
Section titled “Override via environment variable”ASP.NET Core’s configuration system supports __ (double underscore) as a section separator in environment variables:
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.
Hardcoded Defaults
Section titled “Hardcoded Defaults”All operational settings beyond the connection string are hardcoded as constructor defaults or constants. There are no configuration sections for these values.
| Setting | Value | Location |
|---|---|---|
| Checkpoint threshold | 100 applied events | EventProcessor constructor default |
| Session expiry | 7 days | AuthEndpoints.cs (TimeSpan.FromDays(7)) |
| Login rate limit | 5 attempts | LoginRateLimiter constructor default |
| Login lockout duration | 15 minutes | LoginRateLimiter constructor default |
| Session cache TTL | 5 minutes | SessionCache constant (TimeSpan.FromMinutes(5)) |
| SSE heartbeat interval | 15 seconds | SseHeartbeatService |
Environment-Specific Behavior
Section titled “Environment-Specific Behavior”Development mode
Section titled “Development mode”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.
Other environments
Section titled “Other environments”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)
HTTPS Configuration
Section titled “HTTPS Configuration”Development
Section titled “Development”In development, the .NET developer certificate is used automatically. Ensure it is trusted:
dotnet dev-certs https --trustThe application URL is configured in launchSettings.json:
https://localhost:5001;http://localhost:5000HTTPS is required for authentication
Section titled “HTTPS is required for authentication”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.
Production
Section titled “Production”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.jsonor environment variables
| Port | Service | Configurable |
|---|---|---|
| 5001 | ASP.NET Core (HTTPS) | Via launchSettings.json or Kestrel config |
| 5000 | ASP.NET Core (HTTP) | Via launchSettings.json or Kestrel config |
| 5432 | PostgreSQL | Via docker-compose.yml port mapping |
SSE runs over the same HTTP/HTTPS connection — no additional ports are required.
Changing the API port
Section titled “Changing the API port”Modify Properties/launchSettings.json in the API project, or set the ASPNETCORE_URLS environment variable:
ASPNETCORE_URLS=https://localhost:6001 dotnet watch --project src/TechStrat.ApiLogging
Section titled “Logging”The application uses ASP.NET Core’s built-in ILogger with structured logging. Key log points:
| Component | What is logged |
|---|---|
EventEndpoints | Event applied/rejected, checkpoints, restores |
SseConnectionManager | Connection open/close |
AuthEndpoints | Login success/failure/lockout |
ProcessorInitializer | Cold start progress (checkpoint load, replay count) |
Configure log levels in appsettings.json:
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }}Health Check
Section titled “Health Check”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.
Summary of Configuration Sources
Section titled “Summary of Configuration Sources”| Setting | Source | Override |
|---|---|---|
| Connection string | appsettings.Development.json | Environment variable |
| API port | launchSettings.json | ASPNETCORE_URLS env var |
| Log levels | appsettings.json | Environment-specific config |
| PostgreSQL port | docker-compose.yml | Edit file directly |
| Auto-migration | Gated on IsDevelopment() | Set ASPNETCORE_ENVIRONMENT |
| User seeding | Gated on IsDevelopment() | Set ASPNETCORE_ENVIRONMENT |
| All other settings | Hardcoded (see table above) | Requires code change |