diff --git a/README.md b/README.md index cdfea20..4f4458c 100644 --- a/README.md +++ b/README.md @@ -74,21 +74,56 @@ in your IDE's toolbar or run it directly from the terminal: ```shell .\gradlew.bat :composeApp:wasmJsBrowserDevelopmentRun ``` -- for the JS target (slower, supports older browsers): - - on macOS/Linux - ```shell - ./gradlew :composeApp:jsBrowserDevelopmentRun - ``` - - on Windows - ```shell - .\gradlew.bat :composeApp:jsBrowserDevelopmentRun - ``` ### Build and Run iOS Application To build and run the development version of the iOS app, use the run configuration from the run widget in your IDE’s toolbar or open the [/iosApp](./iosApp) directory in Xcode and run it from there. +### Local development + +The server requires Postgres. A `docker-compose.yml` at the repo root ships a local Postgres +instance whose credentials match `application.conf` defaults (`recipe`/`recipe`/`recipe`). + +Boot the database and server: + +```shell +docker compose up -d postgres +./gradlew :server:run +``` + +Verify the server is up: + +```shell +curl http://localhost:8080/health +# expected: {"status":"ok"} +``` + +Environment overrides (optional — set any of these to override `application.conf` defaults): + +- `DATABASE_URL` — JDBC URL (default `jdbc:postgresql://localhost:5432/recipe`) +- `DATABASE_USER` — DB user (default `recipe`) +- `DATABASE_PASSWORD` — DB password (default `recipe`) +- `PORT` — Ktor port (default `8080`) + +Before committing, format all Kotlin + Gradle + Markdown files: + +```shell +./gradlew spotlessApply +``` + +The full check (Spotless + all tests across all targets): + +```shell +./gradlew check +``` + +Reset the local database (destroys the `recipe-pgdata` volume): + +```shell +docker compose down -v +``` + --- Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html),