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
458 changes: 361 additions & 97 deletions Cargo.lock

Large diffs are not rendered by default.

65 changes: 38 additions & 27 deletions spin.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,49 @@
spin_manifest_version = "1"
authors = ["Ryan Levick <me@ryanlevick.com>"]
description = "A voting application written in spin"
spin_manifest_version = 2

[application]
name = "voting-app"
trigger = { type = "http", base = "/" }
version = "0.1.0"
description = "A voting application written in spin"
authors = ["Ryan Levick <me@ryanlevick.com>"]

[[component]]
id = "voting-api"
source = "target/wasm32-wasi/release/todo.wasm"
allowed_http_hosts = []
sqlite_databases = ["default"]
[component.trigger]
[application.trigger.http]
base = "/"

[variables]
sqlite_username = { required = true }
sqlite_password = { required = true }

[[trigger.http]]
id = "trigger-voting-api"
component = "voting-api"
route = "/api/..."
[component.build]
command = "cargo build --target wasm32-wasi --release"

[[trigger.http]]
id = "trigger-fileserver"
component = "fileserver"
route = "/..."

[[trigger.http]]
id = "trigger-sql-cli"
component = "sql-cli"
route = "/internal/sqlite/..."

[component.voting-api]
source = "target/wasm32-wasip1/release/todo.wasm"
allowed_outbound_hosts = ["redis://*:*", "mysql://*:*", "postgres://*:*"]
sqlite_databases = ["default"]

[component.voting-api.build]
command = "cargo build --target wasm32-wasip1"
watch = ["src/**/*", "Cargo.toml"]

[[component]]
[component.fileserver]
source = { url = "https://github.com/fermyon/spin-fileserver/releases/download/v0.0.2/spin_static_fs.wasm", digest = "sha256:65456bf4e84cf81b62075e761b2b0afaffaef2d0aeda521b245150f76b96421b" }
id = "fileserver"
files = [{ source = "static", destination = "/" }]
[component.trigger]
route = "/..."

[variables]
sqlite_username = { required = true }
sqlite_password = { required = true }
allowed_outbound_hosts = ["redis://*:*", "mysql://*:*", "postgres://*:*"]

[[component]]
id = "sql-cli"
[component.sql-cli]
source = { url = "https://github.com/karthik2804/spin-sqlite-web-cli/releases/download/v0.0.1/spin-sqlite-web-cli.wasm", digest = "sha256:e0fb024ffaa68e53118a6b45636161d2a43543cf2bd0b6d027d01a34f4ee56e4" }
variables = { sqlite_username = "macolso", sqlite_password = "fake_password" }
allowed_outbound_hosts = ["redis://*:*", "mysql://*:*", "postgres://*:*"]
sqlite_databases = ["default"]
[component.trigger]
route = "/internal/sqlite/..."
[component.config]
sqlite_username = "macolso"
sqlite_password = "fake_password"
7 changes: 7 additions & 0 deletions static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ Vue.createApp({
return {
submissions: [],
submission: '',
activeTab: 'vote',
showModal: false,
tabs: [
{ id: 'vote', name: 'Voting' },
{ id: 'admin', name: 'Admin' },
{ id: 'history', name: 'History' }
],
}
},

Expand Down
Binary file added static/image/bozon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/image/bozonleft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/image/bozonright.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/image/favicon.ico
Binary file not shown.
Binary file added static/image/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading