Skip to content

Commit 3ba9919

Browse files
committed
Updates
1 parent a649e03 commit 3ba9919

9 files changed

Lines changed: 819 additions & 381 deletions
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
const n=`# How to Draw AWS Architecture Diagrams with OpenFlowKit
2+
3+
Drawing cloud infrastructure can be tedious if you are dragging and dropping shapes manually. OpenFlowKit provides a **Diagram-as-Code** approach to visualizing AWS Architectures, making it perfect for DevOps teams, Solutions Architects, and Cloud Engineers.
4+
5+
## Why Use Diagram-as-Code for AWS?
6+
7+
Instead of spending hours aligning server icons, you can write simple text that OpenFlowKit instantly renders into a beautiful, auto-routed diagram. Because it's code, your architecture diagram can live right next to your Terraform or CloudFormation scripts in Git.
8+
9+
- **Version Control**: Track infrastructure changes over time.
10+
- **Auto-Layout**: No more overlapping lines or misaligned VPCs.
11+
- **Speed**: Type a few lines, get a complete diagram.
12+
13+
14+
## Example: Basic Web Architecture (Mermaid.js)
15+
16+
OpenFlowKit natively supports Mermaid.js, which is great for standard cloud structures. Here is how you can visualize an AWS VPC with a Load Balancer, EC2 instances, and an RDS database.
17+
18+
\`\`\`mermaid
19+
flowchart TD
20+
%% Define Styles
21+
classDef aws fill:#FF9900,stroke:#fff,stroke-width:2px,color:#fff,rx:8px,ry:8px;
22+
classDef vpc fill:#f5f5f5,stroke:#00A4A6,stroke-width:2px,stroke-dasharray: 5 5,rx:12px,ry:12px;
23+
24+
Client((User Traffic))
25+
26+
subgraph AWS_VPC [AWS Cloud VPC]
27+
ALB(Application Load Balancer)
28+
29+
subgraph Public_Subnet [Public Subnet]
30+
EC2_1(Web Server 1)
31+
EC2_2(Web Server 2)
32+
end
33+
34+
subgraph Private_Subnet [Private Subnet]
35+
RDS[(Amazon RDS)]
36+
ElastiCache[(Redis Cache)]
37+
end
38+
end
39+
40+
%% Connections
41+
Client -->|HTTPS| ALB
42+
ALB -->|Round Robin| EC2_1
43+
ALB -->|Round Robin| EC2_2
44+
45+
EC2_1 --> RDS
46+
EC2_1 --> ElastiCache
47+
EC2_2 --> RDS
48+
EC2_2 --> ElastiCache
49+
50+
%% Apply Styles
51+
class ALB,EC2_1,EC2_2 aws;
52+
class RDS,ElastiCache aws;
53+
class AWS_VPC,Public_Subnet,Private_Subnet vpc;
54+
\`\`\`
55+
56+
## Creating AWS Diagrams with AI
57+
58+
If you don't know Mermaid syntax, you can use **Flowpilot**, our built-in AI assistant.
59+
60+
1. Open the [Command Center](/docs/en/command-center).
61+
2. Type a prompt like:
62+
> \`"Create an AWS architecture diagram showing an API Gateway routing traffic to three AWS Lambda functions, which all connect to a central DynamoDB table."\`
63+
3. Hit enter. Flowpilot will instantly generate the DSL and render the diagram.
64+
65+
## Exporting for internal documentation
66+
67+
Once your AWS Architecture is generated, you can easily export it:
68+
- **SVG / PNG**: For Confluence, Jira, or Slack.
69+
- **Figma Editable**: Want your UX team to polish the diagram? Click *Figma Editable* and paste it directly into Figma as native, editable vector layers.
70+
71+
[Try building your first AWS Architecture diagram now!](/#/canvas)
72+
`;export{n as default};
Lines changed: 377 additions & 375 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
const e=`# Mermaid.js vs OpenFlowKit
2+
3+
Mermaid.js is an incredible text-based diagramming tool that has become the standard for markdown-based documentation. However, when you need a presentation-ready, highly interactive canvas, raw Mermaid can sometimes feel limiting.
4+
5+
This is why **OpenFlowKit is built on top of Mermaid.js**, giving you the best of both worlds: Diagram-as-code speed with visual-editor polish.
6+
7+
## 1. Aesthetics and Branding
8+
9+
**Mermaid.js:**
10+
- Renders SVGs based on predefined themes (default, dark, forest, neutral).
11+
- Customizing styles requires inline CSS classes, which can clutter your markdown.
12+
13+
**OpenFlowKit:**
14+
- Features a full **White-Label Design System**.
15+
- You can inject [Theming](/docs/en/theming) tokens dynamically (colors, corner radii, fonts).
16+
- Nodes automatically adopt glassmorphism, shadows, and modern UI treatments without writing a single line of CSS.
17+
18+
## 2. Interaction and Editing
19+
20+
**Mermaid.js:**
21+
- Strictly code-in, diagram-out. To move a node, you rewrite the code.
22+
- Layouts are handled automatically by Dagre, which is great but offers zero manual control if a line routes awkwardly.
23+
24+
**OpenFlowKit:**
25+
- **Two-Way Sync**: Write code and watch the canvas update, *or* drag a node on the canvas and watch the code update automatically.
26+
- You get full drag-and-drop capabilities, manual edge routing, and [Smart Layouts](/docs/en/smart-layout) via ELK.js.
27+
28+
## 3. Export Options
29+
30+
**Mermaid.js:**
31+
- Typically exports as SVG or PNG via a CLI or browser extension.
32+
33+
**OpenFlowKit:**
34+
- Native [Exporting](/docs/en/exporting) to SVG, high-res PNG/JPG.
35+
- **Figma Editable**: OpenFlowKit can export diagrams directly to your clipboard in a format that pastes into Figma as native, editable vector layers and text objects.
36+
37+
## 4. Artificial Intelligence
38+
39+
While AI can write Mermaid syntax, iterating on it is difficult.
40+
41+
**OpenFlowKit:**
42+
- Integrated [Flowpilot AI](/docs/en/ask-flowpilot) directly into the [Command Center](/docs/en/command-center).
43+
- You can prompt the AI, generate the canvas, and then manually adjust the final 10% visually instead of trying to perfectly craft a prompt to fix a misaligned node.
44+
- Supports **BYOK (Bring Your Own Key)** for 7 different AI providers.
45+
46+
## Direct Compatibility
47+
48+
We love Mermaid. That is why OpenFlowKit has a native [Mermaid Integration](/docs/en/mermaid-integration). You can paste any existing Mermaid flowchart or state diagram into OpenFlowKit, and it will instantly convert it into editable, styled React Flow nodes.
49+
50+
Try converting your Mermaid diagrams today in the [Editor](/#/canvas).
51+
`;export{e as default};

