|
| 1 | +# Documentation Structure Using Diátaxis |
| 2 | + |
| 3 | +The [Diátaxis framework](https://diataxis.fr/) provides a systematic approach to technical documentation by recognizing four distinct types of documentation, each serving a specific user need: |
| 4 | + |
| 5 | +1. **Tutorials** - Learning-oriented content |
| 6 | +2. **How-to Guides** - Problem-oriented content |
| 7 | +3. **Explanations** - Understanding-oriented content |
| 8 | +4. **References** - Information-oriented content |
| 9 | + |
| 10 | +## Applying Diátaxis to PgFlow Documentation |
| 11 | + |
| 12 | +PgFlow's documentation can be naturally structured following Diátaxis principles while preserving its unique character and development philosophy. |
| 13 | + |
| 14 | +### Tutorials (Learning-oriented) |
| 15 | + |
| 16 | +Tutorials help new users get started through hands-on experience: |
| 17 | + |
| 18 | +- **Getting Started with PgFlow** |
| 19 | + - First-time setup with Supabase |
| 20 | + - Creating your first workflow with the TypeScript DSL |
| 21 | + - Deploying Edge Workers |
| 22 | + - Running and monitoring your first flow |
| 23 | + |
| 24 | +- **Building Common Workflow Patterns** |
| 25 | + - Sequential processing |
| 26 | + - Parallel tasks |
| 27 | + - Error handling and retry patterns |
| 28 | + - Data transformation chains |
| 29 | + |
| 30 | +Tutorials should be: |
| 31 | +- Goal-oriented with clear outcomes |
| 32 | +- Focused on practical experience rather than explanation |
| 33 | +- Structured as step-by-step instructions |
| 34 | +- Designed for beginners who are learning by doing |
| 35 | + |
| 36 | +### How-to Guides (Problem-oriented) |
| 37 | + |
| 38 | +How-to guides address specific tasks for users who know what they need to accomplish: |
| 39 | + |
| 40 | +- **Working with PgFlow** |
| 41 | + - How to deploy to Supabase.com |
| 42 | + - How to implement custom retry logic |
| 43 | + - How to configure worker concurrency |
| 44 | + - How to monitor flow execution |
| 45 | + |
| 46 | +- **Troubleshooting** |
| 47 | + - Resolving common worker issues |
| 48 | + - Debugging failed flows |
| 49 | + - Performance optimization |
| 50 | + - Migration strategies |
| 51 | + |
| 52 | +How-to guides should be: |
| 53 | +- Focused on practical steps to solve specific problems |
| 54 | +- Directed toward a clear goal |
| 55 | +- Minimal in explanation (just enough context) |
| 56 | +- Easily scannable for experienced users |
| 57 | + |
| 58 | +### Explanations (Understanding-oriented) |
| 59 | + |
| 60 | +Explanations provide background and context to help users understand PgFlow's concepts: |
| 61 | + |
| 62 | +- **Core Concepts** |
| 63 | + - The three-layer architecture (DSL, SQL Core, Edge Worker) |
| 64 | + - Postgres-first philosophy |
| 65 | + - Flow execution lifecycle |
| 66 | + - State management and consistency model |
| 67 | + |
| 68 | +- **Design Decisions** |
| 69 | + - Why DAG-only workflows |
| 70 | + - JSON serialization approach |
| 71 | + - At-least-once delivery with pgmq |
| 72 | + - Immutable definitions |
| 73 | + |
| 74 | +Explanations should be: |
| 75 | +- Clear about the "why" behind design decisions |
| 76 | +- Connected to PgFlow's design philosophy |
| 77 | +- Focused on concepts rather than specific code |
| 78 | +- Providing deeper understanding beyond task completion |
| 79 | + |
| 80 | +### References (Information-oriented) |
| 81 | + |
| 82 | +References provide precise, comprehensive technical information: |
| 83 | + |
| 84 | +- **API Documentation** |
| 85 | + - TypeScript DSL API |
| 86 | + - SQL Core functions |
| 87 | + - Edge Worker configuration |
| 88 | + - CLI commands |
| 89 | + |
| 90 | +- **Schema & Configuration** |
| 91 | + - Database schema reference |
| 92 | + - Configuration options for flows and steps |
| 93 | + - Environment variables |
| 94 | + - Supabase configuration |
| 95 | + |
| 96 | +References should be: |
| 97 | +- Comprehensive and accurate |
| 98 | +- Structured consistently |
| 99 | +- Minimal in explanatory content |
| 100 | +- Optimized for quick information lookup |
| 101 | + |
| 102 | +## Document Organization |
| 103 | + |
| 104 | +Following are some suggestions for organizing the documentation within the existing structure: |
| 105 | + |
| 106 | +1. **Website Package (`pkgs/website`)** |
| 107 | + - Main documentation hub organized by the four Diátaxis categories |
| 108 | + - Clear navigation between related content |
| 109 | + |
| 110 | +2. **README Files** |
| 111 | + - Each package README should focus on quick setup (how-to) and links to more comprehensive docs |
| 112 | + - Root README should provide a project overview and guide to documentation |
| 113 | + |
| 114 | +3. **API Documentation** |
| 115 | + - Generated from code comments where appropriate |
| 116 | + - Reference-style content that's comprehensive and accurate |
| 117 | + |
| 118 | +## Key Principles for PgFlow Documentation |
| 119 | + |
| 120 | +While applying Diátaxis, PgFlow documentation should maintain: |
| 121 | + |
| 122 | +1. **Postgres-first mindset** - All explanations should emphasize the database-centric nature |
| 123 | +2. **Three-layer clarity** - Clear separation of DSL, SQL Core, and Edge Worker concepts |
| 124 | +3. **Progressive disclosure** - Start with simple concepts before introducing advanced topics |
| 125 | +4. **Code examples** - Demonstrate real-world usage aligned with design philosophy |
| 126 | +5. **Cross-reference related content** - Link between tutorials, how-tos, explanations, and references |
| 127 | + |
| 128 | +By structuring documentation this way, users will be able to find what they need whether they're learning for the first time, solving a specific problem, seeking deeper understanding, or looking up precise technical details. |
0 commit comments