https://checkmate.social
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 89 lines 2.3 kB view raw
1# Checkmate — real-time chess on atproto + SpacetimeDB 2 3pid_file := ".spacetime.pid" 4log_file := ".spacetime.log" 5 6# Install all dependencies 7install: 8 cd server && bun install 9 cd client && bun install 10 11# Build the SpacetimeDB server module 12build: 13 spacetime build --module-path ./server 14 15# Generate TypeScript client bindings from the server module 16generate: 17 spacetime generate --lang typescript --out-dir client/src/module_bindings --module-path server 18 19# Publish the module to local SpacetimeDB (clears existing data) 20publish: 21 spacetime publish checkmate --module-path ./server --server local --delete-data -y 22 23# Start SpacetimeDB in the background 24up: 25 #!/usr/bin/env bash 26 set -euo pipefail 27 if [ -f {{pid_file}} ] && kill -0 "$(cat {{pid_file}})" 2>/dev/null; then 28 echo "SpacetimeDB already running (pid $(cat {{pid_file}}))" 29 exit 0 30 fi 31 spacetime start --non-interactive > {{log_file}} 2>&1 & 32 echo $! > {{pid_file}} 33 echo "SpacetimeDB started (pid $(cat {{pid_file}}))" 34 # Wait for the server to accept TCP connections 35 for i in $(seq 1 30); do 36 if curl -so /dev/null http://127.0.0.1:3000/ 2>/dev/null; then 37 echo "SpacetimeDB ready" 38 exit 0 39 fi 40 sleep 0.2 41 done 42 echo "Warning: SpacetimeDB may not be ready yet — check 'just logs'" 43 44# Stop SpacetimeDB 45down: 46 #!/usr/bin/env bash 47 set -euo pipefail 48 if [ ! -f {{pid_file}} ]; then 49 echo "No PID file found — SpacetimeDB not running" 50 exit 0 51 fi 52 pid=$(cat {{pid_file}}) 53 if kill -0 "$pid" 2>/dev/null; then 54 kill "$pid" 55 echo "SpacetimeDB stopped (pid $pid)" 56 else 57 echo "SpacetimeDB was not running (stale PID file)" 58 fi 59 rm -f {{pid_file}} 60 61# Start the Vite dev server 62dev: 63 cd client && bun run dev 64 65# Run all tests 66test: 67 cd client && bun run test:ci 68 69# Run tests in watch mode 70test-watch: 71 cd client && bun run test 72 73# Type-check the client 74check: 75 cd client && npx tsc --noEmit 76 77# Full build + type-check + test 78ci: build check test 79 80# View SpacetimeDB server logs 81logs: 82 spacetime logs checkmate 83 84# Query the database 85sql query: 86 spacetime sql checkmate "{{query}}" 87 88# First-time setup: install deps, start db, build, publish, generate bindings 89setup: install up build publish generate