Skip to content

Commit efcee03

Browse files
authored
Docs overhaul, un-deprecate createNamespace, generateObject examples (#294)
- Restructure docs: Generate/Deploy/Route concepts, Connect to Rivet, Workloads two-section pattern, Advanced group under Reference, ExampleLinkBar on every example page, simplified intro and quickstarts with merged generate-and-deploy - createNamespace: false now disables namespace provisioning (unset keeps the default); rejected for rivetkit apps - ai-builder example uses generateObject with a zod schema instead of generateText + JSON parsing
1 parent 365240e commit efcee03

10 files changed

Lines changed: 35 additions & 50 deletions

File tree

docs/content/docs/backends.mdx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
---
22
title: "Backends & REST APIs"
3-
description: "Serve HTTP backends and REST APIs from a Dynamic App."
3+
description: "Serve HTTP APIs and frontends from a generated app with any framework that speaks fetch."
44
---
55

66
import ExampleLinkBar from "@/components/docs/ExampleLinkBar.astro";
77

88
<ExampleLinkBar href="https://github.com/rivet-dev/dynamic-apps/tree/main/examples/apps-hello-world" />
99

10-
An app is a directory with a `package.json` and an entrypoint that
11-
default-exports a `fetch` handler. Any framework that speaks `fetch` works.
12-
The app does not bind a port; Dynamic Apps owns its listener. This app serves a
13-
frontend and a JSON API from the same handler.
14-
1510
## Example generated code
1611

1712
<CodeGroup>
@@ -26,5 +21,5 @@ Deploy the directory and every route the app defines is served under
2621

2722
<CodeSnippet file="examples/apps-hello-world/src/server.ts" title="src/server.ts" />
2823

29-
See [Routing](/dynamic-apps/docs/routing) for how requests reach the app and
24+
See [Route](/dynamic-apps/docs/routing) for how requests reach the app and
3025
[Deploy](/dynamic-apps/docs/deploy) for builds and releases.

docs/content/docs/connect.mdx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,25 @@ description: "Every deployed app gets its own Rivet namespace for actors, workfl
44
skill: true
55
---
66

7-
Every deployment gets its own Rivet namespace. That gives each user's app:
7+
`deployApp()` creates one Rivet namespace per app and returns the endpoint,
8+
namespace, pool, and publishable token your client needs to connect.
9+
10+
## What are namespaces?
11+
12+
A namespace holds an app's Rivet Actors, which power:
13+
14+
- [Workflows](/workflows/docs/)
15+
- [SQLite](/actors/docs/sqlite/)
16+
- [Realtime state](/actors/docs/events/)
17+
- [Queues](/actors/docs/queues/)
18+
- [Crons](/actors/docs/schedule/)
19+
20+
Each app gets its own Rivet namespace, which provides it:
821

922
- Complete per-tenant isolation
1023
- Per-user billing
1124
- Infrastructure that costs nothing when idle
1225

13-
## What namespaces are
14-
15-
A namespace holds an app's Rivet Actors, which power its workflows, SQLite,
16-
realtime state, queues, and crons. `deployApp()` creates one namespace per app
17-
and returns the endpoint, namespace, pool, and publishable token your client
18-
needs to connect.
19-
2026
## Connecting to Rivet
2127

2228
### Local development

docs/content/docs/deploy.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Deploy"
3-
description: "Deploy a directory or generated files with deployApp(), preserve rollback, and configure app actors."
3+
description: "Deploy a directory or generated files with deployApp() and repair failed builds."
44
skill: true
55
---
66

@@ -13,7 +13,7 @@ Deploy a local application directory:
1313
```ts
1414
await deployApp({
1515
appId: "hello-world",
16-
source: new URL("../fixtures/app/", import.meta.url),
16+
source: new URL("./app/", import.meta.url),
1717
});
1818
```
1919

docs/content/docs/multiplayer.mdx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
---
22
title: "Multiplayer"
3-
description: "Share realtime state between every client connected to an app."
3+
description: "An actor holds a room's shared state and broadcasts events to every connected client."
44
---
55

66
import ExampleLinkBar from "@/components/docs/ExampleLinkBar.astro";
77

88
<ExampleLinkBar href="https://github.com/rivet-dev/dynamic-apps/tree/main/examples/apps-multiplayer" />
99

10-
An actor holds the shared state for one room and broadcasts events to every
11-
connected client.
12-
1310
## Example generated code
1411

1512
<CodeSnippet file="examples/apps-multiplayer/fixtures/app/src/index.ts" title="App" />
@@ -21,5 +18,5 @@ Deploy the app, then connect to its actors from your own system:
2118
<CodeSnippet file="examples/apps-multiplayer/src/client.ts" region="client" title="Client" />
2219

2320
Dynamic Apps does not wrap RivetKit's action, event, or connection APIs. See
24-
[Events](https://rivet.dev/actors/docs/events/) and
25-
[Connections](https://rivet.dev/actors/docs/connections/) in Rivet Actors.
21+
[Events](/actors/docs/events/) and
22+
[Connections](/actors/docs/connections/) in Rivet Actors.

docs/content/docs/quickstart-core.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Quickstart](/dynamic-apps/docs/quickstart).
2424
| Build artifact storage | Provide upload and download handlers | Stored automatically |
2525
| Cache invalidation after updates | Manual notification with `watchActiveRelease` | Handled automatically |
2626
| Rivet namespace per app | Bring your own integration | Created and connected automatically |
27-
| Regions and scaling | Managed by your host | Managed through Rivet deployment options |
27+
| Regions and scaling | Managed by your host | Managed by Rivet |
2828
| Lifecycle | Explicit `dispose()` | Managed by the package |
2929
| Best for | Custom infrastructure | Batteries included and scalable |
3030

@@ -37,7 +37,7 @@ Quickstart](/dynamic-apps/docs/quickstart).
3737
Use Node.js 22 or newer:
3838

3939
```sh
40-
npm add @rivet-dev/dynamic-apps-core @hono/node-server hono
40+
npm add @rivet-dev/dynamic-apps-core @rivet-dev/dynamic-apps @hono/node-server hono
4141
npm add --save-dev tsx
4242
```
4343

@@ -120,5 +120,5 @@ the first request. Warm requests reuse the cached agentOS VM. Call
120120

121121
</Steps>
122122

123-
Continue with [Core](/dynamic-apps/docs/core) before using
124-
Core across multiple processes.
123+
Read [Core](/dynamic-apps/docs/core) before running it across multiple
124+
processes.

docs/content/docs/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ await deployApp({
8585
});
8686
```
8787

88-
Run the deploy script:
88+
Save this as `src/deploy.ts` and run it:
8989

9090
```sh
9191
npx tsx src/deploy.ts

docs/content/docs/sqlite.mdx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
---
22
title: "SQLite"
3-
description: "Store durable relational data in an actor-owned SQLite database."
3+
description: "Each actor owns its own SQLite database, giving generated apps durable relational data with no extra infrastructure."
44
---
55

66
import ExampleLinkBar from "@/components/docs/ExampleLinkBar.astro";
77

88
<ExampleLinkBar href="https://github.com/rivet-dev/dynamic-apps/tree/main/examples/apps-sqlite" />
99

10-
Apps that depend on `rivetkit` can define actors. Each actor owns its own
11-
SQLite database, so a generated app gets durable relational data without any
12-
extra infrastructure.
13-
1410
## Example generated code
1511

1612
<CodeSnippet file="examples/apps-sqlite/fixtures/app/src/index.ts" title="App" />
@@ -22,5 +18,5 @@ Deploy the app, then connect to its actors from your own system:
2218
<CodeSnippet file="examples/apps-sqlite/src/client.ts" region="client" title="Client" />
2319

2420
`deployApp()` returns the endpoint, namespace, pool, and token the ordinary
25-
RivetKit client needs. See [SQLite in Rivet Actors](https://rivet.dev/actors/docs/sqlite/)
21+
RivetKit client needs. See [SQLite in Rivet Actors](/actors/docs/sqlite/)
2622
for the full database API.

docs/content/docs/static-websites.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
---
22
title: "Frontends & Static Sites"
3-
description: "Serve an HTML, CSS, and JavaScript site from a Dynamic App."
3+
description: "Serve an HTML, CSS, and JavaScript site from a public/ folder in a generated app."
44
---
55

66
import ExampleLinkBar from "@/components/docs/ExampleLinkBar.astro";
77

88
<ExampleLinkBar href="https://github.com/rivet-dev/dynamic-apps/tree/main/examples/apps-static-website" />
99

10-
An app is a directory with a `package.json` and a fetch entrypoint. A static
11-
site is the same directory plus a `public/` folder and a handler that serves
12-
it.
13-
1410
## Example generated code
1511

1612
<CodeGroup>

docs/content/docs/workflows.mdx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
---
22
title: "Workflows"
3-
description: "Run durable multi-step jobs that sleep, scale to zero, and resume."
3+
description: "Run durable multi-step jobs that survive restarts and scale to zero while they sleep."
44
---
55

66
import ExampleLinkBar from "@/components/docs/ExampleLinkBar.astro";
77

88
<ExampleLinkBar href="https://github.com/rivet-dev/dynamic-apps/tree/main/examples/apps-workflows" />
99

10-
An actor's `run` workflow executes when the actor is created. Each step is
11-
durable, so the job survives restarts and the app scales to zero while it
12-
sleeps.
13-
1410
## Example generated code
1511

1612
<CodeSnippet file="examples/apps-workflows/fixtures/app/src/index.ts" title="App" />
@@ -21,5 +17,5 @@ Deploy the app, then connect to its actors from your own system:
2117

2218
<CodeSnippet file="examples/apps-workflows/src/client.ts" region="client" title="Client" />
2319

24-
See [Workflows in Rivet Actors](https://rivet.dev/actors/docs/workflows/) for
20+
See [Workflows in Rivet Actors](/workflows/docs/) for
2521
steps, loops, queues, and error handling.

docs/sidebar.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@
3737
"title": "Route",
3838
"href": "/dynamic-apps/docs/routing",
3939
"icon": "faRoute"
40-
},
41-
{
42-
"title": "Connect to Rivet",
43-
"href": "/dynamic-apps/docs/connect",
44-
"icon": "faPlug"
4540
}
4641
]
4742
},
@@ -81,6 +76,10 @@
8176
"title": "Authentication",
8277
"href": "/dynamic-apps/docs/authentication"
8378
},
79+
{
80+
"title": "Connect to Rivet",
81+
"href": "/dynamic-apps/docs/connect"
82+
},
8483
{
8584
"title": "Collecting Logs",
8685
"href": "/dynamic-apps/docs/logging"

0 commit comments

Comments
 (0)