| 01-project-infrastructure-module-wiring |
05 |
infra |
| ktor |
| flyway |
| hocon |
| postgres |
| slf4j |
| kotlinx-serialization |
|
| phase |
provides |
| 01-project-infrastructure-module-wiring |
recipe.jvm.server precompiled plugin (Plan 02) wires ktor-server-netty, ktor-server-content-negotiation, ktor-serialization-kotlinx-json, flyway-core, flyway-database-postgresql, postgresql JDBC, ktor-server-test-host, logback-classic. Plan 03 applied recipe.jvm.server + recipe.quality to server module and added implementation(projects.shared) so SERVER_PORT is reachable. |
|
|
| Running-but-empty server: GET /health returns {"status":"ok"} with Content-Type application/json |
| HOCON application.conf with localhost defaults + ${?ENV} overrides for PORT/DATABASE_URL/DATABASE_USER/DATABASE_PASSWORD |
| Database.migrate() Flyway boot sequence with fail-loud IllegalStateException contract on unreachable Postgres |
| server/src/main/resources/db/migration/ resource directory anchored by .gitkeep so classpath:db/migration resolves before Phase 3 adds V1__init.sql |
| configureRouting() extension extracted from Application.module() so tests compose routing without invoking Database.migrate (no Postgres in CI) |
|
| phase-02-auth |
| phase-03-households |
| phase-05-recipe-catalog |
| phase-11-deployment |
|
| added |
patterns |
| Flyway runtime API (flyway-core 12.x) |
| HOCON env-var override pattern |
| SLF4J server-side logging |
|
| HOCON ${?ENV} two-line override pattern (PITFALL #5 mitigation) |
| Fail-loud server boot: Database.migrate throws IllegalStateException on Flyway/JDBC failure |
| Routing extracted to Application.configureRouting() extension so testApplication composes routing without DB dependency |
| Server uses SLF4J/Logback (NOT Kermit — Kermit is client-only) |
|
|
| created |
modified |
| server/src/main/kotlin/dev/ulfrx/recipe/Database.kt |
| server/src/main/resources/application.conf |
| server/src/main/resources/db/migration/.gitkeep |
|
| server/src/main/kotlin/dev/ulfrx/recipe/Application.kt |
| server/src/test/kotlin/dev/ulfrx/recipe/ApplicationTest.kt |
|
|
| Use HOCON ${?ENV} optional substitution (two-line default + override) rather than ${ENV:default} (invalid HOCON) or ${ENV} (required, crashes on unset) |
| Server logs via SLF4J/Logback, not Kermit — Kermit reserved for the multiplatform client |
| Database.migrate is fail-loud: IllegalStateException on any Flyway error; no silent degraded mode |
| cleanDisabled(true) is double-enforced (precompiled plugin CLI guard + programmatic Database.migrate guard) |
| Extract Application.configureRouting() so /health test runs without Postgres — preserves D-11 invariant that ./gradlew :server:test passes in fresh clones / CI |
| Default credentials in application.conf (recipe/recipe/recipe @ localhost:5432/recipe) match Plan 06 docker-compose for zero-config dev boot |
|
| HOCON ${?ENV} override: every secret/per-env value gets a default line followed by ${?ENV_VAR} optional substitution |
| Fail-loud infrastructure: critical boot operations (DB migration, future JWKS load) throw IllegalStateException rather than returning a status |
| Routing extraction for testability: features expose Application.configureXxx() extensions; module() is the production composition root |
|
|
~1 min (executor work — implementation commits authored ahead of executor invocation) |
2026-04-24 |