From 6e38203b5ab81a1085826086d0072340543a646c Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Fri, 25 Apr 2025 09:02:34 -0700 Subject: [PATCH] docs: clean up separation between actors/containers/functions --- README.md | 2 +- .../components/src/actors/get-started.tsx | 18 ++- site/_redirects | 2 + site/scripts/generateApi.js | 2 +- .../{javascript-runtime.mdx => actors.mdx} | 39 +++-- site/src/content/docs/api/routes/delete.mdx | 37 +++++ site/src/content/docs/api/routes/list.mdx | 37 +++++ site/src/content/docs/api/routes/update.mdx | 41 +++++ .../{container-runtime.mdx => containers.mdx} | 84 +++++----- site/src/content/docs/continuous-delivery.mdx | 7 +- site/src/content/docs/functions.mdx | 148 ++++++++++++++++++ site/src/content/docs/index.mdx | 42 ++--- site/src/content/docs/install.mdx | 6 - .../content/docs/solutions/game-servers.mdx | 20 +-- site/src/content/docs/troubleshooting.mdx | 2 +- site/src/generated/apiPages.json | 15 ++ site/src/sitemap/mod.ts | 50 ++++-- 17 files changed, 426 insertions(+), 126 deletions(-) rename site/src/content/docs/{javascript-runtime.mdx => actors.mdx} (78%) create mode 100644 site/src/content/docs/api/routes/delete.mdx create mode 100644 site/src/content/docs/api/routes/list.mdx create mode 100644 site/src/content/docs/api/routes/update.mdx rename site/src/content/docs/{container-runtime.mdx => containers.mdx} (62%) create mode 100644 site/src/content/docs/functions.mdx diff --git a/README.md b/README.md index b35d12cbc7..beaa37a39e 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ iwr https://releases.rivet.gg/rivet/latest/install.ps1 -useb | iex ### Quickstart (TypeScript) -_See the [full quickstart guide](https://rivet.gg/docs/quickstart/typescript) for a comprehensive walkthrough._ +_See the [full quickstart guide](https://rivet.gg/docs/actors) for a comprehensive walkthrough._ **Step 1: Create Actor** diff --git a/frontend/packages/components/src/actors/get-started.tsx b/frontend/packages/components/src/actors/get-started.tsx index 3e6b4dc930..be0f881877 100644 --- a/frontend/packages/components/src/actors/get-started.tsx +++ b/frontend/packages/components/src/actors/get-started.tsx @@ -1,4 +1,4 @@ -import { Icon, faTs } from "@rivet-gg/icons"; +import { Icon, faTs, faFunction, faServer, faActors } from "@rivet-gg/icons"; import { motion } from "framer-motion"; import type { ComponentProps } from "react"; import { Button } from "../ui/button"; @@ -15,8 +15,20 @@ export function ActorsResources() { + + diff --git a/site/_redirects b/site/_redirects index 1501946391..9bd8b5bede 100644 --- a/site/_redirects +++ b/site/_redirects @@ -4,3 +4,5 @@ /docs/html5/* https://opengamebackend.org/game-engines/html5 302 /docs/custom/* https://opengamebackend.org/game-engines/html5 302 /modules/* https://opengamebackend.org/modules 302 +/docs/javascript-runtime /docs/actors 302 +/docs/container-runtime /docs/containers 302 diff --git a/site/scripts/generateApi.js b/site/scripts/generateApi.js index 243c2eb048..d2324999bd 100755 --- a/site/scripts/generateApi.js +++ b/site/scripts/generateApi.js @@ -27,7 +27,7 @@ export async function main() { for (let method in SPEC.paths[pathName]) { let specPath = SPEC.paths[pathName][method]; - if (!/^(actors|builds|regions)_/.test(specPath.operationId)) continue; + if (!/^(actors|builds|regions|routes)_/.test(specPath.operationId)) continue; console.log('Registering', method, pathName); diff --git a/site/src/content/docs/javascript-runtime.mdx b/site/src/content/docs/actors.mdx similarity index 78% rename from site/src/content/docs/javascript-runtime.mdx rename to site/src/content/docs/actors.mdx index 0c12c9f52d..0aefbb0ae7 100644 --- a/site/src/content/docs/javascript-runtime.mdx +++ b/site/src/content/docs/actors.mdx @@ -1,14 +1,21 @@ -# JavaScript Runtime +# Rivet Actors -The Rivet JavaScript runtime is built on lightweight JavaScript containers called V8 isolates, providing a high-performance, secure environment for your actor code. - -It's designed to be widely compatible with Node.js and NPM dependencies, making it easy to use familiar libraries and tools. +Rivet Actors allows you to deploy resilient, stateful services that maintain their state between requests. Use them for websocket servers, game backends, real-time collaboration services, and more. For getting started quickly using JavaScript, we recommend trying [ActorCore](https://actorcore.org) – our full-stack framework for working with Rivet Actors. -## Basic Setup +## What are actors good for? + +- **Stateful Services**: Applications where maintaining state across interactions is critical. For example, **Collaborative Apps** with shared editing and automatic persistence. +- **Realtime Systems**: Applications requiring fast, in-memory state modifications or push updates to connected clients. For example, **Multiplayer Games** with game rooms and player state. +- **Long-Running Processes**: Tasks that execute over extended periods or in multiple steps. For example, **AI Agents** with ongoing conversations and stateful tool calls. +- **Durability**: Processes that must survive crashes and restarts without data loss. For example, **Durable Execution** workflows that continue after system restarts. +- **Horizontal Scalability**: Systems that need to scale by distributing load across many instances. For example, **Realtime Stream Processing** for stateful event handling. +- **Local-First Architecture**: Systems that synchronize state between offline clients. For example, **Local-First Sync** between devices. + +## Quickstart ### Step 1: Writing an actor @@ -26,22 +33,20 @@ Every actor must export a default object with an async `start` function. Here's ```ts {{"file": "src/index.ts"}} import type { ActorContext } from "@rivet-gg/actor"; -import * as http from "http"; +import { Hono } from "hono"; export default { async start(ctx: ActorContext) { - // Get the port from environment variables or use a default - const port = parseInt(process.env.PORT_HTTP || "8080"); + const port = parseInt(Deno.env.get("PORT_HTTP") || "8080"); console.log(`HTTP server running on port ${port}`); - // Create an HTTP server - const server = http.createServer((req, res) => { - res.writeHead(200, { "Content-Type": "text/plain" }); - res.end(`Hello from Rivet Actor ${ctx.metadata.actor.id} running in ${ctx.metadata.region.id}!`); + const app = new Hono(); + + app.get("/", (c) => { + return c.text(`Hello from Rivet Actor ${ctx.metadata.actor.id} running in ${ctx.metadata.region.id}!`); }); - // Start listening on the specified port - server.listen(port); + Deno.serve({ port }, app.fetch); // Keep the actor running until explicitly destroyed await new Promise((resolve) => {}); @@ -50,8 +55,8 @@ export default { ``` What this code does: -- Sets up a simple HTTP server using Node.js's built-in http module -- Creates a response that includes the actor ID and region information +- Creates a simple HTTP server using Hono with Deno +- Sets up a route that returns the actor ID and region information - Keeps the actor running indefinitely by returning a promise that never resolves @@ -74,7 +79,7 @@ Specify the script in your `rivet.json`: ```json {{ "title": "rivet.json" }} { - "builds": { + "actors": { "my-actor": { "script": "./src/index.ts" } diff --git a/site/src/content/docs/api/routes/delete.mdx b/site/src/content/docs/api/routes/delete.mdx new file mode 100644 index 0000000000..c40a72031f --- /dev/null +++ b/site/src/content/docs/api/routes/delete.mdx @@ -0,0 +1,37 @@ +{/* This file is auto-generated by `generateApi.js`. + * + * Do not edit this file directly. + */} + +import { JsonSchemaPreview, PropertyLabel } from '@/components/JsonSchemaPreview'; +import API_SCHEMA from './../spec.json'; + +# routes.delete + +## Description +Deletes a route. + +## Code Examples + + + +```bash {{ "title": "cURL" }} +curl -X DELETE 'https://api.rivet.gg/routes/{id}' +``` + +```ts +// Create Rivet client +import { RivetClient } from '@rivet-gg/api'; +const RIVET = new RivetClient({ token: '[YOUR TOKEN HERE]' }); + +// Make request +await RIVET.routes.delete({ + // Add your request body here +}); +``` + + + +## Schema + + diff --git a/site/src/content/docs/api/routes/list.mdx b/site/src/content/docs/api/routes/list.mdx new file mode 100644 index 0000000000..a4833436d6 --- /dev/null +++ b/site/src/content/docs/api/routes/list.mdx @@ -0,0 +1,37 @@ +{/* This file is auto-generated by `generateApi.js`. + * + * Do not edit this file directly. + */} + +import { JsonSchemaPreview, PropertyLabel } from '@/components/JsonSchemaPreview'; +import API_SCHEMA from './../spec.json'; + +# routes.list + +## Description +Lists all routes of the given environment. + +## Code Examples + + + +```bash {{ "title": "cURL" }} +curl -X GET 'https://api.rivet.gg/routes' +``` + +```ts +// Create Rivet client +import { RivetClient } from '@rivet-gg/api'; +const RIVET = new RivetClient({ token: '[YOUR TOKEN HERE]' }); + +// Make request +await RIVET.routes.list({ + // Add your request body here +}); +``` + + + +## Schema + + diff --git a/site/src/content/docs/api/routes/update.mdx b/site/src/content/docs/api/routes/update.mdx new file mode 100644 index 0000000000..02960c36f9 --- /dev/null +++ b/site/src/content/docs/api/routes/update.mdx @@ -0,0 +1,41 @@ +{/* This file is auto-generated by `generateApi.js`. + * + * Do not edit this file directly. + */} + +import { JsonSchemaPreview, PropertyLabel } from '@/components/JsonSchemaPreview'; +import API_SCHEMA from './../spec.json'; + +# routes.update + +## Description +Creates or updates a route. + +## Code Examples + + + +```bash {{ "title": "cURL" }} +# Write the request body to body.json before running +curl -X PUT -d '@body.json' 'https://api.rivet.gg/routes/{id}' + + +``` + +```ts +// Create Rivet client +import { RivetClient } from '@rivet-gg/api'; +const RIVET = new RivetClient({ token: '[YOUR TOKEN HERE]' }); + +// Make request +await RIVET.routes.update({ + // Add your request body here +}); +``` + + + +## Schema + + + diff --git a/site/src/content/docs/container-runtime.mdx b/site/src/content/docs/containers.mdx similarity index 62% rename from site/src/content/docs/container-runtime.mdx rename to site/src/content/docs/containers.mdx index e353c1719e..df0203073b 100644 --- a/site/src/content/docs/container-runtime.mdx +++ b/site/src/content/docs/containers.mdx @@ -1,12 +1,17 @@ -# Container Runtime +# Rivet Containers -Rivet supports deploying containerized applications using Docker. Your application can be packaged in a standard Dockerfile, giving you complete flexibility for your runtime environment. +Rivet Containers allows you to deploy any application packaged as a Docker container to the cloud. Deploy web servers, game backends, or any custom service with complete control over your runtime environment. - - For getting started quickly using JavaScript, we recommend trying [ActorCore](https://actorcore.org) – our full-stack framework for working with Rivet Actors. - +## What are containers good for? -## Basic Setup +- **High-Memory Workloads**: Applications requiring substantial RAM for processing large data. For example, **PDF Processing** with document parsing and transformation. +- **CPU-Heavy Workloads**: Tasks demanding significant computational resources. For example, **Media Transcoding** with FFmpeg for video conversion. +- **Browser Automation**: Headless browsers for testing, scraping, or rendering. For example, **Web Scraping** with Puppeteer or Playwright. +- **Sandboxed Code Execution**: Safely running untrusted code in isolated environments. For example, **MMOs** or **First-Person Shooters**. +- **Headless Game Servers**: Game backends without rendering requirements. For example, **Turn-Based Game Logic** for chess or card games. +- **Custom Dependencies**: Applications requiring specific system libraries or tools. For example, **Computer Vision Processing** with OpenCV dependencies. + +## Quickstart ### Step 1: Writing a Dockerfile @@ -17,7 +22,7 @@ const http = require('http'); const server = http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end("Hello from Rivet Container Actor!"); + res.end("Hello from Rivet Container!"); }); const port = process.env.PORT_HTTP; @@ -50,7 +55,7 @@ CMD ["node", "server.js"] ``` - We'll pass the prots & env vars used in the Dockerfile in _Step 3_. Read more in the API docs for [actors.create](/docs/api/actors/create). + We'll pass the ports & env vars used in the Dockerfile in _Step 3_. Read more in the API docs for [actors.create](/docs/api/actors/create). ### Step 2: Deploying a container @@ -59,8 +64,8 @@ Specify the Dockerfile in your `rivet.json`: ```json {{ "title": "rivet.json" }} { - "builds": { - "my-actor": { + "containers": { + "my-container": { "dockerfile": "Dockerfile" } } @@ -73,7 +78,7 @@ Now deploy your container with: rivet deploy ``` -### Step 3: Starting an actor +### Step 3: Starting a container In this step, you're requesting Rivet to launch your containerized application in the cloud: @@ -86,22 +91,22 @@ const client = new RivetClient({ token: process.env.RIVET_TOKEN }); -// Create an actor - this launches your container on Rivet's infrastructure +// Create a container - this launches your container on Rivet's infrastructure const { actor } = await client.actors.create({ // Your project and environment IDs from the Rivet dashboard project: "your-project-id", environment: "your-environment-id", body: { - // Tags help identify this specific actor instance - // You can query actors by these tags later - tags: { name: "my-actor" }, + // Tags help identify this specific container instance + // You can query containers by these tags later + tags: { name: "my-container" }, - // buildTags determine which actor code to run + // buildTags determine which container code to run // This should match tags in your rivet.json build configuration // The current tag is automatically assigned on deploy - buildTags: { name: "my-actor", current: "true" }, + buildTags: { name: "my-container", current: "true" }, - // Network configuration for your actor + // Network configuration for your container network: { ports: { http: { @@ -123,10 +128,15 @@ const { actor } = await client.actors.create({ } }); -// The actor.id is a unique identifier for this actor instance -console.log("Created actor:", actor.id); +// The actor.id is a unique identifier for this container instance +console.log("Created container:", actor.id); ``` + + While this feature is called "Containers" in the UI and documentation, the underlying API uses the term "actors" (e.g., `client.actors.create`). This is because there is a lot of overlap between the actor & container APIs. + + + What happens during creation: - Rivet finds the latest build matching your `buildTags` - It provisions resources in the specified region (or chooses the best one) @@ -135,58 +145,58 @@ What happens during creation: See [actors.create](/docs/api/actors/create) for more options. -### Step 4: Connecting to an actor +### Step 4: Connecting to a container -Once your container is running, you can access its URL directly from the actor object: +Once your container is running, you can access its URL directly from the container object: ```typescript // The actor response includes the URL information // You can access it for any port you configured const httpUrl = actor.network.ports.http.url; -// The URL is a public endpoint to your actor -console.log("Actor HTTP URL:", httpUrl); +// The URL is a public endpoint to your container +console.log("Container HTTP URL:", httpUrl); -// Use the URL to communicate with your actor +// Use the URL to communicate with your container // In this example, we're calling our HTTP server const response = await fetch(httpUrl); const text = await response.text(); -console.log("Response from actor:", text); +console.log("Response from container:", text); ``` What happens during connection: -- Each port configured for your actor gets a unique URL -- These URLs are accessible based on your actor's security settings -- The URL routes to your actor regardless of which region it's in +- Each port configured for your container gets a unique URL +- These URLs are accessible based on your container's security settings +- The URL routes to your container regardless of which region it's in - For additional security, you can use `getConnection` to generate temporary, authenticated URLs See [actors.get](/docs/api/actors/get) for more details. -### Step 5: Destroying an actor +### Step 5: Destroying a container -When you're finished using the actor, it's important to destroy it to free up resources: +When you're finished using the container, it's important to destroy it to free up resources: ```typescript -// Destroy the actor to free up resources and stop billing +// Destroy the container to free up resources and stop billing await client.actors.destroy(actor.id, { project: "your-project-id", environment: "your-environment-id", }); -console.log("Actor destroyed"); +console.log("Container destroyed"); ``` What happens during destruction: - Rivet sends a termination signal to your container - Your container gets a short grace period to clean up resources -- All compute resources associated with the actor are freed -- You stop being billed for the actor's runtime +- All compute resources associated with the container are freed +- You stop being billed for the container's runtime See [actors.destroy](/docs/api/actors/destroy) for more details. - Always destroy actors when you're done with them to avoid unnecessary costs. - Actors will continue running and billing will continue until explicitly destroyed. + Always destroy containers when you're done with them to avoid unnecessary costs. + Containers will continue running and billing will continue until explicitly destroyed. ## Configuration Options diff --git a/site/src/content/docs/continuous-delivery.mdx b/site/src/content/docs/continuous-delivery.mdx index 62257cd28d..2ee44c4ce1 100644 --- a/site/src/content/docs/continuous-delivery.mdx +++ b/site/src/content/docs/continuous-delivery.mdx @@ -9,8 +9,9 @@ Automating deployments to Rivet with GitHub Actions allows you to seamlessly dep Before setting up continuous delivery, you need a working Rivet application: 1. Set up your application using one of the following guides: - - [JavaScript Runtime](/docs/javascript-runtime) - For JavaScript applications - - [Container Runtime](/docs/container-runtime) - For Docker containers + - [Actors](/docs/actors) + - [Containers](/docs/containers) + - [Functions](/docs/functions) 2. Make sure you have a working `rivet.json` configuration file in your project @@ -97,7 +98,7 @@ After pushing your changes: 1. Navigate to your GitHub repository and click the "Actions" tab 2. Find the latest workflow run and check its status 3. In the Rivet Dashboard, go to your project's environment -4. Under the "Builds" tab, you should see your latest deployment with the commit SHA included in the tags +4. Under the "Versions" tab, you should see your latest deployment with the commit SHA included in the tags ## Tips diff --git a/site/src/content/docs/functions.mdx b/site/src/content/docs/functions.mdx new file mode 100644 index 0000000000..2fa68637bd --- /dev/null +++ b/site/src/content/docs/functions.mdx @@ -0,0 +1,148 @@ +# Rivet Functions + +Rivet Functions allows you to deploy serverless functions that can handle HTTP requests. You can write your functions and package them in containers. + +## What are functions good for? + +- **API Endpoints**: Building lightweight, scalable REST or GraphQL APIs. For example, **CRUD Operations** for your application's data layer. +- **Webhook Handlers**: Processing events from third-party services. For example, **Payment Processing** with Stripe or PayPal integration. +- **Authentication Services**: Managing user identity and access control. For example, **OAuth Flows** or custom authentication systems. + +## Quickstart + +### 1. Set up your project + +Let's create a simple Node.js HTTP server project: + +```bash +# Create project +mkdir my-rivet-function +cd my-rivet-function + +# Setup NPM +npm init -y +npm install hono +``` + +Add the following files: + + + +```json {{ "title": "rivet.json" }} +{ + "functions": { + "hello-world": { + "dockerfile": "Dockerfile" + } + } +} +``` + +```javascript {{ "title": "index.js" }} +const { Hono } = require('hono'); +const { serve } = require('hono/node-server'); +const app = new Hono(); +const port = process.env.PORT_HTTP || 8080; + +app.get('/', (c) => { + return c.text('Hello from Rivet Functions!'); +}); + +app.get('/api/data', (c) => { + return c.json({ + message: 'This is data from your Rivet Function', + timestamp: new Date().toISOString() + }); +}); + +console.log(`Server running on port ${port}`); +serve({ + fetch: app.fetch, + port +}); +``` + +```dockerfile {{ "title": "Dockerfile" }} +FROM node:18-alpine + +RUN addgroup -S rivet && adduser -S rivet -G rivet + +WORKDIR /app + +COPY package*.json ./ +RUN npm install +COPY . . + +RUN chown -R rivet:rivet /app +USER rivet + +EXPOSE 8080 + +CMD ["node", "index.js"] +``` + + + +See [Containers documentation](/docs/containers) for more information on writing code for the Rivet platform. + +### 2. Deploy your function + +```bash +rivet deploy +``` + +You will be prompted to configure a route on the first run. You can use the recommended route or configure it later in the dashboard under the _Functions_ tab. + +### 3. Test your function + +Visit your function at the configured URL. You can monitor the logs in the _Logs_ tab of the Rivet Dashboard. + +## Configuration Options + +### Basic Configuration + +| Option | Description | +|--------|-------------| +| `path` | The URL path to route requests to (cannot end with `/`) | +| `route_subpaths` | When true, routes requests to this path and all nested subpaths to this function | +| `strip_prefix` | When true, removes the configured path prefix from the request URL before forwarding to your function | +| `resources.cpu` | CPU allocation for the function (defaults to 1) | +| `resources.memory` | Memory allocation in MB (defaults to 1024) | +| `networking.internal_port` | The port your function listens on within the container | + +#### Example: route_subpaths + +When `route_subpaths` is `true`: +- Function with path `/api` will handle requests to `/api`, `/api/users`, `/api/products`, and any other path starting with `/api` + +When `route_subpaths` is `false`: +- Function with path `/api` will only handle requests to the exact path `/api` and nothing else + +#### Example: strip_prefix + +When `strip_prefix` is `true`: +- Request to `/api/users` will be forwarded to your function as just `/users` (the `/api` prefix is removed) + +When `strip_prefix` is `false`: +- Request to `/api/users` will be forwarded to your function with the full path `/api/users` intact + +See the [Configuration Reference](/docs/config) for the complete configuration options. + +When you make changes to your routes, the `rivet deploy` command will prompt you before applying these changes to how your requests get routed. + +## Routes (Advanced) + +Routes configure how incoming HTTP traffic gets directed to the specific function workers that handle requests. They define the mapping between public URLs and your deployed functions. Routes can be manually configured in the Functions tab of the Rivet Dashboard. + +### Hostnames + +Each route has a unique hostname (URL), and these hostnames cannot be shared across multiple environments. + +### Path Matching + +Routing priority is determined by path length with longest paths matching first. You can layer multiple paths to create sophisticated routing patterns. + +### Programmatic Creation + +Routes can be created programmatically via the Rivet API with [`routes.update`](/docs/api/routes/update). + diff --git a/site/src/content/docs/index.mdx b/site/src/content/docs/index.mdx index 38d1499153..bd686c7f08 100644 --- a/site/src/content/docs/index.mdx +++ b/site/src/content/docs/index.mdx @@ -1,44 +1,22 @@ # Welcome to Rivet -Actors combine compute and storage into unified entities for simplified architecture. Actors seamlessly integrate with your existing infrastructure or can serve as a complete standalone solution. +Rivet is an open-source platform for deploying and managing cloud services. Whether you're building collaborative applications, multiplayer games, AI agents, or any cloud service, Rivet provides the infrastructure you need. -Whether you're building collaborative applications, multiplayer games, AI agents, or realtime systems, Rivet provides the tools and infrastructure to make your development process smooth and efficient. +## Rivet Actors - - For getting started quickly using JavaScript, we recommend trying [ActorCore](https://actorcore.org) – our full-stack framework for working with Rivet Actors. - +Deploy stateful, long-running services that can handle WebSockets and maintain state between requests. Perfect for realtime applications, multiplayer games, and collaborative tools. -## What are actors good for? +[Documentation →](/docs/actors) -- **Stateful Services**: Applications where maintaining state across interactions is critical. For example, **Collaborative Apps** with shared editing and automatic persistence. -- **Realtime Systems**: Applications requiring fast, in-memory state modifications or push updates to connected clients. For example, **Multiplayer Games** with game rooms and player state. -- **Long-Running Processes**: Tasks that execute over extended periods or in multiple steps. For example, **AI Agents** with ongoing conversations and stateful tool calls. -- **Durability**: Processes that must survive crashes and restarts without data loss. For example, **Durable Execution** workflows that continue after system restarts. -- **Horizontal Scalability**: Systems that need to scale by distributing load across many instances. For example, **Realtime Stream Processing** for stateful event handling. -- **Local-First Architecture**: Systems that synchronize state between offline clients. For example, **Local-First Sync** between devices. +## Rivet Containers -{/* -## Features +Deploy any Docker container to the cloud with full control over your runtime environment. Great for CPU-intensive applications or existing software. -TODO: Cardgroup from landing page +[Documentation →](/docs/containers) -## Dashboard +## Rivet Functions -### Actor Inspector +Create serverless functions that respond to HTTP requests. Ideal for APIs, webhooks, and backend services with automatic scaling. -TODO - -### Build history - -TODO - -### Team management - -TODO -*/} - -## Next steps - -- Read the [quickstart](/docs/quickstart/typescript) -- Sign in to the [Rivet dashboard](https://hub.rivet.gg) +[Documentation →](/docs/functions) diff --git a/site/src/content/docs/install.mdx b/site/src/content/docs/install.mdx index d93388abdf..604b178079 100644 --- a/site/src/content/docs/install.mdx +++ b/site/src/content/docs/install.mdx @@ -60,9 +60,3 @@ The executable will be available at _target/debug/rivet_. ---- - - - For getting started quickly using JavaScript, we recommend trying [ActorCore](https://actorcore.org) – our full-stack framework for working with Rivet Actors. - - diff --git a/site/src/content/docs/solutions/game-servers.mdx b/site/src/content/docs/solutions/game-servers.mdx index b7095352fc..5ed69f32c9 100644 --- a/site/src/content/docs/solutions/game-servers.mdx +++ b/site/src/content/docs/solutions/game-servers.mdx @@ -8,8 +8,8 @@ In this guide, we'll implement a simple game server on Rivet and create a backen Before starting, you'll need to choose a runtime for your game server. Rivet offers two options: -- **[Container Runtime](/docs/container-runtime)**: For maximum flexibility, supports any language, ideal for complex game servers -- **[JavaScript Runtime](/docs/javascript-runtime)**: For lightweight, fast-starting game servers using JavaScript/TypeScript +- **[Actors](/docs/actors)**: For lightweight, fast-starting game servers using JavaScript/TypeScript +- **[Containers](/docs/container)**: For maximum flexibility, supports any language, ideal for complex game servers ### Step 1: Preparing your game server code @@ -88,21 +88,21 @@ export default { Create a minimal `rivet.json` configuration file that tells Rivet how to deploy your game server: -```json {{ "title": "Container Runtime" }} +```json {{ "title": "Actors" }} { - "builds": { + "actors": { "game-server": { - "dockerfile": "Dockerfile" + "script": "./src/index.ts" } } } ``` -```json {{ "title": "JavaScript Runtime" }} +```json {{ "title": "Containers" }} { - "builds": { + "containers": { "game-server": { - "script": "./src/index.ts" + "dockerfile": "Dockerfile" } } } @@ -889,8 +889,8 @@ When creating game servers with [`actors.create`](/docs/api/actors/create), you For detailed documentation, see: - [Actors Create API Reference](/docs/api/actors/create) -- [JavaScript Runtime](/docs/javascript-runtime) -- [Container Runtime](/docs/container-runtime) +- [Actors](/docs/actors) +- [Containers](/docs/containers) - [Configuration Reference](/docs/config) ## Learning More diff --git a/site/src/content/docs/troubleshooting.mdx b/site/src/content/docs/troubleshooting.mdx index ae80b1f0e4..c2a8722b7c 100644 --- a/site/src/content/docs/troubleshooting.mdx +++ b/site/src/content/docs/troubleshooting.mdx @@ -6,7 +6,7 @@ Update your configuration to include `unstable.minify = false` and `unstable.dum ```json {{ "title": "rivet.json" }} { - "builds" { + "actors" { "counter" { "script": "counter.ts", "access": "public", diff --git a/site/src/generated/apiPages.json b/site/src/generated/apiPages.json index 29ff528fb6..ad879535dc 100644 --- a/site/src/generated/apiPages.json +++ b/site/src/generated/apiPages.json @@ -69,6 +69,21 @@ "title": "regions.recommend", "href": "/docs/api/regions/recommend", "sortingKey": "/regions/recommend get" + }, + { + "title": "routes.list", + "href": "/docs/api/routes/list", + "sortingKey": "/routes get" + }, + { + "title": "routes.delete", + "href": "/docs/api/routes/delete", + "sortingKey": "/routes/{id} delete" + }, + { + "title": "routes.update", + "href": "/docs/api/routes/update", + "sortingKey": "/routes/{id} put" } ] } \ No newline at end of file diff --git a/site/src/sitemap/mod.ts b/site/src/sitemap/mod.ts index 961041e1b7..939e16ef25 100644 --- a/site/src/sitemap/mod.ts +++ b/site/src/sitemap/mod.ts @@ -17,12 +17,14 @@ import { faRuler, faTerminal, faSquareTerminal, - faJs, - faDocker, - faCircleNodes, - faKey, + faJs, + faDocker, + faCircleNodes, + faKey, faCodePullRequest, - faLeaf, + faLeaf, + faFunction, + faActors, } from "@rivet-gg/icons"; // Goals: @@ -52,22 +54,40 @@ export const sitemap = [ icon: faDownload, }, { - title: "Getting Started", // See https://supabase.com/docs/guides/auth/quickstarts/nextjs + title: "Getting Started", pages: [ //{ - // title: "TypeScript", - // href: "/docs/quickstart/typescript", - // icon: faTs, + // title: "Actors & Containers", + // href: "/docs/functions", + // icon: faActors, + // collapsible: true, + // pages: [ + // { + // title: "JavaScript", + // href: "/docs/javascript-runtime", + // icon: faJs, + // }, + // { + // title: "Docker", + // href: "/docs/container-runtime", + // icon: faDocker, + // }, + // ] //}, { - title: "JavaScript Runtime", - href: "/docs/javascript-runtime", - icon: faJs, + title: "Actors", + href: "/docs/actors", + icon: faActors, }, { - title: "Container Runtime", - href: "/docs/container-runtime", - icon: faDocker, + title: "Containers", + href: "/docs/containers", + icon: faServer, + }, + { + title: "Functions", + href: "/docs/functions", + icon: faFunction, }, ], },