assets/payment-flow-BjxuHVLQ.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
const e=`# How to Visualize Payment Flows (Stripe, PayPal, etc.)
2+
3+
When building e-commerce or SaaS applications, understanding the exact sequence of a payment flow is critical. A single missed webhook can lead to a dropped order or an angry customer.
4+
5+
OpenFlowKit allows you to map out complex asynchronous payment architectures quickly using a variety of [Node Types](/docs/en/node-types).
6+
7+
## Why build payment architectures with OpenFlowKit?
8+
9+
- **Shareability**: Everyone from the PM to the backend engineer needs to see the same flow.
10+
- **Clarity**: Mapping out happy paths, failures, and webhook retries visually is much easier than reading through Stripe API documentation.
11+
- **Speed**: Use the [Command Center](/docs/en/command-center) and AI to generate the boilerplate flow in seconds.
12+
13+
## Example: Stripe Checkout Flow
14+
15+
Here is a common Stripe Checkout implementation mapped out. Notice how we use different node shapes to distinguish between client-side actions, server-side actions, and third-party API calls.
16+
17+
\`\`\`mermaid
18+
sequenceDiagram
19+
participant User
20+
participant Client as Frontend (React)
21+
participant Server as Backend (Node.js)
22+
participant Stripe
23+
24+
User->>Client: Clicks "Pay $50"
25+
Client->>Server: POST /create-checkout-session
26+
Server->>Stripe: API Request: Create Session
27+
Stripe-->>Server: Returns Session ID & URL
28+
Server-->>Client: Returns Checkout URL
29+
30+
Client->>User: Redirects to Stripe Checkout
31+
User->>Stripe: Enters Credit Card Info
32+
33+
alt Payment Success
34+
Stripe-->>User: Redirect to Success URL
35+
Stripe->>Server: Webhook event: checkout.session.completed
36+
Server->>Server: Fulfills Order / Updates DB
37+
else Payment Failure
38+
Stripe-->>User: Redirect to Cancel URL
39+
User->>Client: Try Again
40+
end
41+
\`\`\`
42+
43+
## Tips for Better Payment Diagrams
44+
45+
1. **Use Swimlanes**: Group actions by responsibility. Put the User in one lane, your API in another, and the Payment Processor (Stripe/PayPal) in a third.
46+
2. **Color Code**: Use green for happy paths (success), red for failure states (declines/insufficient funds), and gray for retries.
47+
3. **Explicit Callouts**: Use the **Annotation Node** to document exact webhook payloads or secret keys needed at specific steps.
48+
49+
## AI Prompt Example
50+
51+
To generate a similar flow using [Ask Flowpilot](/docs/en/ask-flowpilot):
52+
53+
> \`"Generate a flowchart showing a subscription payment flow using Braintree. Include the client requesting a client token, the server generating it, the user submitting a nonce, and the final server-side transaction creation. Show both success and failure branches."\`
54+
55+
Need to present this to your team? Try the [Playback History](/docs/en/playback-history) feature to walk through the payment sequence step-by-step.
56+
`;export{e as default};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const e=`# How to Prompt AI Agents (Cursor, Copilot, ChatGPT)
2+
3+
OpenFlowKit is built to be AI-native. While it includes **Flowpilot** (our built-in AI assistant), you often want to generate diagrams directly inside your IDE using tools like Cursor, GitHub Copilot, or even regular ChatGPT.
4+
5+
To get the best results from any LLM, you need to point them to our syntax rules.
6+
7+
## The Magic Keyword: \`llms.txt\`
8+
9+
The secret to perfect AI generation is our \`llms.txt\` file. We host a machine-readable set of rules that teaches any AI exactly how to write OpenFlow DSL V2 code.
10+
11+
When prompting an AI agent, just include a reference to this file.
12+
13+
### Example Prompt for Cursor IDE
14+
Open your Composer or Chat window and type:
15+
16+
> \`"Read https://openflowkit.com/llms.txt and then generate an architecture diagram showing our Next.js frontend connecting to a Supabase backend."\`
17+
18+
### Example Prompt for ChatGPT
19+
If you are using ChatGPT with web-browsing enabled:
20+
21+
> \`"Go to https://openflowkit.com/llms.txt to learn the OpenFlowKit syntax. Then, write a flowchart detailing an OAuth2 login sequence. Output the result using the \\\`\\\`\\\`openflow code block."\`
22+
23+
## Best Practices for Prompting
24+
25+
Even with the rules, LLMs can sometimes get confused. Here are three tips for perfect diagrams every time:
26+
27+
1. **Be specific about shapes**: Instead of just saying "add a database", say "add a Node with the \`[process]\` type labeled 'Database'".
28+
2. **Name your connections**: The diagram is much more useful if edges have labels. Example: "Connect the frontend to the backend with the label '|REST API|'".
29+
3. **Use Groups for clarity**: If you have multiple microservices, tell the AI to wrap them in a group: "Put the 'Auth Service' and 'User DB' inside a group called 'Backend Infrastructure'."
30+
31+
[Return to Editor](/#/canvas)
32+
`;export{e as default};

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/reactflow/dist/style.min.css" crossorigin="anonymous" />
3838

