VeriMe Documentation Diagrams
This directory contains documentation about diagrams used in VeriMe documentation. All diagrams are created using Mermaid, which is built directly into Docusaurus for fast, reliable rendering.
Why Mermaid?
- ✅ Built into Docusaurus - No external dependencies or services required
- ✅ Fast rendering - Diagrams render instantly in the browser
- ✅ Reliable - No network calls to external services
- ✅ Version controlled - Diagram source is in markdown files
- ✅ Easy to edit - Simple, readable syntax
- ✅ Multiple diagram types - Flowcharts, sequence, state, class, and more
Quick Start
Simply add a code block with the mermaid language identifier to any markdown file:
```mermaid
flowchart LR
A[Start] --> B[Process]
B --> C[End]
```
Diagram Location
Diagrams are embedded directly in markdown files, not stored as separate .mmd files. This approach:
- Keeps diagrams close to their context
- Makes them easier to find and edit
- Simplifies version control
- Reduces file clutter
Example locations:
docs/api-reference/verification-check.md- API flow diagramsdocs/architecture/overview.md- System architecture and sequence diagramsdocs/guides/adding-diagrams.md- Tutorial and examples
Supported Diagram Types
Flowcharts
Show processes, decision trees, and API flows.
Use for:
- API endpoint logic
- Decision trees
- Process workflows
- Error handling flows
Sequence Diagrams
Show interactions between actors and systems over time.
Use for:
- User workflows
- API call sequences
- Service interactions
- Authentication flows
State Diagrams
Show lifecycle and state transitions.
Use for:
- Voucher lifecycles
- Verification states
- Order workflows
- State machines
Architecture Diagrams
Show system structure and component relationships.
Use for:
- System architecture
- Component relationships
- Service boundaries
- Data flow
VeriMe Brand Colors
Use these colors consistently across all diagrams:
Standard styling:
style NodeId fill:#f9f9f9,stroke:#141571,stroke-width:2px
CSS classes approach:
classDef primary fill:#f9f9f9,stroke:#141571,stroke-width:2px
classDef data fill:#7FB4F0,stroke:#141571,stroke-width:2px
classDef accent fill:#E79236,stroke:#141571,stroke-width:2px
class Node1,Node2 primary
class Database data
Mermaid Resources
Official Documentation
- Mermaid Official Site
- Flowchart Documentation
- Sequence Diagram Documentation
- State Diagram Documentation
- Class Diagram Documentation
Tools
- Mermaid Live Editor - Test and export diagrams
- Docusaurus Mermaid Docs
Best Practices
1. Keep Diagrams Focused
- One diagram = one concept
- If a diagram becomes too complex, split it into multiple diagrams
- Use notes to add context rather than adding more elements
2. Use Consistent Styling
- Apply VeriMe brand colors consistently
- Use the same component shapes for the same types of elements
- Maintain consistent arrow styles
3. Add Descriptive Labels
Better than:
4. Choose the Right Diagram Type
- Flowcharts - When showing process flow and decisions
- Sequence - When showing interactions over time
- State - When showing lifecycle and transitions
- Graph - When showing structure and relationships
5. Test Before Committing
- Save your markdown file
- Run
npm run start - Navigate to the page
- Verify the diagram renders correctly
- Check that colors match VeriMe branding
Common Patterns
API Decision Flow
Service Architecture
Lifecycle State Machine
Troubleshooting
Diagram Not Rendering
- Check syntax - Use Mermaid Live Editor to validate
- Verify code fence - Must be
```mermaid(lowercase) - Check for special characters - Escape quotes and brackets if needed
- Rebuild docs - Clear cache with
npm run clear && npm run build
Styling Issues
- Verify hex codes - Must include # prefix
- Check node IDs - Must match exactly (case-sensitive)
- Test incrementally - Add styling after diagram works
- Use classDef - For reusable styles across multiple nodes
Complex Diagrams
If a diagram is too complex:
- Break it into multiple smaller diagrams
- Use subgraphs to organize elements
- Simplify by removing non-essential details
- Consider using multiple pages
Contributing
When adding or updating diagrams:
- Embed in markdown - Don't create separate .mmd files
- Test thoroughly - Check rendering in both light and dark mode
- Use VeriMe colors - Apply brand colors consistently
- Add clear titles - Use descriptive node labels
- Document context - Add explanation text around diagrams
Examples
See these pages for diagram examples:
- API Reference - Complex flowchart
- Architecture Overview - System and sequence diagrams
- Adding Diagrams Guide - Comprehensive examples
Support
For questions or issues:
- Review Mermaid documentation
- Test diagrams at Mermaid Live Editor
- Check Docusaurus Mermaid integration docs
- Contact the VeriMe documentation team