...incl Codebase Comprehension across websockets via Containers, audio/text bidirectional stream for STT/TTS, Clustering, Visualization w/ Vasturiano force-directed graph (WIP) ( via frontend-next )...
List of features:
| Name | Description |
|---|---|
| Routing | Provides a structured routing DSL |
| WebSockets | Adds WebSocket protocol support for bidirectional client connections |
| Raw Sockets | Adds raw socket support for TCP and UDP |
| Raw Secure SSL/TLS Sockets | Adds secure socket support for TCP and UDP |
| kotlinx.serialization | Handles JSON serialization using kotlinx.serialization library |
| Content Negotiation | Provides automatic content conversion according to Content-Type and Accept headers |
| kotlinx.rpc | Adds remote procedure call (RPC) routing |
| Koin | Provides dependency injection |
| HTML DSL | Generates HTML from Kotlin DSL |
| CSS DSL | Generates CSS from Kotlin DSL |
| GSON | Handles JSON serialization using GSON library |
| Micrometer Metrics | Enables Micrometer metrics in your Ktor server application. |
| Metrics | Adds supports for monitoring several metrics |
| KHealth | A simple and customizable health plugin |
| Call Logging | Logs client requests |
| Call ID | Allows to identify a request/call. |
| Swagger | Serves Swagger UI for your project |
| Partial Content | Handles requests with the Range header |
| OpenAPI | Serves OpenAPI documentation |
| HttpsRedirect | Redirects insecure HTTP requests to the respective HTTPS endpoint |
| HSTS | Enables HTTP Strict Transport Security (HSTS) |
| Forwarded Headers | Allows handling proxied headers (X-Forwarded-*) |
| Default Headers | Adds a default set of headers to HTTP responses |
| Caching Headers | Provides options for responding with standard cache-control headers |
| Status Pages | Provides exception handling for routes |
| Static Content | Serves static files from defined locations |
| Server-Sent Events (SSE) | Support for server push events |
| DoubleReceive | Allows ApplicationCall.receive several times |
| LineWebhook | Validates the signature of LineBot webhooks |
| Sessions | Adds support for persistent sessions through cookies or headers |
| Authentication | Provides extension point for handling the Authorization header |
| Authentication OAuth | Handles OAuth Bearer authentication scheme |
| Authentication JWT | Handles JSON Web Token (JWT) bearer authentication scheme |
| Authentication Basic | Handles 'Basic' username / password authentication scheme |
This project includes the following modules:
| Path | Description |
|---|---|
| server | A runnable Ktor server implementation |
| core | Domain objects and interfaces |
| client | Extensions for making requests to the server using Ktor |
To build the project, use one of the following tasks:
| Task | Description |
|---|---|
./gradlew build |
Build everything |
./gradlew :server:buildFatJar |
Build an executable JAR of the server with all dependencies included |
./gradlew :server:buildImage |
Build the docker image to use with the fat JAR |
./gradlew :server:publishImageToLocalRegistry |
Publish the docker image locally |
To run the project, use one of the following tasks:
| Task | Description |
|---|---|
./gradlew :server:run |
Run the server |
./gradlew :server:runDocker |
Run using the local docker image |
If the server starts successfully, you'll see the following output:
2024-12-04 14:32:45.584 [main] INFO Application - Application started in 0.303 seconds.
2024-12-04 14:32:45.682 [main] INFO Application - Responding at http://0.0.0.0:8080
See also;
- Share with your friends and family. Generate a Ktor project --> Ktor Project Generator
- Ktor Documentation
- Ktor GitHub page
- The Ktor Slack chat. You'll need to request an invite to join.
