Skip to content

Commit 621bd84

Browse files
pengyingclaude
andcommitted
feat(samples): scaffold Kotlin backend Gradle project
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e1e998d commit 621bd84

10 files changed

Lines changed: 422 additions & 0 deletions

File tree

samples/kotlin/.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Grid API Credentials (from https://app.lightspark.com)
2+
GRID_API_TOKEN_ID=your_api_token_id
3+
GRID_API_CLIENT_SECRET=your_api_client_secret
4+
5+
# Webhook verification (P-256 public key, PEM format)
6+
GRID_WEBHOOK_PUBLIC_KEY=your_webhook_public_key

samples/kotlin/build.gradle.kts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
plugins {
2+
kotlin("jvm") version "2.1.21"
3+
kotlin("plugin.serialization") version "2.1.21"
4+
id("io.ktor.plugin") version "3.1.3"
5+
}
6+
7+
kotlin {
8+
jvmToolchain {
9+
languageVersion.set(JavaLanguageVersion.of(21))
10+
}
11+
}
12+
13+
group = "com.grid.sample"
14+
version = "0.0.1"
15+
16+
application {
17+
mainClass = "io.ktor.server.netty.EngineMain"
18+
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=true")
19+
}
20+
21+
repositories {
22+
mavenCentral()
23+
}
24+
25+
dependencies {
26+
// Ktor server
27+
implementation("io.ktor:ktor-server-core:3.1.3")
28+
implementation("io.ktor:ktor-server-netty:3.1.3")
29+
implementation("io.ktor:ktor-server-cors:3.1.3")
30+
implementation("io.ktor:ktor-server-sse:3.1.3")
31+
implementation("io.ktor:ktor-server-content-negotiation:3.1.3")
32+
implementation("io.ktor:ktor-server-config-yaml:3.1.3")
33+
34+
// Grid Kotlin SDK
35+
implementation("com.lightspark.grid:lightspark-grid-kotlin:0.4.0")
36+
37+
// JSON
38+
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2")
39+
40+
// Environment
41+
implementation("io.github.cdimascio:dotenv-kotlin:6.4.1")
42+
43+
// Logging
44+
implementation("ch.qos.logback:logback-classic:1.5.6")
45+
}

samples/kotlin/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
kotlin.code.style=official
2+
org.gradle.jvmargs=-Xmx1024m
42.6 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

samples/kotlin/gradlew

Lines changed: 251 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)