How syncfusion/ej2-showcase-js-diagram-builder works
Project Type and Purpose
• It provides a visual interface for creating flowcharts, mind maps, org charts, etc., entirely on the client side.
• There is no custom backend; all logic and assets are packaged and served as static files.
Main Architectural Components
a. Development & CI/CD
• Source repository (Git) containing code, configs, scripts, and assets.
• Jenkins pipeline (Jenkinsfile) that pulls from Git, runs npm install, build scripts (Gulp/Webpack), and deploys to a static-file host.
• Configuration (config.json) for build or environment settings.
b. Build System
• Gulp (gulpfile.js) for tasks such as preprocessing or copying assets.
• Webpack (webpack.config.js) for bundling all JS modules under /scripts and /src into one or more output bundles.
c. Static Server
• Serves index.html plus the JS/CSS bundles and assets.
• In development, webpack-dev-server or npm run serve is used.
d. Client (Browser)
• index.html loads the main bundle.
• Assets: CSS (outlook.css, diagrambuilder.css, styles.css), fonts, images, and JSON template files.
Relationships & Data Flow
• Source repo → (push) → Jenkins CI → Build (npm → Gulp/Webpack) → Static hosting.
• Browser requests index.html → loads bundle.js + CSS + assets → instantiates DiagramBuilder.
Architectural Patterns & Design Principles
• Single-page application (no page reload).
• Separation of concerns:
• “common” folder for shared utilities and entrypoint (src/common/index.js).
• “home” module for the landing page (src/home).
• assets and JSON templates separated under src/assets.