How elsa-workflows/elsa-studio works
Main Components
• Core Framework & Services: The foundation lies in the Elsa.Studio.Core and associated framework projects (e.g., Elsa.Studio.Core.BlazorServer and Elsa.Studio.Core.BlazorWasm) that define contracts, service extensions, dependency injection helpers, and core business logic. These also interact with localization, menu systems, and notifications.
• Modules: There is an extensive set of modules (Agents, Counter, Dashboard, Environments, Localization, Login, Secrets, Security, UIHints, Webhooks, and multiple workflow modules) which can be diagrammed as extensions/plugins that add workflows-specific functions and UI components.
• Hosts: Multiple hosting projects exist such as:
– Elsa.Studio.Host.Server: For a Blazor Server hosted experience.
– Elsa.Studio.Host.Wasm and Elsa.Studio.Host.HostedWasm: For Blazor WASM deployments.
– Elsa.Studio.Host.CustomElements: Which likely provides integration of custom web elements.
• Frontend Clients: In addition to the Blazor frontends, there are React-based sample wrappers (in the wrappers directory) that show how the workflow designer and list components can be used as standalone or embeddable modules.
• Client Libraries & Asset Builders: The ClientLib folders in projects such as Elsa.Studio.DomInterop and Elsa.Studio.Workflows.Designer contain JavaScript/TypeScript and Webpack/Vite configurations used to build client assets.
• Configuration & Deployments: Files like Dockerfiles and build scripts indicate containerization and CI/CD integration.
Relationships & Data Flow
• The hosts depend on the core services and load various modules at runtime.
• The core components provide API endpoints, dependency injection and shared UI services that feed both Blazor and React frontend components.
• Module-specific services (e.g., Login, Localization) connect to the backend API and affect the UI (e.g., login components, localizable strings).
• The client asset build pipelines (using NPM scripts) build static assets that are then integrated into the hosting projects.
• Data and event flows: From user interactions on the client (Blazor/React UIs) to backend APIs (via HTTP message handlers like AuthenticatingApiHttpMessageHandler) and then into core workflow management services.
Architectural Patterns & Design Principles
• Modularity & Extensibility: The extensive use of modules illustrates an extensible plugin architecture—each module adds its own pages, components, services, and menu items.
• Separation of Concerns: There’s a clear separation between UI (frontend wrappers, Blazor components), core business logic (Elsa.Studio.Core), and service modules.
• Client–Server & API Layering: Frontends interact with backend APIs provided by hosting projects. The separation between server-side and WebAssembly (client-side) hosting is also explicit.
• Use of Dependency Injection & Service Collection Extensions: Numerous “ServiceCollectionExtensions.cs” files across the tree show a heavy reliance on DI and modular configuration.
Relevant Technologies, Frameworks & Libraries
• .NET 7 and .NET 8 SDK (C# and ASP.NET Core).
• Blazor (both Server and WASM) for rich interactive web UIs.
• MudBlazor for UI component styling.
• React (in the wrappers) for alternative frontends.
• Node.js and npm for asset building (Webpack, Vite, Storybook).
• Containerization with Docker (Dockerfiles in server and WASM hosts).
• Build and CI/CD integration (GitHub workflows, NuGet packaging).
Essential Elements
• Clear labels for each component (e.g., “Elsa.Studio.Core”, “Workflow Modules”, “Blazor Host – Server”, “React Wrapper Frontend”).
• Additionally, include supporting infrastructure elements such as CI/CD pipelines and asset build processes as peripheral components if needed.