docs(01-06): add Local development section and drop js target
- New "Local development" section documents docker compose + gradlew dev loop - Covers /health smoke test, env-var overrides (DATABASE_* and PORT) - Adds spotlessApply + check + down -v reference commands - Removes legacy js target docs (D-01); wasmJs target preserved
This commit is contained in:
53
README.md
53
README.md
@@ -74,21 +74,56 @@ in your IDE's toolbar or run it directly from the terminal:
|
|||||||
```shell
|
```shell
|
||||||
.\gradlew.bat :composeApp:wasmJsBrowserDevelopmentRun
|
.\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
|
### Build and Run iOS Application
|
||||||
|
|
||||||
To build and run the development version of the iOS app, use the run configuration from the run widget
|
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.
|
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),
|
Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html),
|
||||||
|
|||||||
Reference in New Issue
Block a user