@bluealba/platform-cli 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +278 -15
- package/docs/404.mdx +5 -0
- package/docs/architecture/api-explorer.mdx +478 -0
- package/docs/architecture/architecture-diagrams.mdx +12 -0
- package/docs/architecture/authentication-system.mdx +903 -0
- package/docs/architecture/authorization-system.mdx +886 -0
- package/docs/architecture/bootstrap.mdx +1442 -0
- package/docs/architecture/gateway-architecture.mdx +845 -0
- package/docs/architecture/multi-tenancy.mdx +1150 -0
- package/docs/architecture/overview.mdx +776 -0
- package/docs/architecture/scheduler.mdx +818 -0
- package/docs/architecture/shell.mdx +885 -0
- package/docs/architecture/ui-extension-points.mdx +781 -0
- package/docs/architecture/user-states.mdx +794 -0
- package/docs/development/overview.mdx +21 -0
- package/docs/development/workflow.mdx +914 -0
- package/docs/getting-started/core-concepts.mdx +892 -0
- package/docs/getting-started/installation.mdx +780 -0
- package/docs/getting-started/overview.mdx +83 -0
- package/docs/getting-started/quick-start.mdx +940 -0
- package/docs/guides/adding-documentation-sites.mdx +1367 -0
- package/docs/guides/creating-services.mdx +1736 -0
- package/docs/guides/creating-ui-modules.mdx +1860 -0
- package/docs/guides/identity-providers.mdx +1007 -0
- package/docs/guides/mermaid-diagrams.mdx +212 -0
- package/docs/guides/using-feature-flags.mdx +1059 -0
- package/docs/guides/working-with-rooms.mdx +566 -0
- package/docs/index.mdx +57 -0
- package/docs/platform-cli/commands.mdx +604 -0
- package/docs/platform-cli/overview.mdx +195 -0
- package/package.json +5 -2
- package/skills/ba-platform/platform-cli.skill.md +26 -0
- package/skills/ba-platform/platform.skill.md +35 -0
- package/templates/application-monorepo-template/gitignore +95 -0
- package/templates/bootstrap-service-template/Dockerfile.development +1 -1
- package/templates/bootstrap-service-template/gitignore +57 -0
- package/templates/bootstrap-service-template/package.json +1 -1
- package/templates/bootstrap-service-template/src/main.ts +6 -16
- package/templates/customization-ui-module-template/Dockerfile.development +1 -1
- package/templates/customization-ui-module-template/gitignore +73 -0
- package/templates/nestjs-service-module-template/Dockerfile.development +1 -1
- package/templates/nestjs-service-module-template/gitignore +56 -0
- package/templates/platform-init-template/{{platformName}}-core/gitignore +97 -0
- package/templates/platform-init-template/{{platformName}}-core/local/.env.example +1 -1
- package/templates/platform-init-template/{{platformName}}-core/local/platform-docker-compose.yml +1 -1
- package/templates/platform-init-template/{{platformName}}-core/local/{{platformName}}-core-docker-compose.yml +0 -1
- package/templates/react-ui-module-template/Dockerfile +1 -1
- package/templates/react-ui-module-template/Dockerfile.development +1 -3
- package/templates/react-ui-module-template/caddy/Caddyfile +1 -1
- package/templates/react-ui-module-template/gitignore +72 -0
- package/templates/react-ui-module-template/Dockerfile_nginx +0 -11
- package/templates/react-ui-module-template/nginx/default.conf +0 -23
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Using Interactive Mermaid Diagrams
|
|
3
|
+
description: Guide to using the enhanced Mermaid diagram component with zoom and code viewing capabilities
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import MermaidDiagram from '~/components/MermaidDiagram.astro';
|
|
7
|
+
import { Aside } from '@astrojs/starlight/components';
|
|
8
|
+
|
|
9
|
+
This guide demonstrates how to create interactive Mermaid diagrams in the documentation using our enhanced component.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
The `MermaidDiagram` component provides several interactive features:
|
|
14
|
+
|
|
15
|
+
- **Zoom Controls**: Zoom in, zoom out, and reset to default view
|
|
16
|
+
- **Pan/Drag**: Click and drag to pan around large diagrams
|
|
17
|
+
- **Wheel Zoom**: Hold Ctrl/Cmd and scroll to zoom smoothly
|
|
18
|
+
- **View Source**: Toggle to see the raw Mermaid code
|
|
19
|
+
- **Copy Code**: Easy one-click copy to clipboard
|
|
20
|
+
|
|
21
|
+
## Basic Example
|
|
22
|
+
|
|
23
|
+
Here's a simple flowchart:
|
|
24
|
+
|
|
25
|
+
<MermaidDiagram
|
|
26
|
+
title="Simple Workflow"
|
|
27
|
+
code={`graph TD
|
|
28
|
+
A[Start] --> B{Decision}
|
|
29
|
+
B -->|Yes| C[Process]
|
|
30
|
+
B -->|No| D[End]
|
|
31
|
+
C --> D`}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
## Complex Architecture Diagram
|
|
35
|
+
|
|
36
|
+
For larger diagrams, the zoom and pan features become very useful:
|
|
37
|
+
|
|
38
|
+
<MermaidDiagram
|
|
39
|
+
title="Microservices Architecture"
|
|
40
|
+
height="700px"
|
|
41
|
+
code={`graph TB
|
|
42
|
+
subgraph "Client Layer"
|
|
43
|
+
Web[Web Browser]
|
|
44
|
+
Mobile[Mobile App]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
subgraph "API Gateway"
|
|
48
|
+
Gateway[API Gateway<br/>- Authentication<br/>- Rate Limiting<br/>- Load Balancing]
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
subgraph "Services Layer"
|
|
52
|
+
Auth[Auth Service]
|
|
53
|
+
User[User Service]
|
|
54
|
+
Order[Order Service]
|
|
55
|
+
Payment[Payment Service]
|
|
56
|
+
Notification[Notification Service]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
subgraph "Data Layer"
|
|
60
|
+
DB1[(User DB)]
|
|
61
|
+
DB2[(Order DB)]
|
|
62
|
+
DB3[(Payment DB)]
|
|
63
|
+
Cache[(Redis Cache)]
|
|
64
|
+
Queue[Message Queue]
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
Web --> Gateway
|
|
68
|
+
Mobile --> Gateway
|
|
69
|
+
Gateway --> Auth
|
|
70
|
+
Gateway --> User
|
|
71
|
+
Gateway --> Order
|
|
72
|
+
Gateway --> Payment
|
|
73
|
+
|
|
74
|
+
Auth --> DB1
|
|
75
|
+
User --> DB1
|
|
76
|
+
Order --> DB2
|
|
77
|
+
Payment --> DB3
|
|
78
|
+
|
|
79
|
+
Order --> Queue
|
|
80
|
+
Payment --> Queue
|
|
81
|
+
Queue --> Notification
|
|
82
|
+
|
|
83
|
+
User --> Cache
|
|
84
|
+
Order --> Cache`}
|
|
85
|
+
/>
|
|
86
|
+
|
|
87
|
+
## Sequence Diagram
|
|
88
|
+
|
|
89
|
+
Perfect for documenting API flows:
|
|
90
|
+
|
|
91
|
+
<MermaidDiagram
|
|
92
|
+
title="Authentication Flow"
|
|
93
|
+
code={`sequenceDiagram
|
|
94
|
+
participant User
|
|
95
|
+
participant Browser
|
|
96
|
+
participant Gateway
|
|
97
|
+
participant AuthService
|
|
98
|
+
participant Database
|
|
99
|
+
|
|
100
|
+
User->>Browser: Enter credentials
|
|
101
|
+
Browser->>Gateway: POST /auth/login
|
|
102
|
+
Gateway->>AuthService: Validate credentials
|
|
103
|
+
AuthService->>Database: Query user
|
|
104
|
+
Database-->>AuthService: User data
|
|
105
|
+
AuthService-->>Gateway: JWT Token
|
|
106
|
+
Gateway-->>Browser: Set cookie
|
|
107
|
+
Browser-->>User: Redirect to dashboard`}
|
|
108
|
+
/>
|
|
109
|
+
|
|
110
|
+
## Entity Relationship Diagram
|
|
111
|
+
|
|
112
|
+
Useful for database schema documentation:
|
|
113
|
+
|
|
114
|
+
<MermaidDiagram
|
|
115
|
+
title="Database Schema"
|
|
116
|
+
code={`erDiagram
|
|
117
|
+
USER ||--o{ ORDER : places
|
|
118
|
+
USER {
|
|
119
|
+
string id PK
|
|
120
|
+
string username
|
|
121
|
+
string email
|
|
122
|
+
datetime created_at
|
|
123
|
+
}
|
|
124
|
+
ORDER ||--|{ ORDER_ITEM : contains
|
|
125
|
+
ORDER {
|
|
126
|
+
string id PK
|
|
127
|
+
string user_id FK
|
|
128
|
+
decimal total
|
|
129
|
+
string status
|
|
130
|
+
datetime created_at
|
|
131
|
+
}
|
|
132
|
+
PRODUCT ||--o{ ORDER_ITEM : "ordered in"
|
|
133
|
+
PRODUCT {
|
|
134
|
+
string id PK
|
|
135
|
+
string name
|
|
136
|
+
decimal price
|
|
137
|
+
int stock
|
|
138
|
+
}
|
|
139
|
+
ORDER_ITEM {
|
|
140
|
+
string id PK
|
|
141
|
+
string order_id FK
|
|
142
|
+
string product_id FK
|
|
143
|
+
int quantity
|
|
144
|
+
decimal price
|
|
145
|
+
}`}
|
|
146
|
+
/>
|
|
147
|
+
|
|
148
|
+
## State Diagram
|
|
149
|
+
|
|
150
|
+
Great for documenting workflows:
|
|
151
|
+
|
|
152
|
+
<MermaidDiagram
|
|
153
|
+
title="Order State Machine"
|
|
154
|
+
code={`stateDiagram-v2
|
|
155
|
+
[*] --> Pending
|
|
156
|
+
Pending --> Processing: Payment confirmed
|
|
157
|
+
Pending --> Cancelled: User cancels
|
|
158
|
+
Processing --> Shipped: Items dispatched
|
|
159
|
+
Processing --> Cancelled: Out of stock
|
|
160
|
+
Shipped --> Delivered: Received by customer
|
|
161
|
+
Delivered --> [*]
|
|
162
|
+
Cancelled --> [*]`}
|
|
163
|
+
/>
|
|
164
|
+
|
|
165
|
+
## Tips for Using the Component
|
|
166
|
+
|
|
167
|
+
<Aside type="tip">
|
|
168
|
+
**Zoom and Pan**: For complex diagrams, use the zoom controls or Ctrl/Cmd + scroll wheel to zoom. Click and drag to pan around the diagram.
|
|
169
|
+
</Aside>
|
|
170
|
+
|
|
171
|
+
<Aside type="tip">
|
|
172
|
+
**View Source**: Click the code icon to see and copy the Mermaid source code. This is useful for learning or reusing diagram code.
|
|
173
|
+
</Aside>
|
|
174
|
+
|
|
175
|
+
<Aside type="note">
|
|
176
|
+
**Custom Height**: For diagrams with many nodes, increase the height using the `height` prop: `height="800px"`
|
|
177
|
+
</Aside>
|
|
178
|
+
|
|
179
|
+
## Component Props
|
|
180
|
+
|
|
181
|
+
| Prop | Type | Required | Default | Description |
|
|
182
|
+
|------|------|----------|---------|-------------|
|
|
183
|
+
| `code` | `string` | Yes | - | The Mermaid diagram code |
|
|
184
|
+
| `title` | `string` | No | - | Optional title shown above the diagram |
|
|
185
|
+
| `height` | `string` | No | `"500px"` | Height of the diagram viewport |
|
|
186
|
+
|
|
187
|
+
## Usage in MDX
|
|
188
|
+
|
|
189
|
+
```jsx
|
|
190
|
+
import MermaidDiagram from '~/components/MermaidDiagram.astro';
|
|
191
|
+
|
|
192
|
+
<MermaidDiagram
|
|
193
|
+
title="My Diagram"
|
|
194
|
+
height="600px"
|
|
195
|
+
code={`graph LR
|
|
196
|
+
A --> B
|
|
197
|
+
B --> C`}
|
|
198
|
+
/>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Keyboard Shortcuts
|
|
202
|
+
|
|
203
|
+
- **Ctrl/Cmd + Scroll**: Zoom in/out
|
|
204
|
+
- **Click + Drag**: Pan around the diagram
|
|
205
|
+
|
|
206
|
+
## Browser Support
|
|
207
|
+
|
|
208
|
+
The component works in all modern browsers with support for:
|
|
209
|
+
- ES6+ JavaScript
|
|
210
|
+
- CSS Custom Properties
|
|
211
|
+
- SVG rendering
|
|
212
|
+
- Clipboard API (for copy functionality)
|