How procodersptyltd/blazorforms works
Project type and purpose
• This is an open-source .NET low-code framework (“BlazorForms”) for defining and running flows, forms and business rules.
• It ships as a collection of NuGet-style class-library projects under src/, plus host apps under demo/ and seed/, and end-to-end integration tests under tests/.
High-level file-structure & architectural insights
• Top-level folders:
• demo/ – sample Blazor Server and WASM apps using the framework
• seed/ – minimal “sandpit” apps
• src/ – framework code, organized into feature-area subfolders (admin, dynamic-code, expressions, flows, forms, platform, proxy, rendering, rules, shared, store, wasm)
• tests/ – integration and unit tests organized by subsystem
• Each src/<area> folder is one or more .csproj libraries targeting a well-defined slice of functionality.
• Demo and seed apps reference platform + rendering + flows + forms + rules packages via DI.
Core architectural layers
a. Definitions layer (src/flows/BlazorForms.Flows.Definitions, src/forms/BlazorForms.Forms.Definitions, src/rules/BlazorForms.FlowRules.Definition)
– Contains abstractions, interfaces and JSON/schema models for flows, forms and rules.
b. Engine layer (src/flows/BlazorForms.Flows.Engine, src/dynamic-code/BlazorForms.DynamicCode, src/expressions/BlazorForms.Expressions, src/rules/BlazorForms.FlowRules)
– Implements parsing, execution, validation, dynamic compilation, expression evaluation and rule engines.
c. Platform layer (src/platform/BlazorForms.Platform.*)
– Plug-in points for storage (Cosmos, PostgreSQL, in-memory, item-store), hosting (ASP.NET Core controllers, WebAssembly support), background tasks, feature toggles and code generation.
d. Rendering layer (src/rendering/BlazorForms.Rendering.*)
e. Auxiliary libraries
– src/proxy/BlazorForms.Proxyma (model-proxying), src/shared/BlazorForms.Shared (common data structures, extensions), src/store/BlazorForms.ItemStore & BlazorForms.Storage (store abstractions).
f. Host apps
– demo/BlazorFormsDemo* and seed/BlazorForms* – sample Blazor Server, Blazor WASM and admin apps that consume platform + rendering + engine + definitions.
Key interactions and dependencies
• Flow or form definition → parsed by engine → produces a FlowContext or FormModel
• Engine invokes expression and rule libraries to evaluate conditions, business rules, field triggers
• Persistence: engine calls IFlowRepository → injected implementation (Cosmos, PostgreSQL, InMemory)
• UI: Blazor host app calls Platform’s Web API controllers to fetch FlowModel → rendering layer’s components render forms/flows in browser
• DynamicCodeEngine enables runtime‐compiled flows (SqlDynamicFlowRepository) and validation rules
• Proxyma library can wrap model objects for change-tracking scenarios
Architectural patterns & design principles
• Layered modular design with clear separation of concerns (definitions → engine → platform → rendering)
• Dependency Injection and IServiceCollection extension methods as plug-in model
• Onion/hexagonal architecture around core definitions and engine
• Plugin extensibility via IServiceCollection: add support for new storage, rendering, UI toolkits, code‐gen