← Back to projects
Kotlin
Ktor Server
Ktor Client
MongoDB
Docker
Fly.io
GitHub Actions
Project Middleware
Project Middleware is a backend API transformation service. You point it at any public API and define mapping rules (rename, nest, concatenate, exclude empty fields) — the service returns your custom shape. A /preview endpoint lets you test rules before persisting them as permanent mapped routes.
Architecture
The project is structured as a clean, multi-module Ktor server:
middleware/domain– use cases and repository interfacesmiddleware/data– repository implementations and data modelsmiddleware/mapper– field mapping engineimpl/ktor-server– HTTP routing and request handlingimpl/ktor-client– outbound HTTP clientimpl/mongo-database– MongoDB driver integrationcommon/shared&common/data– shared models and utilitiesbuild-logic/– custom convention plugins keeping build files lean
CI/CD
Three GitHub Actions workflows run on every PR:
- Detekt – code style enforcement
- JaCoCo – test coverage verification
- Dokka – KDoc documentation generation on merge to main
Deployed on Fly.io (São Paulo region) via Docker.
Tech Stack
| Layer | Technology |
|---|---|
| Language | Kotlin 1.9 |
| Framework | Ktor Server 2.3 |
| HTTP Client | Ktor Client |
| Database | MongoDB (kotlinx coroutine driver) |
| Serialization | kotlinx-serialization, Gson |
| Build | Gradle 7.5+, Shadow JAR |
| Quality | Detekt, JaCoCo, Dokka |
| Runtime | Docker (OpenJDK 17 Alpine) |
| Hosting | Fly.io |