https://github.com/amazingustav/ktorplate
A simple template for Ktor base project
https://github.com/amazingustav/ktorplate
exposed flyway koin kotlin ktor
Last synced: about 1 month ago
JSON representation
A simple template for Ktor base project
- Host: GitHub
- URL: https://github.com/amazingustav/ktorplate
- Owner: amazingustav
- Created: 2020-06-25T13:38:10.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-09-25T15:51:26.000Z (over 1 year ago)
- Last Synced: 2025-04-19T17:17:11.559Z (about 2 months ago)
- Topics: exposed, flyway, koin, kotlin, ktor
- Language: Kotlin
- Homepage:
- Size: 104 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.en-US.md
Awesome Lists containing this project
README
[Portuguese README](/README.md)
# Ktorplate - Template Ktor project### Tech stack:
* Kotlin (JDK 11)
* [Koin](https://insert-koin.io/)
* [Ktor](https://ktor.io)
* [JetBrains Exposed](https://github.com/JetBrains/Exposed)
* [Flyway](https://flywaydb.org/)
* PostgreSQLThis project follows [Clean Architecture rules](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html) and its structure is organized like:
```bash
|-- application -> Principal module, responsable to dependency and context injections. It orchestrate all other modules.
|-- persistence -> Database (or any kind of data storage) interface and integration. It sees "entity" e "usecase" modules.
|-- web -> Web Adapter, where the entry is exposed (e.g. API, events, sockets...). It sees "entity" e "usecase" modules.
|-- usecase -> Application rules. It sees only "entity" module.
|-- entity -> Entities and business rules. This is the core of application. It doesn't use any module, but anyone of them can use it.
```### How to execute
* To start application and databse, you just have to type this command:
* If you don't wanna see logs, remove `-d` argument.
```$xslt
docker-compose up -d
```* To quit both application and database services, just type:
```$xslt
docker-compose stop
```**PS**: You have to be in the same folder level as `docker-compose.yml` file to execute the commands above.
### Database versioning
Every databse change is versioned with [flyway](https://flywaydb.org/), so when you change db structure (DDL/DML), you have to add a new file into `resources/db/migration` folder with your change content. Gradle build will make sure to apply all changes, using flyway-plugin.## ISSUES
* There are no tests (eXtreme Go Horse, buddy)