chore: add initial project structure and tooling

This commit is contained in:
2025-06-08 15:12:13 +08:00
parent fdca40817a
commit 7629a3f030
10 changed files with 137 additions and 1 deletions

25
activity/Taskfile.yml Normal file
View File

@@ -0,0 +1,25 @@
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
silent: true
vars:
GIT_ROOT:
sh: git rev-parse --show-toplevel
tasks:
default:
cmds:
- go mod tidy
- task -l --json | jq -r '.tasks[].name' | fzf --tmux | xargs task
gen:templ:
aliases: [templ]
desc: Templ Generate
cmds:
- templ generate
gen:sqlc:
aliases: [sqlc]
desc: Sqlc Generate
cmds:
- sqlc generate

4
bindings.go Normal file
View File

@@ -0,0 +1,4 @@
//go:build js && wasm
// +build js,wasm
package dbx

View File

@@ -1 +0,0 @@
package dbx

4
connection.go Normal file
View File

@@ -0,0 +1,4 @@
//go:build js && wasm
// +build js,wasm
package dbx

6
database.go Normal file
View File

@@ -0,0 +1,6 @@
//go:build js && wasm
// +build js,wasm
package dbx
import _ "github.com/syumai/workers/cloudflare/d1"

2
go.mod
View File

@@ -1,3 +1,5 @@
module github.com/cf-sonr/dbx
go 1.24.2
require github.com/syumai/workers v0.30.2

2
go.sum Normal file
View File

@@ -0,0 +1,2 @@
github.com/syumai/workers v0.30.2 h1:ZefPdAoXBsw87Bxy1LTAR6Pm9Gbxw/iM7DNraPSput0=
github.com/syumai/workers v0.30.2/go.mod h1:ZnqmdiHNBrbxOLrZ/HJ5jzHy6af9cmiNZk10R9NrIEA=

25
network/Taskfile.yml Normal file
View File

@@ -0,0 +1,25 @@
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
silent: true
vars:
GIT_ROOT:
sh: git rev-parse --show-toplevel
tasks:
default:
cmds:
- go mod tidy
- task -l --json | jq -r '.tasks[].name' | fzf --tmux | xargs task
gen:templ:
aliases: [templ]
desc: Templ Generate
cmds:
- templ generate
gen:sqlc:
aliases: [sqlc]
desc: Sqlc Generate
cmds:
- sqlc generate

25
users/Taskfile.yml Normal file
View File

@@ -0,0 +1,25 @@
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
silent: true
vars:
GIT_ROOT:
sh: git rev-parse --show-toplevel
tasks:
default:
cmds:
- go mod tidy
- task -l --json | jq -r '.tasks[].name' | fzf --tmux | xargs task
gen:templ:
aliases: [templ]
desc: Templ Generate
cmds:
- templ generate
gen:sqlc:
aliases: [sqlc]
desc: Sqlc Generate
cmds:
- sqlc generate

44
wrangler.toml Normal file
View File

@@ -0,0 +1,44 @@
# Top-level configuration
name = "motr-dbx"
main = "worker.mjs"
compatibility_date = "2025-04-14"
[build]
command = "make build"
[dev]
port = 6969
[observability]
enabled = true
[triggers]
crons = ["0 */1 * * *"]
[[d1_databases]]
binding = "ACTIVITY_DB"
database_name = "motr-activity"
database_id = "a7ccb4bb-c529-4f42-8029-92564a3aecb8"
[[d1_databases]]
binding = "NETWORK_DB"
database_name = "motr-network"
database_id = "acb75499-3502-4052-9604-263a913e077a"
[[d1_databases]]
binding = "USERS_DB"
database_name = "motr-users"
database_id = "8ed4d399-5932-419c-b92f-9c20d7a36ad2"
[[kv_namespaces]]
binding = "SESSIONS_KV"
id = "ea5de66fcfc14b5eba170395e29432ee"
[[kv_namespaces]]
binding = "HANDLES_KV"
id = "271d47087a8842b2aac5ee79cf7bb203"
[[r2_buckets]]
binding = 'PROFILES'
bucket_name = 'profiles'