You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Introduced Dockerfile, docker-compose.yml and ormconfig.docker.json and modified other files for starting app.
* Rename project name, bump up Gradle version and update README
* Make following changes:
- Bump up kapt version
- Modify Dockerfile
- Rename main app class and its related classes
- Update README file
* Make following changes:
- Bump up flyway version
- Modify service names, ports and add network in docker-compose file
- Modify DB params
- Update README file
* Update README and docker-compose
Copy file name to clipboardExpand all lines: README.md
+16-7
Original file line number
Diff line number
Diff line change
@@ -7,28 +7,37 @@ Simple ToDo app containing REST API written in Java and Kotlin using:
7
7
* JUnit5
8
8
9
9
10
-
## Steps for setting and running app:
10
+
## 1. Setting up and running the app
11
+
To properly set up and run the app perform following steps:
11
12
1. Create `todo_db` database in Postgres DB ver 12 using following credentials:
12
13
**username**=`postgres`<br/>
13
-
**password**=`system`<br/>
14
+
**password**=`postgres`<br/>
14
15
**NOTE**: Make sure they are matching `spring.datasource.username` / `spring.flyway.user` properties in `application.properties` file
15
-
2. Enter directory of `first-java-kotlin-gradle-project` module
16
+
2. Enter directory of `todo-kotlin-java-app` module
16
17
3. Make sure property `spring.flyway.enabled` is set to `true` located in `src/main/resources/application.properties`
17
18
4. Execute `./gradlew bootRun` command
18
19
5. Before 2nd and every other app run (i.e. before executing Step4) set `spring.flyway.enabled` property to `false` located in `src/main/resources/application.properties`
19
20
20
-
## Target one of following endpoints:
21
+
## 2. App containerization
22
+
If you prefer not to have needed Postgres 12 version installed on your computer locally you can run docker-compose.
23
+
In that use case you need to:
24
+
1. Disable port 5432 in order for containerized Postgres image to run
25
+
2. Create docker network named `app_db_net`.
21
26
27
+
Finally, execute `docker compose up -d` command to start both application and database containers.
28
+
29
+
30
+
## 3. REST Endpoints
31
+
Target one of following endpoints
22
32
1.**GET** all Todo(s) [http://localhost:8080/api/todos](http://localhost:8080/api/todos) <br/>
23
33
2.**GET** Single Todo (with id=1) [http://localhost:8080/api/todos/1](http://localhost:8080/api/todos/1) <br/>
24
-
3.**POST** Todo [http://localhost:8080/api/todos](http://localhost:8080/api/todos) <br/>
25
-
...using following body
34
+
3.**POST** Todo [http://localhost:8080/api/todos](http://localhost:8080/api/todos) <br/>...using following body
26
35
```json
27
36
{
28
37
"title": "Kotlin app review",
29
38
"description": "Survive the Kotlin app review"
30
39
}
31
-
```
40
+
```
32
41
4.**PATCH** Todo [http://localhost:8080/api/todos/3](http://localhost:8080/api/todos/3) <br/>
0 commit comments