Skip to content

Commit e806589

Browse files
committed
[#464] Increased developer getting started documentation
Signed-off-by: David Monichi <[email protected]>
1 parent 9e6374d commit e806589

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

app/src/main/resources/application-local.properties

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,13 @@ quarkus.flyway.locations = classpath:org/lfenergy/compas/scl/data/reposit
1212
mp.jwt.verify.issuer = ${JWT_VERIFY_ISSUER:http://127.0.0.1:8089/auth/realms/compas}
1313

1414
compas.scl-data-service.features.soft-delete-enabled = true
15+
16+
# Run with local PostgreSQL database provided by "app/src/test/resources/docker-compose.yml"
17+
# For more details have a look at the [development documentation](doc/development.md).
18+
19+
#quarkus.datasource.devservices.enabled = false
20+
#quarkus.datasource.db-kind = postgresql
21+
#quarkus.datasource.jdbc.url = jdbc:postgresql://${POSTGRESQL_HOST:localhost}:${POSTGRESQL_PORT:5432}/${POSTGRESQL_DB:compas}
22+
#quarkus.datasource.jdbc.max-size = 16
23+
#quarkus.datasource.username = ${POSTGRESQL_USERNAME:postgres}
24+
#quarkus.datasource.password = ${POSTGRESQL_PASSWORD:postgres}

doc/development.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,28 @@ The `<ACCESS_TOKEN>` should be replaced with a valid JWT token obtained from Key
3333
-H "Content-Type: application/x-www-form-urlencoded" \
3434
-d "client_id=scl-data-service&username=scl-data-editor&password=editor&grant_type=password"
3535
```
36+
37+
## Connecting to local database
38+
39+
To connect to the local PostgreSQL database, you first need to start the PostgreSQL service using Docker Compose:
40+
```
41+
cd app/src/test/resources/docker-compose.yml
42+
docker-compose up postgresql
43+
```
44+
45+
then enable the postgresql configuration by uncomment following lines in file `src/main/resources/application-local.properties`:
46+
```properties
47+
quarkus.datasource.devservices.enabled = false
48+
quarkus.datasource.db-kind = postgresql
49+
quarkus.datasource.jdbc.url = jdbc:postgresql://${POSTGRESQL_HOST:localhost}:${POSTGRESQL_PORT:5432}/${POSTGRESQL_DB:compas}
50+
quarkus.datasource.jdbc.max-size = 16
51+
quarkus.datasource.username = ${POSTGRESQL_USERNAME:postgres}
52+
quarkus.datasource.password = ${POSTGRESQL_PASSWORD:postgres}
53+
```
54+
55+
Start the application in development mode with the local profile:
56+
```bash
57+
mvn -DskipTests=true -Dquarkus.profile=local package io.quarkus:quarkus-maven-plugin::dev
58+
```
59+
60+
You can then verify the setup described above by using the same curl commands as mentioned earlier.

0 commit comments

Comments
 (0)