{"id":15110234,"url":"https://github.com/clockworklabs/spacetimedb","last_synced_at":"2026-07-02T01:02:00.913Z","repository":{"id":185873330,"uuid":"654870350","full_name":"clockworklabs/SpacetimeDB","owner":"clockworklabs","description":"Multiplayer at the speed of light","archived":false,"fork":false,"pushed_at":"2025-04-17T19:47:22.000Z","size":20096,"stargazers_count":14204,"open_issues_count":397,"forks_count":457,"subscribers_count":67,"default_branch":"master","last_synced_at":"2025-04-18T05:50:40.853Z","etag":null,"topics":["database","dataoriented","game-development","relational","relational-database","smart-contracts"],"latest_commit_sha":null,"homepage":"https://spacetimedb.com","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clockworklabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-17T07:28:29.000Z","updated_at":"2025-04-18T05:20:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"fb28a1da-d276-454d-8e7a-733bb58e396b","html_url":"https://github.com/clockworklabs/SpacetimeDB","commit_stats":null,"previous_names":["clockworklabs/spacetimedb"],"tags_count":86,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clockworklabs%2FSpacetimeDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clockworklabs%2FSpacetimeDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clockworklabs%2FSpacetimeDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clockworklabs%2FSpacetimeDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clockworklabs","download_url":"https://codeload.github.com/clockworklabs/SpacetimeDB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250327470,"owners_count":21412436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","dataoriented","game-development","relational","relational-database","smart-contracts"],"created_at":"2024-09-25T23:42:27.575Z","updated_at":"2026-07-02T01:02:00.872Z","avatar_url":"https://github.com/clockworklabs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://spacetimedb.com#gh-dark-mode-only\" target=\"_blank\"\u003e\n\t\u003cimg width=\"320\" src=\"./images/dark/logo.svg\" alt=\"SpacetimeDB Logo\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://spacetimedb.com#gh-light-mode-only\" target=\"_blank\"\u003e\n\t\u003cimg width=\"320\" src=\"./images/light/logo.svg\" alt=\"SpacetimeDB Logo\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://spacetimedb.com#gh-dark-mode-only\" target=\"_blank\"\u003e\n        \u003cimg width=\"250\" src=\"./images/dark/logo-text.svg\" alt=\"SpacetimeDB\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://spacetimedb.com#gh-light-mode-only\" target=\"_blank\"\u003e\n        \u003cimg width=\"250\" src=\"./images/light/logo-text.svg\" alt=\"SpacetimeDB\"\u003e\n    \u003c/a\u003e\n    \u003ch3 align=\"center\"\u003e\n        Development at the speed of light.\n    \u003c/h3\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/clockworklabs/spacetimedb\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/clockworklabs/spacetimedb?color=%23ff00a0\u0026include_prereleases\u0026label=version\u0026sort=semver\u0026style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://github.com/clockworklabs/spacetimedb\"\u003e\u003cimg src=\"https://img.shields.io/badge/built_with-Rust-dca282.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n\t\u003ca href=\"https://github.com/clockworklabs/spacetimedb/actions\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/clockworklabs/spacetimedb/ci.yml?style=flat-square\u0026branch=master\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://status.spacetimedb.com\"\u003e\u003cimg src=\"https://img.shields.io/uptimerobot/ratio/7/m784409192-e472ca350bb615372ededed7?label=cloud%20uptime\u0026style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://hub.docker.com/r/clockworklabs/spacetimedb\"\u003e\u003cimg src=\"https://img.shields.io/docker/pulls/clockworklabs/spacetimedb?style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://github.com/clockworklabs/spacetimedb/blob/master/LICENSE.txt\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-BSL_1.1-00bfff.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://crates.io/crates/spacetimedb\"\u003e\u003cimg src=\"https://img.shields.io/crates/d/spacetimedb?color=e45928\u0026label=Rust%20Crate\u0026style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://www.nuget.org/packages/SpacetimeDB.Runtime\"\u003e\u003cimg src=\"https://img.shields.io/nuget/dt/spacetimedb.runtime?color=0b6cff\u0026label=NuGet%20Package\u0026style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://www.npmjs.com/package/spacetimedb\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/spacetimedb?color=cb0000\u0026label=npm\u0026style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://discord.gg/spacetimedb\"\u003e\u003cimg src=\"https://img.shields.io/discord/1037340874172014652?label=discord\u0026style=flat-square\u0026color=5a66f6\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://twitter.com/spacetime_db\"\u003e\u003cimg src=\"https://img.shields.io/badge/twitter-Follow_us-1d9bf0.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://clockworklabs.io/join\"\u003e\u003cimg src=\"https://img.shields.io/badge/careers-Join_us-86f7b7.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://www.linkedin.com/company/clockworklabs/\"\u003e\u003cimg src=\"https://img.shields.io/badge/linkedin-Connect_with_us-0a66c2.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://discord.gg/spacetimedb\"\u003e\u003cimg height=\"25\" src=\"./images/social/discord.svg\" alt=\"Discord\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://twitter.com/spacetime_db\"\u003e\u003cimg height=\"25\" src=\"./images/social/twitter.svg\" alt=\"Twitter\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://github.com/clockworklabs/spacetimedb\"\u003e\u003cimg height=\"25\" src=\"./images/social/github.svg\" alt=\"GitHub\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://twitch.tv/SpacetimeDB\"\u003e\u003cimg height=\"25\" src=\"./images/social/twitch.svg\" alt=\"Twitch\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://youtube.com/@SpacetimeDB\"\u003e\u003cimg height=\"25\" src=\"./images/social/youtube.svg\" alt=\"YouTube\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://www.linkedin.com/company/clockwork-labs/\"\u003e\u003cimg height=\"25\" src=\"./images/social/linkedin.svg\" alt=\"LinkedIn\"\u003e\u003c/a\u003e\n    \u0026nbsp;\n    \u003ca href=\"https://stackoverflow.com/questions/tagged/spacetimedb\"\u003e\u003cimg height=\"25\" src=\"./images/social/stackoverflow.svg\" alt=\"StackOverflow\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n## What is SpacetimeDB?\n\nSpacetimeDB is a relational database that is also a server. You upload your application logic directly into the database, and clients connect to it without any server in between.\n\nWrite your schema and business logic as a **module** in [Rust](https://spacetimedb.com/docs/quickstarts/rust), [C#](https://spacetimedb.com/docs/quickstarts/c-sharp), [TypeScript](https://spacetimedb.com/docs/quickstarts/typescript), or [C++](https://spacetimedb.com/docs/quickstarts/c-plus-plus). SpacetimeDB compiles it, runs it inside the database, and automatically synchronizes state to connected clients in real-time.\n\nInstead of deploying a web or game server that sits in between your clients and your database, your clients connect directly to the database and execute your application logic in your module. You can write all of your permission and authorization logic right inside your module just as you would in a normal server.\n\nThis means that you can write your entire application in a single language and deploy it as a single binary. No more separate webserver, no more containers, no more Kubernetes, no more VMs, no more DevOps, no more caching later. Zero infrastructure to manage.\n\n\u003cfigure\u003e\n    \u003cimg src=\"./images/basic-architecture-diagram.png\" alt=\"SpacetimeDB Architecture\" style=\"width:100%\"\u003e\n    \u003cfigcaption align=\"center\"\u003e\n        \u003cp align=\"center\"\u003e\u003cb\u003eSpacetimeDB application architecture\u003c/b\u003e\u003cbr /\u003e\u003csup\u003e\u003csub\u003e(elements in white are provided by SpacetimeDB)\u003c/sub\u003e\u003c/sup\u003e\u003c/p\u003e\n    \u003c/figcaption\u003e\n\u003c/figure\u003e\n\nSpacetimeDB is optimized for maximum speed and minimum latency. SpacetimeDB provides all the ACID guarantees of a traditional RDBMS, with all the speed of an optimized web server. All application state is held in memory for fast access, while a commit log on disk provides durability and crash recovery. The entire backend of our MMORPG [BitCraft Online](https://bitcraftonline.com) runs as a single SpacetimeDB module: chat, items, terrain, player positions, everything, synchronized to thousands of players in real-time.\n\n## Quick Start\n\n### 1. Install\n\n```bash\n# macOS / Linux\ncurl -sSf https://install.spacetimedb.com | sh\n\n# Windows (PowerShell)\niwr https://windows.spacetimedb.com -useb | iex\n```\n\n### 2. Log in\n\n```bash\nspacetime login\n```\n\nThis opens a browser to authenticate with GitHub. Your identity is linked to your account so you can publish databases.\n\n### 3. Start developing\n\n```bash\nspacetime dev --template chat-react-ts\n```\n\nThat is it. This creates a project from a template, publishes it to [Maincloud](https://spacetimedb.com/docs/how-to/deploy/maincloud), and watches for file changes, automatically rebuilding and republishing on save. See [pricing](https://spacetimedb.com/pricing) for details.\n\n## How It Works\n\nSpacetimeDB modules define **tables** (your data) and **reducers** (your logic). Clients connect, call reducers, and subscribe to tables. When data changes, SpacetimeDB pushes updates to subscribed clients automatically.\n\n```rust\n// Define a table\n#[spacetimedb::table(accessor = messages, public)]\npub struct Message {\n    #[primary_key]\n    #[auto_inc]\n    id: u64,\n    sender: Identity,\n    text: String,\n}\n\n// Define a reducer (your API endpoint)\n#[spacetimedb::reducer]\npub fn send_message(ctx: \u0026ReducerContext, text: String) {\n    ctx.db.messages().insert(Message {\n        id: 0,\n        sender: ctx.sender,\n        text,\n    });\n}\n```\n\nOn the client side, subscribe and get live updates:\n\n```typescript\nconst [messages] = useTable(tables.message);\n// messages updates automatically when the server state changes.\n// No polling. No refetching.\n```\n\n## Language Support\n\n### Server Modules\n\nWrite your database logic in any of these languages:\n\n| Language | Quickstart |\n|----------|-----------|\n| **Rust** | [Get started](https://spacetimedb.com/docs/quickstarts/rust) |\n| **C#** | [Get started](https://spacetimedb.com/docs/quickstarts/c-sharp) |\n| **TypeScript** | [Get started](https://spacetimedb.com/docs/quickstarts/typescript) |\n| **C++** | [Get started](https://spacetimedb.com/docs/quickstarts/c-plus-plus) |\n\n### Client SDKs\n\nConnect from any of these platforms:\n\n| SDK | Quickstart |\n|-----|-----------|\n| **TypeScript** (React, Next.js, Vue, Svelte, Angular, Node.js, Bun, Deno) | [Get started](https://spacetimedb.com/docs/quickstarts/react) |\n| **Rust** | [Get started](https://spacetimedb.com/docs/quickstarts/rust) |\n| **C#** (standalone and Unity) | [Get started](https://spacetimedb.com/docs/quickstarts/c-sharp) |\n| **C++** (Unreal Engine) | [Get started](https://spacetimedb.com/docs/quickstarts/c-plus-plus) |\n\n## Running with Docker\n\n```bash\ndocker run --rm --pull always -p 3000:3000 clockworklabs/spacetime start\n```\n\n## Building from Source\n\nIf you need features from `master` that have not been released yet:\n\n```bash\n# Prerequisites: Rust toolchain with wasm32-unknown-unknown target\ncurl https://sh.rustup.rs -sSf | sh\n\ngit clone https://github.com/clockworklabs/SpacetimeDB\ncd SpacetimeDB\ncargo build --locked --release -p spacetimedb-standalone -p spacetimedb-update -p spacetimedb-cli\n```\n\nThen install the binaries:\n\n\u003cdetails\u003e\n\u003csummary\u003emacOS / Linux\u003c/summary\u003e\n\n```bash\nmkdir -p ~/.local/bin\nSTDB_VERSION=\"$(./target/release/spacetimedb-cli --version | sed -n 's/.*spacetimedb tool version \\([0-9.]*\\);.*/\\1/p')\"\nmkdir -p ~/.local/share/spacetime/bin/$STDB_VERSION\n\ncp target/release/spacetimedb-update ~/.local/bin/spacetime\ncp target/release/spacetimedb-cli ~/.local/share/spacetime/bin/$STDB_VERSION\ncp target/release/spacetimedb-standalone ~/.local/share/spacetime/bin/$STDB_VERSION\n\n# Add to your shell config if not already present:\nexport PATH=\"$HOME/.local/bin:$PATH\"\n\n# Set the active version:\nspacetime version use $STDB_VERSION\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWindows (PowerShell)\u003c/summary\u003e\n\n```powershell\n$stdbDir = \"$HOME\\AppData\\Local\\SpacetimeDB\"\n$stdbVersion = \u0026 \".\\target\\release\\spacetimedb-cli\" --version |\n    Select-String -Pattern 'spacetimedb tool version ([0-9.]+);' |\n    ForEach-Object { $_.Matches.Groups[1].Value }\nNew-Item -ItemType Directory -Path \"$stdbDir\\bin\\$stdbVersion\" -Force | Out-Null\n\nCopy-Item \"target\\release\\spacetimedb-update.exe\" \"$stdbDir\\spacetime.exe\"\nCopy-Item \"target\\release\\spacetimedb-cli.exe\" \"$stdbDir\\bin\\$stdbVersion\\\"\nCopy-Item \"target\\release\\spacetimedb-standalone.exe\" \"$stdbDir\\bin\\$stdbVersion\\\"\n\n# Add to your system PATH: %USERPROFILE%\\AppData\\Local\\SpacetimeDB\n# Then in a new shell:\nspacetime version use $stdbVersion\n```\n\u003c/details\u003e\n\nVerify with `spacetime --version`.\n\n## Documentation\n\nFull documentation is available at **[spacetimedb.com/docs](https://spacetimedb.com/docs)**, including:\n\n- [Quickstart guides](https://spacetimedb.com/docs) for every supported language and framework\n- [Core concepts](https://spacetimedb.com/docs/core-concepts): tables, reducers, subscriptions, authentication\n- [Tutorials](https://spacetimedb.com/docs/tutorials/chat-app): chat app, Unity multiplayer, Unreal Engine multiplayer\n- [Deployment guide](https://spacetimedb.com/docs/how-to/deploy/maincloud): publishing to Maincloud\n- [CLI reference](https://spacetimedb.com/docs/reference/cli-reference)\n- [SQL reference](https://spacetimedb.com/docs/reference/sql-reference)\n\n## License\n\nSpacetimeDB is licensed under the [Business Source License 1.1 (BSL)](LICENSE.txt). It converts to the AGPL v3.0 with a linking exception after a few years. The linking exception means you are **not** required to open-source your own code if you use SpacetimeDB. You only need to contribute back changes to SpacetimeDB itself.\n\n**Why did we choose this license?**\nWe chose to license SpacetimeDB under the MariaDB Business Source License for 4 years because we can't compete with AWS while also building our products for them.\n\nWe chose GPLv3 with linking exception as the open source license because we want contributions merged back into mainline (just like Linux), but we don't want to make anyone else open source their own code (i.e. linking exception). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclockworklabs%2Fspacetimedb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclockworklabs%2Fspacetimedb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclockworklabs%2Fspacetimedb/lists"}