clockworklabs / clockworklabs/SpacetimeDB
quickstart-chat issues with Claude Code
A pull request for this has already been merged.
- #5166 by @clockwork-labs-bot — merged
- Dominant language
- Rust
- Stars
- 25.2k
- Forks
- 1.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 46
Description
Ahoy! Very interesting tool, excited to try it out Claude Code and I tried to install the quickstart-chat app, vanilla.
It was fiddly business, we got there in the end (took ~one instance worth of context.) Here's CC's writeup, I hope this is useful.
In particular I noticed the version depenency was wrong for the rust-client (first attempt, aborted) and I think the quickstart-chat. Given that quickstart-chat is a rust client, the presence of both is confusing but quickstart seems the more recent.
Getting SpacetimeDB Quickstart-Chat Working: The Ideal Path
Here's a summary of the steps needed to get the SpacetimeDB quickstart-chat example working, following the most direct path:
1. Setting up the proper Rust environment
# Install Rust with rustup (not Homebrew) to ensure proper WebAssembly support
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.84.0 --profile default --target wasm32-unknown-unknown
# Add WebAssembly target support
rustup target add wasm32-unknown-unknown
2. Installing and running SpacetimeDB
# Install SpacetimeDB CLI
curl -sSf https://install.spacetimedb.com | sh
# Add SpacetimeDB to PATH
export PATH="$HOME/.local/bin:$PATH"
# Start SpacetimeDB in the background
spacetime start > /tmp/spacetime.log 2>&1 &
3. Publishing the module
# Navigate to the quickstart-chat module directory
cd modules/quickstart-chat
# Build and publish the module
spacetime publish --server http://127.0.0.1:3000 --anonymous chat-demo
4. Building and running the client
# Create a directory for the client
mkdir -p quickstart-chat-client/src
# Copy the module bindings
cp -R modules/quickstart-chat/module_bindings quickstart-chat-client/src/
# Create Cargo.toml with proper dependencies
cat > quickstart-chat-client/Cargo.toml << EOF
[package]
name = "quickstart-chat-client"
version = "0.1.0"
edition = "2021"
[dependencies]
spacetimedb-sdk = "1.0.1"
EOF
# Create main.rs with the client code, using the correct module name
# (Key point: The with_token handling should be optional for first-time users)
# Build and run the client
cd quickstart-chat-client
cargo run
Feedback for SpacetimeDB developers
-
Rust installation instructions: The documentation should emphasize that rustup (not Homebrew Rust) is required for proper WebAssembly support, with specific instructions for the target.
-
Client authentication handling: The example should better handle first-time connections without credentials. Currently, it uses
.expect()which causes errors for new users. -
Module ownership and permissions: We encountered several permission errors when trying to republish or update modules. A clearer ownership model or easier way to manage modules for development would be helpful.
-
Non-interactive client options: The example could benefit from a non-interactive mode for testing, as interactive terminal input can be challenging in some environments.
-
Better error messages: When the server isn't running, the client error messages could be more clear about connection issues.
-
Documentation for common operations: More examples for common tasks like listing databases, checking status, deleting, and updating modules would be helpful.
-
WebAssembly optimization warnings: The warning about missing wasm-opt is confusing for beginners. Either include it or make the warning less prominent.
-
Consistent API across language SDKs: Ensure authentication and connection patterns are consistent across different SDKs.
-
Offline development mode: A simpler local development experience that doesn't require authentication would help developers get started more quickly.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the modules/quickstart-chat setup, its generated module_bindings, Cargo.toml, and main.rs instructions, then compare the reported Rust, authentication, permissions, and CLI problems with merged pull request #5166. Done should mean a single verified quickstart path and clearly scoped follow-up work for any remaining issues.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, wasm
- Domain
- authentication, cli, databases, documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100