Skip to content

Commit 0c1f998

Browse files
authored
Add architecture primer (#125)
* docs: add new architecture overview documentation for pgflow Introduce a comprehensive MDX page explaining pgflow's layered architecture, state management, execution cycle, and type safety features. This update provides detailed diagrams, code examples, and explanations to improve understanding of the core concepts and workflow orchestration model. * docs: clarify architecture overview, core principles, and runtime behavior of pgflow - Updated description of pgflow's architecture emphasizing Postgres as the single source of truth - Added details on core design principles: Postgres-first, opinionated defaults, robustness, and safety - Clarified runtime table categories and transaction guarantees - Included explanations of task input composition and database-driven orchestration benefits - Enhanced notes on retry logic, error handling, and scalability features - Improved overall documentation clarity and consistency * docs: update architecture overview content and formatting for clarity - Corrected quotation marks for consistency in the documentation - Improved phrasing for better readability and professionalism - Clarified the description of pgflow's transaction guarantees and model - Fixed minor formatting issues in code snippets and notes - Updated the core mental model explanation for better understanding * docs: update documentation to clarify pgflow architecture and improve navigation - Renamed architecture overview file to the more accurate 'how-pgflow-works.mdx' - Updated the page title, description, and sidebar order for better clarity - Added a new link card for 'Understanding Flow DSL' in the concepts index - Minor formatting adjustments for consistency and readability * docs: remove architecture overview documentation file Deleted the 'architecture-overview.mdx' file containing high-level system architecture details, likely to be replaced or relocated in future updates. * docs: add placeholders for architecture diagrams and improve flow code comments - Inserted diagram placeholders for build-time, runtime, and execution cycle - Updated notes for clarity on queue processing and flow pattern - Minor formatting adjustments in flow definition code for consistency * chore: add a script to compile Mermaid diagrams to SVG with custom theme and background This commit introduces a new executable script that automates the conversion of Mermaid diagram files into SVG images. The script handles input validation, creates output directories as needed, and applies a dark theme with a specific background color during the compilation process. It streamlines diagram generation for the website project. * feat: add new execution cycle diagram SVG to website assets - Introduced a new SVG diagram illustrating the execution cycle - Updated project assets with the SVG file in the public diagrams directory - No code logic or functionality changes, purely asset addition * chore: remove execution-cycle SVG diagram file * chore: update SVG diagrams for consistency and clarity Refactored two SVG files by replacing the previous diagrams with updated versions. - Improved visual consistency and layout of the flowchart diagrams - Ensured proper formatting and structure of SVG code - Removed redundant or outdated SVG content to enhance clarity
1 parent d5e0f66 commit 0c1f998

File tree

6 files changed

+235
-63
lines changed

6 files changed

+235
-63
lines changed

pkgs/website/bin/mmdc-compile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Check if an argument was provided
4+
if [ $# -eq 0 ]; then
5+
echo "Usage: $0 <path-to-mermaid-file>"
6+
exit 1
7+
fi
8+
9+
# Get the input file path
10+
input_file="$1"
11+
12+
# Check if the input file exists
13+
if [ ! -f "$input_file" ]; then
14+
echo "Error: File '$input_file' not found"
15+
exit 1
16+
fi
17+
18+
# Extract the basename without extension
19+
basename=$(basename "$input_file" .mermaid)
20+
21+
# Create output directory if it doesn't exist
22+
mkdir -p public/diagrams
23+
24+
# Output file path
25+
output_file="public/diagrams/${basename}.svg"
26+
27+
# Compile the mermaid file to SVG
28+
mmdc --theme dark --output "$output_file" --backgroundColor '#121a19' < "$input_file"
29+
30+
echo "Compiled $input_file to $output_file"
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
graph TD
2+
subgraph "Build-time"
3+
DSL[TypeScript DSL]
4+
DSL -->|npx pgflow compile| SQL[SQL migration]
5+
end
6+
subgraph "Run-time (inside Postgres)"
7+
CORE["SQL Core"]
8+
end
9+
subgraph "Run-time (outside Postgres)"
10+
WORKER["Edge Worker"]
11+
end
12+
SQL --> CORE
13+
WORKER -->|poll_for_tasks| CORE
14+
WORKER -->|complete_task or fail_task| CORE

pkgs/website/src/content/docs/concepts/architecture-overview.mdx

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)