Skip to content

Commit 1750fec

Browse files
Add v2 getting started paths
1 parent 686c26c commit 1750fec

File tree

5 files changed

+298
-7
lines changed

5 files changed

+298
-7
lines changed

docs/getting-started.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
sidebar_position: 2
3+
title: Getting Started
4+
description: Choose the fastest Durable Workflow 2.0 preview path for Laravel, Python, or operator workflows.
5+
---
6+
7+
# Getting Started
8+
9+
Durable Workflow 2.0 is currently published as preview documentation. Use the
10+
version picker for the stable 1.x docs; use this page when you want to try the
11+
2.0 engine, standalone server, CLI, or Python SDK.
12+
13+
## Install Commands
14+
15+
| Surface | Command |
16+
| --- | --- |
17+
| Laravel package | `composer require durable-workflow/workflow:^2.0@alpha` |
18+
| Standalone server image | `docker pull durableworkflow/server:0.2.2` |
19+
| CLI | `curl -fsSL https://durable-workflow.com/install.sh \| sh` |
20+
| Python SDK | `pip install durable-workflow` |
21+
22+
## Choose Your Path
23+
24+
### I am a Laravel user
25+
26+
The fastest Laravel path is the maintained sample application. It installs the
27+
package, runs migrations, starts a queue worker, and executes a real workflow.
28+
29+
```bash
30+
git clone https://github.com/durable-workflow/sample-app.git
31+
cd sample-app
32+
composer install
33+
php artisan app:init
34+
```
35+
36+
Keep the worker running in one terminal:
37+
38+
```bash
39+
php artisan queue:work
40+
```
41+
42+
Start the example workflow from a second terminal:
43+
44+
```bash
45+
php artisan app:workflow
46+
```
47+
48+
You now have a workflow running through Laravel queues and durable workflow
49+
state. Open `/waterline/dashboard` in the sample app to inspect the run, or
50+
continue with the [sample app guide](/docs/2.0/sample-app).
51+
52+
### I am a Python user
53+
54+
The Python SDK repository includes a deployable order-processing sample. It
55+
starts a local Durable Workflow server, starts a Python worker, runs inventory,
56+
payment, shipment, and confirmation activities, then exits after the workflow
57+
completes.
58+
59+
```bash
60+
git clone https://github.com/durable-workflow/sdk-python.git
61+
cd sdk-python/examples/order_processing
62+
docker compose up --build --exit-code-from python-worker python-worker
63+
docker compose down -v
64+
```
65+
66+
The `python-worker` service prints the completed order result as JSON. A
67+
successful run ends with `status` set to `confirmed`. Continue with the
68+
[Python SDK guide](/docs/2.0/polyglot/python) when you are ready to write your
69+
own workflow and activities.
70+
71+
### I am an operator
72+
73+
Operators usually care about the server, CLI, namespaces, worker health, and
74+
workflow visibility. Use the Python order-processing sample as a real workload,
75+
then inspect it through `dw`.
76+
77+
Start the sample stack and leave it running:
78+
79+
```bash
80+
git clone https://github.com/durable-workflow/sdk-python.git
81+
cd sdk-python/examples/order_processing
82+
docker compose up --build
83+
```
84+
85+
Install and point the CLI at the sample server from another terminal:
86+
87+
```bash
88+
curl -fsSL https://durable-workflow.com/install.sh | sh
89+
90+
export DURABLE_WORKFLOW_SERVER_URL=http://localhost:8080
91+
export DURABLE_WORKFLOW_AUTH_TOKEN=sample-token
92+
export DURABLE_WORKFLOW_NAMESPACE=default
93+
94+
dw server:health
95+
dw workflow:list
96+
```
97+
98+
The stack publishes the server on `localhost:8080`, uses `sample-token`, and
99+
runs a workflow to completion. Clean up when you are done:
100+
101+
```bash
102+
docker compose down -v
103+
```
104+
105+
Continue with the [server setup guide](/docs/2.0/polyglot/server) and
106+
[CLI guide](/docs/2.0/polyglot/cli) for production authentication, deployment,
107+
and operational commands.
108+
109+
## The Loop You Just Ran
110+
111+
1. A client starts a workflow through either Laravel code or the server HTTP
112+
control-plane API.
113+
2. The engine records durable history and creates workflow or activity tasks in
114+
the configured task queue.
115+
3. A worker polls for tasks, executes workflow replay or activity code, and
116+
sends completion commands back to the engine.
117+
4. The engine appends more history, schedules the next task, or marks the
118+
workflow complete.
119+
5. Operators inspect the same durable state through Waterline, the CLI, or the
120+
server API.
121+
122+
That cycle is the product boundary: durable state in the engine, ordinary code
123+
in workers, and HTTP or Laravel APIs for starting and observing work.

docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 2
2+
sidebar_position: 3
33
---
44

55
# Installation

docs/polyglot/python.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,10 @@ asyncio.run(main())
9292
```
9393

9494
For a deployable multi-step example, the SDK repository includes
95-
`examples/order_processing`: a Docker Compose stack that starts the server,
96-
runs a Python worker, and completes an order workflow through inventory,
97-
payment, shipment, and confirmation activities.
95+
[`examples/order_processing`](https://github.com/durable-workflow/sdk-python/tree/main/examples/order_processing):
96+
a Docker Compose stack that starts the server, runs a Python worker, and
97+
completes an order workflow through inventory, payment, shipment, and
98+
confirmation activities.
9899

99100
## Client
100101

src/pages/index.js

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,33 @@ import HomepageFeatures from '@site/src/components/HomepageFeatures';
77

88
import styles from './index.module.css';
99

10+
const installCommands = [
11+
{
12+
title: 'Laravel package',
13+
label: '2.0 preview',
14+
command: 'composer require durable-workflow/workflow:^2.0@alpha',
15+
to: '/docs/2.0/installation',
16+
},
17+
{
18+
title: 'Server image',
19+
label: 'Docker',
20+
command: 'docker pull durableworkflow/server:0.2.2',
21+
to: '/docs/2.0/polyglot/server',
22+
},
23+
{
24+
title: 'CLI',
25+
label: 'Operators',
26+
command: 'curl -fsSL https://durable-workflow.com/install.sh | sh',
27+
to: '/docs/2.0/polyglot/cli',
28+
},
29+
{
30+
title: 'Python SDK',
31+
label: 'Polyglot',
32+
command: 'pip install durable-workflow',
33+
to: '/docs/2.0/polyglot/python',
34+
},
35+
];
36+
1037
function HomepageHeader() {
1138
const {siteConfig} = useDocusaurusContext();
1239
return (
@@ -18,22 +45,56 @@ function HomepageHeader() {
1845
<Link
1946
className="button button--secondary button--lg"
2047
to="/docs/introduction">
21-
Get Started - 5min ⏱️
48+
Stable Docs
49+
</Link>
50+
<Link
51+
className="button button--outline button--secondary button--lg"
52+
to="/docs/2.0/getting-started">
53+
2.0 Preview Quickstart
2254
</Link>
2355
</div>
2456
</div>
2557
</header>
2658
);
2759
}
2860

61+
function InstallCommands() {
62+
return (
63+
<section className={styles.installSection}>
64+
<div className="container">
65+
<div className={styles.installHeader}>
66+
<p className={styles.installEyebrow}>2.0 preview installs</p>
67+
<h2>Run the engine where your code already lives.</h2>
68+
<p>
69+
Keep using the stable 1.x docs for production defaults. Use these
70+
commands when you are evaluating the v2 package, standalone server,
71+
CLI, or Python SDK.
72+
</p>
73+
</div>
74+
<div className={styles.installGrid}>
75+
{installCommands.map((item) => (
76+
<Link className={styles.installCard} to={item.to} key={item.title}>
77+
<div className={styles.installCardHeader}>
78+
<h3>{item.title}</h3>
79+
<span>{item.label}</span>
80+
</div>
81+
<code>{item.command}</code>
82+
</Link>
83+
))}
84+
</div>
85+
</div>
86+
</section>
87+
);
88+
}
89+
2990
export default function Home() {
30-
const {siteConfig} = useDocusaurusContext();
3191
return (
3292
<Layout
3393
title="Durable Orchestration for Laravel"
3494
description="Laravel-native durable orchestration engine for long-running, fault-tolerant workflows in PHP without a dedicated cluster.">
3595
<HomepageHeader />
3696
<main>
97+
<InstallCommands />
3798
<HomepageFeatures />
3899
</main>
39100
</Layout>

src/pages/index.module.css

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
.heroBanner {
7-
padding: 4rem 0;
7+
padding: 4rem 0 3.5rem;
88
text-align: center;
99
position: relative;
1010
overflow: hidden;
@@ -18,6 +18,112 @@
1818

1919
.buttons {
2020
display: flex;
21+
flex-wrap: wrap;
22+
gap: 0.75rem;
2123
align-items: center;
2224
justify-content: center;
2325
}
26+
27+
.installSection {
28+
padding: 3.5rem 0;
29+
}
30+
31+
.installHeader {
32+
max-width: 760px;
33+
margin: 0 auto 2rem;
34+
text-align: center;
35+
}
36+
37+
.installHeader h2 {
38+
margin: 0 0 0.75rem;
39+
}
40+
41+
.installHeader p:last-child {
42+
margin-bottom: 0;
43+
}
44+
45+
.installEyebrow {
46+
margin: 0 0 0.5rem;
47+
color: var(--ifm-color-primary);
48+
font-size: 0.82rem;
49+
font-weight: 700;
50+
letter-spacing: 0.08em;
51+
text-transform: uppercase;
52+
}
53+
54+
.installGrid {
55+
display: grid;
56+
grid-template-columns: repeat(4, minmax(0, 1fr));
57+
gap: 1rem;
58+
}
59+
60+
.installCard {
61+
display: flex;
62+
min-width: 0;
63+
min-height: 156px;
64+
flex-direction: column;
65+
justify-content: space-between;
66+
padding: 1rem;
67+
border: 1px solid var(--ifm-color-emphasis-200);
68+
border-radius: 8px;
69+
color: var(--ifm-font-color-base);
70+
background: var(--ifm-card-background-color);
71+
box-shadow: var(--ifm-global-shadow-lw);
72+
}
73+
74+
.installCard:hover {
75+
color: var(--ifm-font-color-base);
76+
text-decoration: none;
77+
border-color: var(--ifm-color-primary);
78+
}
79+
80+
.installCardHeader {
81+
display: flex;
82+
gap: 0.75rem;
83+
align-items: flex-start;
84+
justify-content: space-between;
85+
}
86+
87+
.installCard h3 {
88+
margin: 0;
89+
font-size: 1rem;
90+
}
91+
92+
.installCard span {
93+
flex: 0 0 auto;
94+
padding: 0.125rem 0.45rem;
95+
border: 1px solid var(--ifm-color-emphasis-300);
96+
border-radius: 6px;
97+
color: var(--ifm-color-emphasis-700);
98+
font-size: 0.72rem;
99+
line-height: 1.4;
100+
}
101+
102+
.installCard code {
103+
display: block;
104+
width: 100%;
105+
margin-top: 1.25rem;
106+
padding: 0.7rem;
107+
overflow-wrap: anywhere;
108+
white-space: normal;
109+
}
110+
111+
@media screen and (max-width: 996px) {
112+
.installGrid {
113+
grid-template-columns: repeat(2, minmax(0, 1fr));
114+
}
115+
}
116+
117+
@media screen and (max-width: 640px) {
118+
.installSection {
119+
padding: 2.5rem 0;
120+
}
121+
122+
.installGrid {
123+
grid-template-columns: 1fr;
124+
}
125+
126+
.installCard {
127+
min-height: 136px;
128+
}
129+
}

0 commit comments

Comments
 (0)