Phase 01: Foundation - 3 plans in 3 waves (sequential dependency) - Plan 01: Mill build + ZIO HTTP server - Plan 02: PostgreSQL + Quill + Flyway migrations - Plan 03: Repository pattern + Pulumi/Besom deployment Ready for execution
6.2 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | must_haves | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-foundation | 01 | execute | 1 |
|
true |
|
Purpose: Establish the foundational build infrastructure and prove the ZIO HTTP stack works before adding database complexity. Output: Running HTTP server accessible at localhost:8080 with /health endpoint.
<execution_context> @/home/jin/.claude/get-shit-done/workflows/execute-plan.md @/home/jin/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/phases/01-foundation/01-CONTEXT.md @.planning/phases/01-foundation/01-RESEARCH.md Task 1: Create Mill build configuration build.mill Create Mill build file with Scala 3 and ZIO dependencies.Use programmatic Mill config (build.mill not YAML) for assembly support:
- Scala version: 3.3.4 (LTS, better library compatibility than 3.8.x)
- Dependencies:
- dev.zio::zio:2.1.14
- dev.zio::zio-http:3.0.1 (stable release, not 3.8.x which is unreleased)
- dev.zio::zio-config:4.0.2
- dev.zio::zio-config-typesafe:4.0.2
- dev.zio::zio-config-magnolia:4.0.2
- io.getquill::quill-jdbc-zio:4.8.5
- org.postgresql:postgresql:42.7.4
- org.flywaydb:flyway-core:10.21.0
- org.flywaydb:flyway-database-postgresql:10.21.0
Include assembly configuration for fat JAR with:
- Service file merging for META-INF/services
- Exclude signature files (*.SF, *.DSA, *.RSA)
Note: Research suggested newer versions but use stable releases that exist on Maven Central.
Run mill resolve _ to verify Mill parses the build file correctly
build.mill exists and Mill can parse all dependencies
- src/config/AppConfig.scala:
- Case class AppConfig with server and database nested configs
- Case class ServerConfig(host: String, port: Int)
- Case class DatabaseConfig(host: String, port: Int, database: String, user: String, password: String)
- Use zio-config-magnolia for automatic derivation
- resources/application.conf (HOCON):
server {
host = "0.0.0.0"
host = ${?SERVER_HOST}
port = 8080
port = ${?SERVER_PORT}
}
database {
host = "localhost"
host = ${?DB_HOST}
port = 5432
port = ${?DB_PORT}
database = "summercms"
database = ${?DB_NAME}
user = "summercms"
user = ${?DB_USER}
password = "summercms"
password = ${?DB_PASSWORD}
}
Pattern: Environment variables override defaults using HOCON substitution syntax. Files exist at correct paths AppConfig case classes defined, application.conf has all database and server settings with env overrides
Task 3: Create HTTP routes and Main entry point src/api/HealthRoutes.scala src/api/Routes.scala src/Main.scala Create the HTTP layer:- src/api/HealthRoutes.scala:
- Object HealthRoutes with
routesval returning Routes - GET /health -> Response.text("ok")
- Keep simple for now; /ready endpoint added when database exists
- src/api/Routes.scala:
- Object Routes that composes all route modules
- For now, just re-exports HealthRoutes.routes
- This is the composition point for future route modules
- src/Main.scala:
- Object Main extends ZIOAppDefault
- Override bootstrap to set ConfigProvider.fromResourcePath()
- In run: Server.serve(Routes.routes).provide(Server.defaultWithPort(8080))
- Print ASCII art banner on startup (SummerCMS with sun motif)
ASCII banner example:
\\ | //
\\ | //
___\\###//___
/ SUMMER \\
\\ CMS /
\\__________/
Starting on port 8080...
<success_criteria>
- Mill build configuration exists with all ZIO dependencies
- Server starts on port 8080 via
mill run - GET /health returns 200 OK with "ok" body
- Configuration loads from application.conf
- ASCII SummerCMS banner displays on startup </success_criteria>