A humble Todolist api. Kotlin, Ktor, Koin, PostgreSQL, Redis, Gradle, Flyway, Test Containers and more.
Create a Postgres instance using Docker CLI:
docker run --detach --rm \
--name postgresql-ktor-to-do-list \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_DB=todolist \
-p 127.0.0.1:5432:5432 \
postgres:17.1
The command above is also available as a Gradle task:
./gradlew runPostgresOnce
Create a Redis instance using Docker CLI:
docker run --detach --rm \
--name redis-ktor-to-do-list \
-p 6379:6379 \
redis:7.4.1
You can examine the cache by connecting to the Redis instance:
docker exec -it redis-ktor-to-do-list redis-cli
./gradlew build
Ensure database is up and running, then execute:
./gradlew run
Note that tests use Test Containers and therefore rely on Docker.
Ensure that Docker is up and running, then execute:
./gradlew test
You can find example requests for testing the api in REQUESTS.md.