Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configless #57

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Check docs links and headings

concurrency:
group: docs-checks-${{ github.ref }}
cancel-in-progress: true

# On push on all branches, and cron every 12 hours
on:
push:
branches:
- '**'
schedule:
- cron: '0 */12 * * *'

jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Check out Source
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@v4
with:
version: 9

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: 'Install Packages'
run: pnpm install --frozen-lockfile
- name: 'Run scripts'
working-directory: ${{ matrix.service }}
run: pnpm check-docs
26 changes: 14 additions & 12 deletions docs/index.md → content/docs/00-introduction/00-overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# SpacetimeDB Documentation
---
title: SpacetimeDB Documentation
---

## Installation

Expand All @@ -8,9 +10,9 @@ You can find the instructions to install the CLI tool for your platform [here](/

<button to="/install">Click here to install</button>

To get started running your own standalone instance of SpacetimeDB check out our [Getting Started Guide](/docs/getting-started).
To get started running your own standalone instance of SpacetimeDB check out our [Getting Started Guide](/docs/introduction/getting-started).

<button to="/docs/getting-started">Getting Started</button>
<button to="/docs/introduction/getting-started">Getting Started</button>

## What is SpacetimeDB?

Expand Down Expand Up @@ -52,7 +54,7 @@ Each identity has a corresponding authentication token. The authentication token

Additionally, each database has an owner `Identity`. Many database maintenance operations, like publishing a new version or evaluating arbitrary SQL queries, are restricted to only authenticated connections by the owner.

SpacetimeDB provides tools in the CLI and the [client SDKs](/docs/sdks) for managing credentials.
SpacetimeDB provides tools in the CLI and the [client SDKs](/docs/sdk/overview) for managing credentials.

## Addresses

Expand All @@ -68,25 +70,25 @@ Each client connection has an `Address`. These addresses are opaque, and do not

Currently, Rust is the best-supported language for writing SpacetimeDB modules. Support for lots of other languages is in the works!

- [Rust](/docs/modules/rust) - [(Quickstart)](/docs/modules/rust/quickstart)
- [C#](/docs/modules/c-sharp) - [(Quickstart)](/docs/modules/c-sharp/quickstart)
- [Rust](/docs/module/rust-reference) - [(Quickstart)](/docs/module/rust-quickstart)
- [C#](/docs/module/c-sharp-reference) - [(Quickstart)](/docs/module/c-sharp-quickstart)
- Python (Coming soon)
- Typescript (Coming soon)
- C++ (Planned)
- Lua (Planned)

### Client-side SDKs

- [Rust](/docs/sdks/rust) - [(Quickstart)](/docs/sdks/rust/quickstart)
- [C#](/docs/sdks/c-sharp) - [(Quickstart)](/docs/sdks/c-sharp/quickstart)
- [TypeScript](/docs/sdks/typescript) - [(Quickstart)](/docs/sdks/typescript/quickstart)
- [Rust](/docs/sdk/rust-reference) - [(Quickstart)](/docs/sdk/rust-quickstart)
- [C#](/docs/sdk/c-sharp-reference) - [(Quickstart)](/docs/sdk/c-sharp-quickstart)
- [TypeScript](/docs/sdk/typescript-reference) - [(Quickstart)](/docs/sdk/typescript-quickstart)
- Python (Planned)
- C++ (Planned)
- Lua (Planned)

### Unity

SpacetimeDB was designed first and foremost as the backend for multiplayer Unity games. To learn more about using SpacetimeDB with Unity, jump on over to the [SpacetimeDB Unity Tutorial](/docs/unity/part-1).
SpacetimeDB was designed first and foremost as the backend for multiplayer Unity games. To learn more about using SpacetimeDB with Unity, jump on over to the [SpacetimeDB Unity Tutorial](/docs/unity-tutorial/part-1).

## FAQ

Expand All @@ -100,7 +102,7 @@ SpacetimeDB was designed first and foremost as the backend for multiplayer Unity
Just install our command line tool and then upload your application to the cloud.

1. How do I create a new database with SpacetimeDB?
Follow our [Quick Start](/docs/getting-started) guide!
Follow our [Quick Start](/docs/introduction/getting-started) guide!

TL;DR in an empty directory:

Expand All @@ -110,7 +112,7 @@ spacetime publish
```

5. How do I create a Unity game with SpacetimeDB?
Follow our [Unity Project](/docs/unity-tutorial) guide!
Follow our [Unity Project](/docs/unity-tutorial/overview) guide!

TL;DR in an empty directory:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Getting Started
---
title: Getting Started
---

To develop SpacetimeDB applications locally, you will need to run the Standalone version of the server.

Expand All @@ -20,14 +22,14 @@ You are ready to start developing SpacetimeDB modules. See below for a quickstar

### Server (Module)

- [Rust](/docs/modules/rust/quickstart)
- [C#](/docs/modules/c-sharp/quickstart)
- [Rust](/docs/module/rust-quickstart)
- [C#](/docs/module/c-sharp-quickstart)

⚡**Note:** Rust is [roughly 2x faster](https://faun.dev/c/links/faun/c-vs-rust-vs-go-a-performance-benchmarking-in-kubernetes/) than C#

### Client

- [Rust](/docs/sdks/rust/quickstart)
- [C# (Standalone)](/docs/sdks/c-sharp/quickstart)
- [C# (Unity)](/docs/unity/part-1)
- [Typescript](/docs/sdks/typescript/quickstart)
- [Rust](/docs/sdk/rust-quickstart)
- [C# (Standalone)](/docs/sdk/c-sharp-quickstart)
- [C# (Unity)](/docs/unity-tutorial/part-1)
- [Typescript](/docs/sdk/typescript-quickstart)
3 changes: 3 additions & 0 deletions content/docs/00-introduction/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "Introduction"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# SpacetimeDB Cloud Deployment
---
title: SpacetimeDB Cloud Deployment
navTitle: Testnet
---

The SpacetimeDB Cloud is a managed cloud service that provides developers an easy way to deploy their SpacetimeDB apps to the cloud.

Expand Down
3 changes: 3 additions & 0 deletions content/docs/01-deploying/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "Deploying"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Unity Tutorial Overview
---
title: Unity Tutorial Overview
navTitle: Overview
---

Need help with the tutorial or CLI commands? [Join our Discord server](https://discord.gg/spacetimedb)!

Expand All @@ -10,16 +13,16 @@ Tested with UnityEngine `2022.3.20f1 LTS` (and may also work on newer versions).

## Unity Tutorial - Basic Multiplayer

Get started with the core client-server setup. For part 2, you may choose your server module preference of [Rust](/docs/modules/rust) or [C#](/docs/modules/c-sharp):
Get started with the core client-server setup. For part 2, you may choose your server module preference of [Rust](/docs/module/rust-reference) or [C#](/docs/module/c-sharp-reference).

- [Part 1 - Setup](/docs/unity/part-1)
- [Part 2a - Server (Rust)](/docs/unity/part-2a-rust)
- [Part 2b - Server (C#)](/docs/unity/part-2b-c-sharp)
- [Part 3 - Client](/docs/unity/part-3)
- [Part 1 - Setup](/docs/unity-tutorial/part-1)
- [Part 2a - Server (Rust)](/docs/unity-tutorial/part-2a-rust)
- [Part 2b - Server (C#)](/docs/unity-tutorial/part-2b-c-sharp)
- [Part 3 - Client](/docs/unity-tutorial/part-3)

## Unity Tutorial - Advanced

By this point, you should already have a basic understanding of SpacetimeDB client, server and CLI:

- [Part 4 - Resources & Scheduling](/docs/unity/part-4)
- [Part 5 - BitCraft Mini](/docs/unity/part-5)
- [Part 4 - Resources & Scheduling](/docs/unity-advanced/part-4)
- [Part 5 - BitCraft Mini](/docs/unity-advanced/part-5)
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Unity Tutorial - Basic Multiplayer - Part 1 - Setup
---
title: Unity Tutorial - Basic Multiplayer - Part 1 - Setup
navTitle: 1 - Setup
---

![UnityTutorial-HeroImage](/images/unity-tutorial/UnityTutorial-HeroImage.JPG)

Expand Down Expand Up @@ -119,5 +122,5 @@ We chose ECS for this example project because it promotes scalability, modularit

From here, the tutorial continues with your favorite server module language of choice:

- [Rust](part-2a-rust.md)
- [C#](part-2b-csharp.md)
- [Rust](part-2a-rust)
- [C#](part-2b-c-sharp)
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Unity Tutorial - Basic Multiplayer - Part 2a - Server Module (Rust)
---
title: Unity Tutorial - Basic Multiplayer - Part 2a - Server Module (Rust)
navTitle: 2a - Server (Rust)
---

Need help with the tutorial? [Join our Discord server](https://discord.gg/spacetimedb)!

This progressive tutorial is continued from the [Part 1 Tutorial](/docs/unity/part-1)
This progressive tutorial is continued from the [Part 1 Tutorial](/docs/unity-tutorial/part-1)

## Create a Server Module

Expand All @@ -29,7 +32,7 @@ use spacetimedb::{spacetimedb, Identity, SpacetimeType, ReducerContext};
use log;
```

Then we are going to start by adding the global `Config` table. Right now it only contains the "message of the day" but it can be extended to store other configuration variables. This also uses a couple of macros, like `#[spacetimedb(table)]` which you can learn more about in our [Rust module reference](/docs/modules/rust) (including making your tables `private`!). Simply put, this just tells SpacetimeDB to create a table which uses this struct as the schema for the table.
Then we are going to start by adding the global `Config` table. Right now it only contains the "message of the day" but it can be extended to store other configuration variables. This also uses a couple of macros, like `#[spacetimedb(table)]` which you can learn more about in our [Rust module reference](/docs/module/rust-reference) (including making your tables `private`!). Simply put, this just tells SpacetimeDB to create a table which uses this struct as the schema for the table.

**Append to the bottom of lib.rs:**

Expand Down Expand Up @@ -311,4 +314,4 @@ Now that we added chat support, let's publish the latest module version to Space
spacetime publish -c unity-tutorial
```

From here, the [next tutorial](/docs/unity/part-3) continues with a Client (Unity) focus.
From here, the [next tutorial](/docs/unity-tutorial/part-3) continues with a Client (Unity) focus.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Unity Tutorial - Basic Multiplayer - Part 2a - Server Module (C#)
---
title: Unity Tutorial - Basic Multiplayer - Part 2a - Server Module (C#)
navTitle: 2b - Server (C#)
---

Need help with the tutorial? [Join our Discord server](https://discord.gg/spacetimedb)!

This progressive tutorial is continued from the [Part 1 Tutorial](/docs/unity/part-1)
This progressive tutorial is continued from the [Part 1 Tutorial](/docs/unity-tutorial/part-1)

## Create a Server Module

Expand Down Expand Up @@ -30,7 +33,7 @@ using SpacetimeDB.Module;
using static SpacetimeDB.Runtime;
```

Then we are going to start by adding the global `Config` table. Right now it only contains the "message of the day" but it can be extended to store other configuration variables. This also uses a couple of attributes, like `[SpacetimeDB.Table]` which you can learn more about in our [C# module reference](/docs/modules/c-sharp). Simply put, this just tells SpacetimeDB to create a table which uses this struct as the schema for the table.
Then we are going to start by adding the global `Config` table. Right now it only contains the "message of the day" but it can be extended to store other configuration variables. This also uses a couple of attributes, like `[SpacetimeDB.Table]` which you can learn more about in our [C# module reference](/docs/module/c-sharp-reference). Simply put, this just tells SpacetimeDB to create a table which uses this struct as the schema for the table.

**Append to the bottom of lib.cs:**

Expand Down Expand Up @@ -337,4 +340,4 @@ cd server
spacetime publish -c unity-tutorial
```

From here, the [next tutorial](/docs/unity/part-3) continues with a Client (Unity) focus.
From here, the [next tutorial](/docs/unity-tutorial/part-3) continues with a Client (Unity) focus.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Unity Tutorial - Basic Multiplayer - Part 3 - Client
---
title: Unity Tutorial - Basic Multiplayer - Part 3 - Client
navTitle: 3 - Client
---

Need help with the tutorial? [Join our Discord server](https://discord.gg/spacetimedb)!

This progressive tutorial is continued from one of the Part 2 tutorials:

- [Rust Server Module](/docs/unity/part-2a-rust)
- [C# Server Module](/docs/unity/part-2b-c-sharp)
- [Rust Server Module](/docs/unity-tutorial/part-2a-rust)
- [C# Server Module](/docs/unity-tutorial/part-2b-c-sharp)

## Updating our Unity Project Client to use SpacetimeDB

Expand Down Expand Up @@ -464,7 +467,7 @@ Now when you run the game you should be able to send chat messages to other play

This concludes the SpacetimeDB basic multiplayer tutorial, where we learned how to create a multiplayer game. In the next Unity tutorial, we will add resource nodes to the game and learn about _scheduled_ reducers:

From here, the tutorial continues with more-advanced topics: The [next tutorial](/docs/unity/part-4) introduces Resources & Scheduling.
From here, the tutorial continues with more-advanced topics: The [next tutorial](/docs/unity-advanced/part-4) introduces Resources & Scheduling.

---

Expand Down
3 changes: 3 additions & 0 deletions content/docs/02-unity-tutorial/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "Unity Tutorial - Basic Multiplayer"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Unity Tutorial - Advanced - Part 4 - Resources and Scheduling
---
title: Unity Tutorial - Advanced - Part 4 - Resources and Scheduling
navTitle: 4 - Resources & Scheduling
---

Need help with the tutorial? [Join our Discord server](https://discord.gg/spacetimedb)!

This progressive tutorial is continued from the [Part 3](/docs/unity/part-3) Tutorial.
This progressive tutorial is continued from the [Part 3](/docs/unity-tutorial/part-3) Tutorial.

**Oct 14th, 2023: This tutorial has not yet been updated for the recent 0.7.0 release, it will be updated asap!**

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Unity Tutorial - Advanced - Part 5 - BitCraft Mini
---
title: Unity Tutorial - Advanced - Part 5 - BitCraft Mini
navTitle: 5 - BitCraft Mini
---

Need help with the tutorial? [Join our Discord server](https://discord.gg/spacetimedb)!

This progressive tutorial is continued from the [Part 4](/docs/unity/part-3) Tutorial.
This progressive tutorial is continued from the [Part 4](/docs/unity-tutorial/part-3) Tutorial.

**Oct 14th, 2023: This tutorial has not yet been updated for the recent 0.7.0 release, it will be updated asap!**

Expand Down
3 changes: 3 additions & 0 deletions content/docs/03-unity-advanced/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "Unity Advanced"
}
13 changes: 8 additions & 5 deletions docs/modules/index.md → content/docs/04-module/00-overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Server Module Overview
---
title: Server Module Overview
navTitle: Overview
---

Server modules are the core of a SpacetimeDB application. They define the structure of the database and the server-side logic that processes and handles client requests. These functions are called reducers and are transactional, meaning they ensure data consistency and integrity. Reducers can perform operations such as inserting, updating, and deleting data in the database.

Expand All @@ -10,15 +13,15 @@ In the following sections, we'll cover the basics of server modules and how to c

As of SpacetimeDB 0.6, Rust is the only fully supported language for server modules. Rust is a great option for server modules because it is fast, safe, and has a small runtime.

- [Rust Module Reference](/docs/modules/rust)
- [Rust Module Quickstart Guide](/docs/modules/rust/quickstart)
- [Rust Module Reference](/docs/module/rust-reference)
- [Rust Module Quickstart Guide](/docs/module/rust-quickstart)

### C#

We have C# support available in experimental status. C# can be a good choice for developers who are already using Unity or .net for their client applications.

- [C# Module Reference](/docs/modules/c-sharp)
- [C# Module Quickstart Guide](/docs/modules/c-sharp/quickstart)
- [C# Module Reference](/docs/module/c-sharp-reference)
- [C# Module Quickstart Guide](/docs/module/c-sharp-quickstart)

### Coming Soon

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Rust Module Quickstart
---
title: Rust Module Quickstart
navTitle: Rust Quickstart
---

In this tutorial, we'll implement a simple chat server as a SpacetimeDB module.

Expand Down Expand Up @@ -271,6 +274,6 @@ spacetime sql <module-name> "SELECT * FROM Message"

You can find the full code for this module [in the SpacetimeDB module examples](https://github.com/clockworklabs/SpacetimeDB/tree/master/modules/quickstart-chat).

You've just set up your first database in SpacetimeDB! The next step would be to create a client module that interacts with this module. You can use any of SpacetimDB's supported client languages to do this. Take a look at the quickstart guide for your client language of choice: [Rust](/docs/sdks/rust/quickstart), [C#](/docs/sdks/c-sharp/quickstart), or [TypeScript](/docs/sdks/typescript/quickstart).
You've just set up your first database in SpacetimeDB! The next step would be to create a client module that interacts with this module. You can use any of SpacetimDB's supported client languages to do this. Take a look at the quickstart guide for your client language of choice: [Rust](/docs/sdk/rust-quickstart), [C#](/docs/sdk/c-sharp-quickstart), or [TypeScript](/docs/sdk/typescript-quickstart).

If you are planning to use SpacetimeDB with the Unity game engine, you can skip right to the [Unity Comprehensive Tutorial](/docs/unity/part-1) or check out our example game, [BitcraftMini](/docs/unity/part-3).
If you are planning to use SpacetimeDB with the Unity game engine, you can skip right to the [Unity Comprehensive Tutorial](/docs/unity-tutorial/part-1) or check out our example game, [BitcraftMini](/docs/unity-advanced/part-5).
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# SpacetimeDB Rust Modules
---
title: SpacetimeDB Rust Modules
navTitle: Rust Modules
---

Rust clients of SpacetimeDB use the [Rust SpacetimeDB module library][module library] to write modules which interact with the SpacetimeDB database.

Expand Down
Loading
Loading