Skip to content

Commit 66e296d

Browse files
authored
Merge pull request #8 from fractalliter/improve-document
improve document
2 parents 7081de9 + d92fd24 commit 66e296d

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

README.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Here lays a Kotlin web project with Ktor framework, Postgres database, and JWT Authentication.
44

5-
The project comprises following ingredients:
5+
The project comprises the following ingredients:
66

77
- [Ktor](https://ktor.io/) server
88
includes [JSON serializers](https://ktor.io/docs/serialization.html), [Authentication](https://ktor.io/docs/authentication.html),
@@ -12,12 +12,12 @@ The project comprises following ingredients:
1212
- [Exposed](https://github.com/JetBrains/Exposed) as ORM
1313
- [Hikari Connection Pool](https://github.com/brettwooldridge/HikariCP)
1414
- [Logback](https://logback.qos.ch/) for logging purposes
15-
- [JBCrypt](https://www.mindrot.org/projects/jBCrypt/) for hashing passwords(No salting yet)
15+
- [JBCrypt](https://www.mindrot.org/projects/jBCrypt/) for hashing passwords (No salting yet)
1616

17-
There is a simple implementation of Graph search and traverse with DFS algorithm but if you aim for a solid solution
17+
There is a simple implementation of DFS algorithm, but if you aim for a solid solution,
1818
better go for [GUAVA Graph](https://github.com/google/guava/wiki/GraphsExplained) from Google.
1919

20-
Project is agnostic about database, you can dynamically change Postgres to any other databases that Exposed JDBC
20+
Project is SQL DB agnostic. You are able to dynamically change Postgres to any other databases that Exposed JDBC
2121
supports by changing a couple of variables:
2222

2323
- the database driver version in `gradle.properties`
@@ -27,21 +27,20 @@ supports by changing a couple of variables:
2727
## Flow
2828

2929
1. deploy the docker compose with `docker compose up -d` command
30-
2. sign up to the system `/signup` with a username and password(not hardened enough)
31-
3. log in to with username and password to get access token `/login`
32-
4. send post request with payload and token to `/hirearchy` to create the hierarchy of the organization
30+
2. sign up to `/signup` route providing a username and password(not hardened enough)
31+
3. log in to with your username and password to get access token `/login`
32+
4. send `POST` request with payload and token to `/hirearchy` to create the hierarchy of the organization
3333
5. send get request with token to `/hierarchy/{name}/supervisors` to fetch the supervisors of the current user
3434

3535
## How to use
3636

3737
> You need **root access** for docker
3838
3939
Go to the root directory of the project where `docker-compose.yml` is and change the environment variables in
40-
`.env-example` with yours and rename the file to `mv .env-example .env` then deploy the application with following
41-
command:
40+
`.env-example` with yours and rename the file to `.env` then deploy the application with the following command:
4241

4342
```bash
44-
docker-compose up
43+
docker-compose up -d
4544
```
4645

4746
for shutting down the deployment run following command where the `docker-compose.yml` file resides:
@@ -75,8 +74,8 @@ curl --request POST -sLv \
7574

7675
```
7776

78-
The response to querying the endpoint where the root is at the top of the JSON nested dictionary. For instance, previous
79-
input would result in:
77+
The response to querying the endpoint where the root is at the top of the JSON nested dictionary.
78+
For instance, previous input would result in:
8079

8180
```bash
8281
curl --request GET -sLv \
@@ -121,7 +120,7 @@ the response of the query will be:
121120
}
122121
```
123122

124-
Sophie is the supervisor of the Nick and Jonas is supervisor of the supervisor of the Nick
123+
Sophie is the supervisor of the Nick, and Jonas is a supervisor of the supervisor of the Nick
125124

126125
## It's secured by JWT authentication
127126

@@ -151,22 +150,22 @@ The response will be the access token
151150
}
152151
```
153152

154-
## How to test locally
153+
## How to run tests locally
155154

156-
For testing the project locally you can run docker compose with `docker-compose-test.yml` file. It will run the tests
157-
against a test database.
155+
To run the tests locally, you should run docker compose with `docker-compose-test.yml` file.
156+
It will run the tests against the test database.
158157

159158
```bash
160159
docker-compose --file docker-compose-test.yml up
161160
```
162161

163-
After finishing the tests you can clean test data nd shut the containers down with following command:
162+
After finishing the tests, you can clean test data nd shut the containers down with the following command:
164163

165164
```bash
166165
docker-compose --file docker-compose-test.yml down -v
167166
```
168167

169168
## Continues Integration
170169

171-
For continues integration, the CI workflow prepares the database, run the gradle build with tests, and generates report
172-
to Codacy about the quality of code.
170+
CI workflow prepares the database, runs the Gradle build with tests,
171+
and generates a good quality report to [Codacy](https://www.codacy.com/).

build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ val redis_version: String by project
1010

1111
plugins {
1212
application
13+
jacoco
1314
kotlin("jvm") version "1.8.0"
1415
id("org.jetbrains.kotlin.plugin.serialization") version "1.6.20"
1516
id("com.github.johnrengelman.shadow") version "7.0.0"
17+
id("org.sonarqube") version "3.5.0.2730"
1618
}
1719

1820
tasks {
@@ -21,6 +23,11 @@ tasks {
2123
attributes(Pair("Main-Class", "com.personia.ApplicationKt"))
2224
}
2325
}
26+
jacocoTestReport {
27+
reports {
28+
xml.required.set(true)
29+
}
30+
}
2431
}
2532

2633
group = "com.personia"

0 commit comments

Comments
 (0)