ZenUML for Confluence is an Atlassian app (hybrid Connect/Forge) that empowers users to create and embed various types of diagrams directly within Confluence pages. It primarily focuses on sequence diagrams using ZenUML DSL but also supports Mermaid, DrawIO, and OpenAPI specifications.
- ZenUML Sequence Diagrams: Create sequence diagrams using a text-based DSL.
- Mermaid Diagrams: Support for Mermaid.js diagrams.
- DrawIO Integration: Create and edit graphs using DrawIO.
- OpenAPI/Swagger: Render OpenAPI specifications.
- Embed Diagrams: Embed existing diagrams, graphs, or API specs.
- Lite vs. Full Versions: The project has "Lite" and "Full" variants, differing in features and licensing.
- Atlassian Forge/Connect: The app uses Atlassian's Forge platform but also maintains Connect compatibility (hybrid app).
- Cloudflare Pages: Used for hosting the frontend assets.
- Cloudflare Workers (Functions): Handles backend logic and API endpoints.
- Cloudflare D1: SQLite database at the edge for data persistence.
- Framework: Vue.js 3 (primary), React 17 (likely for specific integrations like Swagger UI or legacy components).
- Build Tool: Vite.
- Styling: TailwindCSS.
- Diagramming Libraries:
@zenuml/core: Core ZenUML rendering logic.mermaid: Mermaid.js integration.swagger-ui: For OpenAPI rendering.mxgraph(via DrawIO): For graph editing.
- Runtime: Node.js (via Cloudflare Workers
nodejs_compat). - Language: TypeScript/JavaScript.
- Database: Cloudflare D1 (SQLite).
- Unit Testing: Vitest.
- E2E Testing: Playwright (indicated by
tests/e2e-testsand scripts).
src/: Frontend source code (Vue components, logic).functions/: Backend Cloudflare Functions.public/: Static assets (HTML templates for different editors/viewers).tests/: Unit and E2E tests.scripts/: Build and deployment scripts.manifest.yml: Atlassian Forge manifest defining modules, permissions, and app configuration.wrangler.toml: Cloudflare Workers/Pages configuration.
- Staging/Production: Deployed to Cloudflare Pages.
- CI/CD: Scripts available for deploying to different environments (staging, production, developer-specific).
- https://zenuml-stg.atlassian.net/wiki/spaces/ZS/pages/33152/Testing+Lite+1
- All content loads properly except for the second one.
- (Lite) https://zenuml-stg.atlassian.net/wiki/display/ZS/customcontent/list/ac%3Acom.zenuml.confluence-addon-lite%3Azenuml-content-sequence
- Open a diagram and it should load fine
- (Lite) https://zenuml-stg.atlassian.net/wiki/display/ZS/customcontent/list/ac%3Acom.zenuml.confluence-addon-lite%3Azenuml-content-graph
- Open a draw io diagram and it should load fine
- (Full) https://zenuml-stg.atlassian.net/wiki/display/ZS/customcontent/list/ac%3Acom.zenuml.confluence-addon%3Azenuml-content-sequence
- Open a diagram and it should load fine
- (Full) https://zenuml-stg.atlassian.net/wiki/display/ZS/customcontent/list/ac%3Acom.zenuml.confluence-addon%3Azenuml-content-graph
- Open a draw io diagram and it should load fine
- https://zenuml-stg.atlassian.net/wiki/spaces/ZS/pages/31260964/VVVff
- Some diagrams have data source as content-property
- Create a new page and add a sequence, a mermaid, a draw io diagram
- Start vue server at 8080 and proxy to 5000 for descriptor:
yarn start:sit - Expose 8080 on air.zenuml.com:
yarn cloudflare:8080 - Install https://air.zenuml.com/atlassian-connect.json
- Open the page with ZenUML macro
We need two commands
start:localandstart:sitbecause hot-reload works only on one domain.
- Install Wrangler command line tool
- Create project
wrangler pages project create zenuml-for-confluence # Enter the production branch name: … master - Create D1 database
Example output:
wrangler d1 create zenuml-for-confluence[[d1_databases]] binding = "DB" database_name = "zenuml-for-confluence" database_id = "c11ca41f-4670-4640-9991-3aceb7fd114a" - Copy the output to your
wrangler.toml - Add
migrations_dir = "functions/migrations"config underd1_databasesection Example file:compatibility_flags = [ "nodejs_compat" ] compatibility_date = "2024-11-11" name = "zenuml-for-confluence" pages_build_output_dir = "dist" [vars] DIAGRAMLY_BACKEND_API_BASE_URL = "https://staging.diagramly.ai" ENVIRONMENT = "development" # Set to "development" for local development [env.production] ENVIRONMENT = "production" [[d1_databases]] binding = "DB" database_name = "zenuml-for-confluence" database_id = "c11ca41f-4670-4640-9991-3aceb7fd114a" migrations_dir = "functions/migrations" - Run DB migration scripts
wrangler d1 migrations apply zenuml-for-confluence --remote - Run build:
pnpm build:full - Deploy:
Example output:
wrangler pages deploy dist✨ Deployment complete! Take a peek over at https://ca7b4ae9.zenuml-for-confluence-5v2.pages.dev ✨ Deployment alias URL: https://diagram-likes.zenuml-for-confluence-5v2.pages.dev - Install the app to your Confluence using the descriptor URL, e.g. https://diagram-likes.zenuml-for-confluence-5v2.pages.dev/descriptor for the Full app, or https://diagram-likes.zenuml-for-confluence-5v2.pages.dev/descriptor?lite for the Lite app
- Make it executable:
chmod +x run-docker-wrangler.sh- Authentication
./run-docker-wrangler.sh login- Operations Samples
# Apply migrations to local database
./run-docker-wrangler.sh d1 migrations apply [database-name] --local
# Execute SQL command
./run-docker-wrangler.sh d1 execute [database-name] --local --command "SELECT * FROM your_table;"
# Deploy
./run-docker-wrangler.sh pages deploy ./distThis section guides you through setting up and developing the app using Atlassian Forge.
- Ensure you have the Atlassian Forge CLI installed:
npm install -g @forge/cli - Authenticate with Forge:
forge login
Create a personal development environment to isolate your changes:
forge environments create -e [YOUR_PERSONAL_ENV_NAME]
Set it as the default environment:
forge settings set default-environment [YOUR_PERSONAL_ENV_NAME]
The project uses environment files to manage app-specific and developer-specific configurations.
App configuration files (committed):
.env.forge.dia- Diagramly app.env.forge.lite- Lite app.env.forge.full- Full app
Developer configuration (gitignored):
.env.forge.local- Your personal settings (FORGE_ENV, ATLASSIAN_SITE)
Setup:
-
Copy the example file:
cp .env.forge.local.example .env.forge.local
-
Edit
.env.forge.localwith your values:FORGE_ENV=your-env-name ATLASSIAN_SITE=your-site.atlassian.net
-
Switch to the app you're working on:
pnpm forge:use dia # or lite, or full
Usage:
pnpm forge:use dia # Switch to diagramly app
pnpm forge:deploy:dev # Deploy using your env settings
pnpm forge:upgrade:dev # Upgrade installation
pnpm forge:tunnel:dev # Start tunnel for local development
pnpm forge:all:dev # Build + deploy + upgradeBuild the lite version of the app:
pnpm build:lite
Remove the drawio directory to avoid exceeding the 50MB resource limit:
rm -rf dist/drawio
Deploy to your personal environment:
forge deploy
Install the app on your Confluence instance:
forge install -p Confluence -s [YOUR_ATLASSIAN_INSTANCE] --confirm-scopes
Replace [YOUR_ATLASSIAN_INSTANCE] with your Confluence site URL (e.g., https://yoursite.atlassian.net).
Start the local development server:
pnpm start:sit
In a separate terminal, start the tunnel to connect your local server to Atlassian:
forge tunnel
This allows you to test changes in real-time without redeploying.
Check the sub code.
Just re-register should fix it in most times.
401 is Unauthorized (or actually means Unauthenticated). It does not make sense as all content is public. Simply restarting fixes this issue.
- rm -rf node_modules
- yarn install
- Get the descriptor
- Validate the descriptor at https://atlassian-connect-validator.herokuapp.com/validate
- Read the schema doc with: https://json-schema.app/view/%23?url=https%3A%2F%2Fbitbucket.org%2Fatlassian%2Fconnect-schemas%2Fraw%2Fmaster%2Fconfluence-global-schema.json