Skip to content

Commit 09626c0

Browse files
committed
chore: update platform guides for create-actor (#662)
1 parent 22fa68c commit 09626c0

File tree

9 files changed

+350
-369
lines changed

9 files changed

+350
-369
lines changed

docs/changelog/overview.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ mode: "center"
1313

1414
## Documentation
1515

16-
- [**Simplified onboarding documentation**](/introduction): Replace complex setup process with `create-actor` for faster onboarding
16+
- [**New quickstart guide**](/introduction): Streamlined onboarding with `create-actor` for getting started in minutes
17+
- [**Core concepts overview**](/concepts/overview): Learn the fundamental concepts behind ActorCore architecture
18+
- [**Interacting with actors**](/concepts/interacting-with-actors): Guide to working with actors through events, RPCs, and more
1719
- [**AI code editors**](/llm/claude): Comprehensive guides for using ActorCore with AI-powered editors like Claude Code, Cursor, and Windsurf
1820
- [**Docs as markdown**](/llm/docs-as-markdown): Access any documentation page as plain Markdown by appending .md to URLs
1921
- [**prompt.txt**](/llm/prompt): Pre-formatted project guide to improve AI assistance with ActorCore development

docs/concepts/overview.mdx

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,15 @@ title: Overview
33
icon: square-info
44
---
55

6+
import CreateActorCli from "/snippets/create-actor-cli.mdx";
7+
68
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.
79

810
## Quickstart
911

1012
Run this to get started:
1113

12-
<CodeGroup>
13-
```sh npm
14-
npm create actor@latest
15-
```
16-
17-
```sh pnpm
18-
pnpm create actor@latest
19-
```
20-
21-
```sh yarn
22-
yarn create actor@latest
23-
```
24-
25-
```sh bun
26-
bun create actor@latest
27-
```
28-
</CodeGroup>
14+
<CreateActorCli />
2915

3016
## What are actors good for?
3117

docs/platforms/bun.mdx

Lines changed: 63 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,74 @@ import SetupActor from '/snippets/setup-actor.mdx';
66
import SetupNextSteps from '/snippets/setup-next-steps.mdx';
77
import MvpWarning from '/snippets/mvp-warning.mdx';
88
import IntegrationExistingProjects from '/snippets/integration-existing-projects.mdx';
9+
import CreateActorCli from '/snippets/create-actor-cli.mdx';
910

1011
<MvpWarning />
1112

13+
## Create New Project
14+
1215
<Steps>
13-
<Step title="Install Bun">
14-
Install Bun [here](https://bun.sh/).
16+
<Step title="Create Project with CLI">
17+
Run this command:
18+
19+
```sh bun
20+
bun create actor@latest
21+
```
22+
23+
Follow the prompts:
24+
1. **Where would you like to create your project?** - Choose your project directory
25+
2. **To which platform would you like to deploy?** - Select Bun
26+
3. **Which template would you like to use?** - Select counter, or your template of choice
27+
28+
The CLI will set up your project and install all dependencies automatically.
1529
</Step>
16-
<Step title="Install & Configure Redis">
17-
Install Redis [here](https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/).
30+
<Step title="Start Development Server">
31+
Start your development server with:
32+
33+
```sh
34+
cd your-project
35+
bun dev
36+
```
1837

19-
By default, ActorCore will connect to `redis://127.0.0.1:6379`. See [instructions on configuring Redis](#configuring-redis).
38+
This will start your ActorCore server in development mode.
2039
</Step>
21-
<Step title="Create New Bun Project">
22-
```sh
23-
# Create project
24-
mkdir my-project
25-
cd my-project
26-
bun init --yes
40+
<Step title="Test">
41+
In a separate terminal, run the auto-generated test client:
2742

43+
```sh
44+
bun tests/client.ts
45+
# Outputs:
46+
# Event: 1
47+
# RPC: 1
48+
```
49+
50+
Run this again to see the state update.
51+
</Step>
52+
<Step title="Deploy">
53+
To build for production:
54+
55+
```sh
56+
bun build
57+
bun start
58+
```
59+
60+
_Request a guide for deploying Bun to your preferred cloud provider on [GitHub Discussions](https://github.com/rivet-gg/actor-core/discussions)._
61+
</Step>
62+
</Steps>
63+
64+
## Integrating With Existing Projects
65+
66+
If you already have a Bun project and want to add ActorCore, you can follow these steps for manual integration. This approach gives you more control over how ActorCore fits into your existing codebase.
67+
68+
<Steps>
69+
<Step title="Install Bun">
70+
Install Bun [here](https://bun.sh/).
71+
</Step>
72+
<Step title="Install Packages">
73+
```sh
2874
# Install ActorCore
2975
bun add actor-core @actor-core/bun
3076
```
31-
32-
<Tip>ActorCore can also be used with existing Bun projects.</Tip>
3377
</Step>
3478
<Step title="Create Actor">
3579
Create a new file for your actor at `src/counter.ts`:
@@ -49,6 +93,8 @@ import IntegrationExistingProjects from '/snippets/integration-existing-projects
4993
cors: { origin: "http://localhost:3000" }
5094
});
5195
```
96+
97+
<IntegrationExistingProjects />
5298
</Step>
5399
<Step title="Create Client">
54100
Create a client to connect to your actor in `src/client.ts`:
@@ -85,40 +131,18 @@ import IntegrationExistingProjects from '/snippets/integration-existing-projects
85131
```sh
86132
bun src/client.ts
87133
# Outputs:
88-
# Event: 43
89-
# RPC: 43
134+
# Event: 1
135+
# RPC: 1
90136
```
91-
</Step>
92-
<Step title="Deploy">
93-
_Request a guide for deploying Bun to your preferred cloud provider on [GitHub Discussions](https://github.com/rivet-gg/actor-core/discussions)._
137+
138+
Run this again to see the state update.
94139
</Step>
95140
</Steps>
96141

97-
## Integrating With Existing Projects
98-
99-
<IntegrationExistingProjects />
100-
101142
## Available Regions
102143

103144
Bun can only run in one region at the moment. See [Rivet](https://rivet.gg/docs/setup) and [Cloudflare Workers](/platforms/cloudflare-workers) for supporting multiple regions.
104145

105-
## Configuring Redis
106-
107-
Configure your Redis connection like this:
108-
109-
```typescript
110-
export default createHandler({
111-
redis: {
112-
port: 6379,
113-
host: "127.0.0.1",
114-
password: "my-top-secret"
115-
},
116-
// ...
117-
});
118-
```
119-
120-
See all available options [here](https://redis.github.io/ioredis/index.html#RedisOptions).
121-
122146
## Next Steps
123147

124148
<SetupNextSteps />

0 commit comments

Comments
 (0)