Docs: Add Mermaid Diagrams to Docs Page #242
Open
+721
−269
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR enhances the LabLink documentation by replacing ASCII art diagrams with interactive Mermaid diagrams and adding visual representations of key workflows. The changes improve documentation clarity, consistency, and developer understanding of the system architecture.
Changes Made
Phase 1: Convert Existing ASCII Diagrams ✓
Docker Build Decision Flow (workflows.md:220-248)
System Architecture Overview (architecture.md:7-66)
VM Request Flow (architecture.md:245-273)
VM Creation Flow (architecture.md:277-304)
Health Check Flow (architecture.md:308-331)
Phase 2: Add New Workflow Diagrams ✓
CI/CD Pipeline Overview (workflows.md:18-74)
Production Release Workflow (workflows.md:292-322)
VM State Machine (architecture.md:164-206)
Phase 3: Add Supporting Diagrams ✓
Deployment Methods Decision Tree (deployment.md:18-49)
Database Schema ER Diagram (database.md:22-47)
generate_init_sql.pyPostgreSQL NOTIFY/LISTEN Flow (database.md:104-174)
Additional Updates ✓
pymdownx.superfencescustom fences for Mermaid support (lines 73-77)extra_javascript(line 131-132)Design Decisions
Diagram Types Selected
Color Scheme
fill:#e1f5ff(light blue)fill:#fff4e1(light orange)fill:#4a90e2,color:#fff(blue with white text)fill:#336791,color:#fff(dark blue with white text)Future Considerations
classDeffor better dark mode compatibility (previously attempted but rolled back per user preference)Accuracy from Source Code
All diagrams were verified against actual implementation:
packages/allocator/src/lablink_allocator_service/generate_init_sql.pypackages/client/src/lablink_client_service/subscribe.pypackages/allocator/src/lablink_allocator_service/main.pyanddatabase.pyupdate_inuse_statusbehaviorExample: CI/CD Pipeline Overview
flowchart TD Start[Trigger Event] --> PRCheck{Pull Request?} PRCheck -->|Yes| CIWorkflow[ci.yml] PRCheck -->|No| PushCheck{Push to branch?} PushCheck -->|main| BuildImages[lablink-images.yml] PushCheck -->|test| BuildImages PushCheck -->|docs| DocsDeploy[docs.yml] Tag[New Tag Created] --> PublishPyPI[publish-pip.yml] PublishPyPI --> ManualTrigger[Manual: Build Production Images]Benefits
Testing
mkdocs serveFiles Modified
mkdocs.yml- Added Mermaid support configurationdocs/workflows.md- Added 3 new diagrams, converted 1 ASCII diagramdocs/architecture.md- Added 1 new diagram, converted 4 ASCII diagramsdocs/deployment.md- Added 1 new diagramdocs/database.md- Added 2 new diagramsCLAUDE.md- Correctedin_usestatus definitionTotal Impact
in_usestatus definition