39-
<script type="module" crossorigin src="./assets/index-zFDgHK5G.js"></script>
39+
<script type="module" crossorigin src="./assets/index-DMF1NEHy.js"></script>
4040
<link rel="stylesheet" crossorigin href="./assets/index-DGZ8Vf3p.css">
4141
</head>
4242

llms.txt

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# OpenFlowKit - Diagram as Code Engine
2+
3+
> OpenFlowKit is an open-source, local-first Diagram-as-Code engine built for modern workflows.
4+
> It allows users to write simple text (DSL) and instantly get beautiful, presentation-ready diagrams.
5+
6+
## App Name & Branding
7+
- App Name: OpenFlowKit
8+
- Main Repository: https://github.com/Vrun-design/openflowkit
9+
- Architecture: React (Vite), ReactFlow, Zustand, TailwindCSS
10+
11+
## OpenFlow DSL V2 Syntax Rules
12+
If a user asks you to "Generate a diagram" or "Draw a flowchart for OpenFlowKit", you MUST output the exact syntax described below. Do NOT use Mermaid syntax unless explicitly asked.
13+
14+
Wrap your output in standard markdown code blocks, but use `openflow` as the language trigger (e.g., `\`\`\`openflow`).
15+
16+
### 1. Metadata (Optional, must be at the top)
17+
You can define global diagram properties using `key: value`.
18+
```openflow
19+
direction: TB
20+
theme: light
21+
```
22+
- `direction`: "TB" (Top to Bottom), "LR" (Left to Right), "RL", "BT"
23+
24+
### 2. Nodes
25+
Format: `[type] id: Label { attributes }`
26+
- `[type]`: The visual shape/style of the node.
27+
- `id`: Unique identifier (no spaces). If omitted, the label is used as the ID.
28+
- `Label`: The text displayed inside the node.
29+
- `{ attributes }`: Optional JSON-like string of extra properties.
30+
31+
**Supported Node Types (MUST use exactly one of these):**
32+
- `[start]` / `[end]`: Rounded pill shapes for entry/exit points.
33+
- `[process]`: Standard rectangle.
34+
- `[decision]`: Diamond shape for logic branching.
35+
- `[system]`: Hexagon shape.
36+
- `[note]`: A sticky note appearance.
37+
- `[browser]`: A window frame that looks like a web browser.
38+
- `[mobile]`: A frame that looks like an iPhone.
39+
- `[button]`: A UI wireframe button.
40+
- `[input]`: A UI wireframe text input.
41+
- `[placeholder]`: An image wireframe block.
42+
43+
**Examples:**
44+
```openflow
45+
[start] start1: User Opens App
46+
[browser] web: E-Commerce Store
47+
[decision] checkAuth: Is Logged In?
48+
[process] db: Query Database { icon: "database" }
49+
```
50+
51+
### 3. Edges
52+
Format: `source -> target` or `source ->|Label| target { attributes }`
53+
- `source` / `target`: Must match the `id` of a defined node. If the node is not defined, it is created implicitly as a `[process]` node.
54+
- `->`: Standard solid arrow.
55+
- `-->`: Curved/smoothstep arrow.
56+
- `..>`: Dashed line arrow.
57+
- `==>`: Thick line arrow.
58+
- `|Label|`: Text to display on the edge.
59+
60+
**Examples:**
61+
```openflow
62+
start1 -> checkAuth
63+
checkAuth ->|yes| web
64+
checkAuth ..>|no| loginPage { styleType: "dashed" }
65+
```
66+
67+
### 4. Groups
68+
Format: `group "Label" { ...nodes and edges... }`
69+
Groups create visual bounding boxes around nodes.
70+
71+
**Example:**
72+
```openflow
73+
group "Authentication Service" {
74+
[process] auth: Auth Gateway
75+
[process] token: Token Generator
76+
auth -> token
77+
}
78+
```
79+
80+
## Complete Example
81+
When generating a diagram, combine the rules above:
82+
83+
```openflow
84+
direction: LR
85+
86+
[start] start: App Launched
87+
[browser] ui: Dashboard UI
88+
89+
group "Backend Services" {
90+
[process] api: API Gateway
91+
[decision] cache: Check Redis
92+
[process] db: Postgres Database
93+
}
94+
95+
start -> ui
96+
ui ->|fetch data| api
97+
api --> cache
98+
cache ->|hit| ui
99+
cache ..>|miss| db
100+
db ==>|return data| cache
101+
```
102+
103+
## Important Notes for LLMs
104+
- ALWAYS use the `[type]` prefix for nodes. If you aren't sure, use `[process]`.
105+
- Attributes inside `{ }` must be comma-separated like a JS object: `{ key: "value", number: 123 }`. Quotes around string values are optional but recommended.
106+
- Do NOT use hyphens `-` or spaces in Node IDs. Use camelCase or snake_case.

schema/openflow-dsl-v2.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://openflowkit.com/schema/openflow-dsl-v2.json",
4+
"title": "OpenFlowKit DSL V2",
5+
"description": "Validation schema for OpenFlowKit Diagram-as-Code Engine",
6+
"type": "string",
7+
"pattern": "^(?:.*\n)*$",
8+
"examples": [
9+
"direction: TB\n[start] user: User Opens App\n[browser] ui: Web Interface\nuser -> ui\n"
10+
]
11+
}

0 commit comments

Comments
 (0)