How yuk1ty/ktor-todo-example works
Project type and purpose
• This is a standalone backend service: a Ktor-based RESTful API for managing TODO items.
• Its goal is to demonstrate a simple CRUD API with a mix of functional and object-oriented styles, layered according to a “hexagonal” or clean-architecture approach.
File structure
• Top-level build and config: build.gradle.kts, Gradle wrapper, docker/compose.yaml, migration scripts in migration/v0.sql.
• Code lives under src/main/kotlin/com/github/yuk1ty/todoAppKt, split into:
• api – HTTP routing, handlers, API models & error handlers.
• adapter – Data-access layer: database context, table definitions, repository impl, adapter-level models and errors.
• application – Application service layer: commands, service implementations, interfaces (repositories), application-level errors.
• domain – Core domain models and domain-level errors.
• queryService – A read-model or query helper for retrieving TODOs.
• shared – Cross-cutting modules: config, DI modules, serializers, exception handlers, utility extensions.
• Supporting files: application.yaml, logback.xml, tests mirroring the same layers, Docker and SQL migration integration.
README for additional insights
• Shows startup steps: bring up Postgres via Docker, apply SQL migrations (sqldef), then run ./gradlew run.
• No frontend, no external microservices beyond the RDBMS.