clockworklabs / clockworklabs/SpacetimeDB

Allow building custom standalone servers

Open
#4,912 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

This issue tracks reimplementing the work from stale PR #2416, which has been closed because it is too far out of date to merge directly.

## Original pull request
- PR #2416: [Allow building custom standalone servers](https://github.com/clockworklabs/SpacetimeDB/pull/2416)
- Original author: @m1guelpf

## What the original PR was trying to do
# Description of Changes

Expands the spacetimedb-standalone crate to also serve as a library to build your own standalone servers with custom auth services and more. This is accomplished by:

  • Publishing some structs/properties to allow reusing the existing StandaloneEnv instead of having to recreate it from scratch.
  • Make StandaloneEnv abstract over any JwtAuthProvider and not just the default (but still default to DefaultJwtAuthProvider, so no API changes for existing clients)

API and ABI breaking changes

I don't believe this includes any breaking changes, other than some of the crate's API now being public. Since the crate is currently marked as unstable, this should be fine.

Expected complexity level and risk

Changes are very simple.

Testing

I'm using this branch locally to develop a custom SpacetimeDB server with stricter authentication requirements.

## Closure context
- Closed from the `close-stale-pr-create-issue` stale-PR sweep.

## Reimplementation notes
- Reimplement this work on top of current `master` in a new PR.
- Keep the original PR linked as historical context and as a source of useful implementation ideas where still relevant.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the current spacetimedb-standalone crate and compare it with the historical PR #2416, focusing on StandaloneEnv and JwtAuthProvider. Reimplement the still-relevant changes on current master so custom standalone servers can provide authentication services while existing clients retain the default behavior. Confirm the resulting crate API supports reuse of StandaloneEnv without requiring it to be recreated.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
authentication, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.