A Kotlin Multiplatform demonstration project showcasing Kotlin RPC (KRPC) communication between a Ktor backend and a Compose Desktop frontend, with shared business logic.
kprc-and-kmp-notebook-demo/
├── shared/ # Shared Kotlin Multiplatform module
│ ├── src/ # Common data models, RPC definitions
│ └── build.gradle.kts # Kotlin RPC + Serialization
├── app-backend/ # Ktor Server Backend
│ ├── src/ # Server implementation
│ ├── logs/ # Runtime logs
│ ├── Makefile # Build & run commands
│ └── build.gradle.kts # Ktor + RPC Server
├── app-notebook/ # Compose Desktop Frontend
│ ├── src/ # UI implementation
│ ├── Makefile # Build & run commands
│ └── build.gradle.kts # Compose Desktop + RPC Client
├── buildSrc/ # Build convention plugins
├── gradle/ # Version catalog & wrapper
└── settings.gradle.kts # Multi-module configuration
- Java 17+
- Gradle (via wrapper)
cd app-backend
make runThis starts the Ktor server with RPC endpoints, typically on http://localhost:8080
cd app-notebook
make runThis launches the Compose Desktop application that connects to the backend via RPC
# Backend
./gradlew :app-backend:run
# Frontend (in separate terminal)
./gradlew :app-notebook:runmake build # Build backend
make test # Run tests
make clean # Clean artifacts
make help # Show all commandsmake build # Build desktop app
make test # Run tests
make test-verbose # Run tests with details
make clean # Clean artifacts
make help # Show all commands| Component | Technology | Purpose |
|---|---|---|
| Backend | Ktor Server | HTTP server & routing |
| Frontend | Compose Desktop | Native desktop UI |
| RPC | Kotlin RPC (KRPC) | Type-safe client-server communication |
| Navigation | Voyager | Frontend screen navigation |
| Build | Gradle + KMP | Multi-module build system |
# Test everything
./gradlew check
# Test specific modules
./gradlew :shared:test
./gradlew :app-backend:test
./gradlew :app-notebook:testSee the application in action:
