Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/default/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
compose-html = "1.10.0"
compose-runtime = "1.10.2"
kobweb = "0.24.0-SNAPSHOT"
kobweb = "0.24.0"
kotlin = "2.3.10"

[libraries]
Expand Down
2 changes: 1 addition & 1 deletion app/empty/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
compose-html = "1.10.0"
compose-runtime = "1.10.2"
kobweb = "0.24.0-SNAPSHOT"
kobweb = "0.24.0"
kotlin = "2.3.10"

[libraries]
Expand Down
2 changes: 1 addition & 1 deletion examples/chat/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
compose-html = "1.10.0"
compose-runtime = "1.10.2"
kobweb = "0.24.0-SNAPSHOT"
kobweb = "0.24.0"
kotlin = "2.3.10"
kotlinx-serialization = "1.10.0"

Expand Down
2 changes: 1 addition & 1 deletion examples/clock/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
compose-html = "1.10.0"
compose-runtime = "1.10.2"
kobweb = "0.24.0-SNAPSHOT"
kobweb = "0.24.0"
kotlin = "2.3.10"

[libraries]
Expand Down
2 changes: 1 addition & 1 deletion examples/imageprocessor/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
compose-html = "1.10.0"
compose-runtime = "1.10.2"
kobweb = "0.24.0-SNAPSHOT"
kobweb = "0.24.0"
kotlin = "2.3.10"
kotlinx-serialization = "1.10.0"

Expand Down
2 changes: 1 addition & 1 deletion examples/jb/counter/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
compose-html = "1.10.0"
compose-runtime = "1.10.2"
kobweb = "0.24.0-SNAPSHOT"
kobweb = "0.24.0"
kotlin = "2.3.10"

[libraries]
Expand Down
2 changes: 1 addition & 1 deletion examples/opengl/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
compose-html = "1.10.0"
compose-runtime = "1.10.2"
kobweb = "0.24.0-SNAPSHOT"
kobweb = "0.24.0"
kotlin = "2.3.10"

[libraries]
Expand Down
29 changes: 29 additions & 0 deletions examples/todo-mongodb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# General ignores
.DS_Store
build
out
kotlin-js-store

# IntelliJ ignores
*.iml
/*.ipr

/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/gradle.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea/artifacts
/.idea/compiler.xml
/.idea/jarRepositories.xml
/.idea/*.iml
/.idea/modules
/.idea/libraries-with-intellij-classes.xml

# Gradle ignores
.gradle

# Kotlin ignores
.kotlin
4 changes: 4 additions & 0 deletions examples/todo-mongodb/.kobweb-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
metadata:
description: "An example TODO app, showcasing client / server interactions with persistence in MongoDB"

# No need for any instructions - we just copy the demo as is
24 changes: 24 additions & 0 deletions examples/todo-mongodb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is a [Kobweb](https://github.com/varabyte/kobweb) project instantiated from the `examples/todo-mongodb` template.

The purpose of this project is to showcase a minimal Todo app, demonstrating:

* a simple, reactive, single-page web app, making use of both Silk UI and Compose for Web
* API endpoints (e.g. for adding, removing, and fetching items)
* how to share types across client and server (see `TodoItem` which has text and an ID value)
* how to use the MongoDB database to persist todos, using the [KtMongo library](https://ktmongo.opensavvy.dev)

I'd like to give credit to https://blog.upstash.com/nextjs-todo for sharing the Next.js version.

---

To run the sample, simply enter the following commands in the terminal:

```bash
$ docker run -d -p '27017:27017' 'mongo:8.0.6' # This will print the container ID when it's started
$ cd site
$ kobweb run
```

and open [http://localhost:8080](http://localhost:8080) with your browser to see the result.

To stop MongoDB, use `docker ps` to find its container ID, then `docker stop <container-id>`.
3 changes: 3 additions & 0 deletions examples/todo-mongodb/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kotlin.code.style=official
org.gradle.caching=true
org.gradle.configuration-cache=true
24 changes: 24 additions & 0 deletions examples/todo-mongodb/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[versions]
compose-html = "1.10.0"
compose-runtime = "1.10.2"
kobweb = "0.24.0"
kotlin = "2.3.10"
kotlinx-serialization = "1.10.0"
ktmongo = "0.29.1"

[libraries]
compose-html-core = { module = "org.jetbrains.compose.html:html-core", version.ref = "compose-html" }
compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "compose-runtime" }
kobweb-api = { module = "com.varabyte.kobweb:kobweb-api", version.ref = "kobweb" }
kobweb-core = { module = "com.varabyte.kobweb:kobweb-core", version.ref = "kobweb" }
kobweb-silk = { module = "com.varabyte.kobweb:kobweb-silk", version.ref = "kobweb" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
silk-icons-fa = { module = "com.varabyte.kobwebx:silk-icons-fa", version.ref = "kobweb" }
ktmongo-coroutines = { module = "dev.opensavvy.ktmongo:driver-coroutines", version.ref = "ktmongo" }

[plugins]
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kobweb-application = { id = "com.varabyte.kobweb.application", version.ref = "kobweb" }
kobwebx-markdown = { id = "com.varabyte.kobwebx.markdown", version.ref = "kobweb" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading