Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sergiocostan26/ktor-demo
Demo project built with Kotlin and Ktor applying Hexagonal Architecture.
https://github.com/sergiocostan26/ktor-demo
Last synced: 6 days ago
JSON representation
Demo project built with Kotlin and Ktor applying Hexagonal Architecture.
- Host: GitHub
- URL: https://github.com/sergiocostan26/ktor-demo
- Owner: sergiocostaN26
- Created: 2023-07-15T10:39:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-08T15:05:12.000Z (5 months ago)
- Last Synced: 2024-08-03T12:26:31.685Z (3 months ago)
- Language: Kotlin
- Size: 282 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ktor-demo
This demonstration service exemplifies the application of **domain-driven
design and hexagonal architecture** in modeling diverse use cases for **scooter
rental businesses**. In this showcase, the **Ktor** framework has been employed
to facilitate comparison with the well-established Spring services.## Prerequisites
- Java 17
- Docker## Installation
1. Clone the repository
```sh
git clone [email protected]:sergiocmgit/ktor-demo.git
```
2. Build the image
```sh
./gradlew build
```
3. Build the docker image
```sh
./gradlew buildImage
```
4. Run the application
```sh
./gradlew runDocker
```## Test the endpoints
```sh
curl -X GET "http://localhost:8080/users"
```
```sh
curl -X GET "http://localhost:8080/scooters"
```
```sh
curl -X POST "http://localhost:8080/scooters/2/lock/A"
```
```sh
curl -X POST "http://localhost:8080/scooters/3/run/A"
```
```sh
curl -X POST "http://localhost:8080/scooters/1/run/B"
```
```sh
curl -X POST "http://localhost:8080/scooters/1/run/C"
```
```sh
curl -X POST "http://localhost:8080/scooters/4/run/A"
```
```sh
curl -X POST "http://localhost:8080/scooters/3/run/A"
```