How lk-code/fluent-data-builder works
Project type and purpose
• This is a .NET class‑library ecosystem (“FluentDataBuilder”) that provides a fluent API for constructing hierarchical data objects (JSON, XML, YAML, IConfiguration).
• It consists of a core module (DataBuilder), multiple extension modules (Json, NewtonsoftJson, Xml, Yaml, Microsoft.Extensions.Configuration), test suites, and a documentation site built with static assets.
File structure
• Top‑level “source” directory:
• Core library: FluentDataBuilder (IDataBuilder, DataBuilder.cs, DictionaryExtensions helper)
• Extension libraries: FluentDataBuilder.Json, FluentDataBuilder.NewtonsoftJson, FluentDataBuilder.Xml, FluentDataBuilder.Yaml, FluentDataBuilder.Microsoft.Extensions.Configuration
• Test projects: FluentDataBuilder.Tests and module‑specific tests under FluentDataBuilder.ExtensionTests & Microsoft.Extensions.Configuration.Tests
• Solution file (.sln) organizes all projects
• “docs” folder: a static site with HTML, CSS, JS, assets, built and deployed via GitHub workflows
• CI: GitHub Actions workflows for .NET builds, testing, NuGet packaging, and docs publishing
README for additional insights
• Describes purpose: fluent builders for different output targets
• Lists NuGet packages, usage examples, calling patterns (builder.Add(...))
a. Main components
1. Core DataBuilder module (IDataBuilder interface, DataBuilder implementation)
2. Extension modules (Json, NewtonsoftJson, Xml, Yaml, Configuration)
3. Consumer code (user applications or libraries that reference FluentDataBuilder packages)
4. Test suites (unit tests for core and extensions)
5. Documentation site generator (static assets + build pipeline)
6. CI/CD pipelines (GitHub Actions) and NuGet feed / GitHub Pages
b. Relationships and interactions
• Consumer code → references Core and one or more Extension modules → calls IDataBuilder.Add() → Build() or ToConfiguration()
• Extension modules → depend on Core module
• Test projects → depend on Core and respective Extension modules
• CI pipeline → checks out code → builds all projects → runs all tests → packages NuGet artifacts → publishes packages → builds docs → deploys to GitHub Pages
c. Architectural patterns and design principles
• Modular plugin‑style design: Core defines the IDataBuilder contract; each extension implements output serialization
• Single responsibility: Core only manages in‑memory structure; serialization concerns are pushed to extensions
• Convention over configuration: Add‑method chaining in fluent style
d. Key technologies, frameworks, libraries
• .NET 8.0 class libraries and SDK-style projects
• System.Text.Json, Newtonsoft.Json, System.Xml, YamlDotNet, Microsoft.Extensions.Configuration
• xUnit or MSTest for unit tests
• GitHub Actions for CI/CD
• Static site assets (Bootstrap, FontAwesome) for documentation
Detailed component breakdown
• Core Library Node:
• IDataBuilder (interface)
• DataBuilder (implementation)
• DictionaryExtensions (helper)
• Extension Module Nodes (one per package): show their package name and principal class (DataBuilderExtensions)
• Test Suite Nodes: link to the modules they test
• Docs Site Node: static assets → HTML output → GitHub Pages
• CI/CD Pipeline Node: GitHub Actions (dotnet.yml, pull-request.yml, github‑pages.yml)
Final advice
• Don’t obscure small modules—capture each extension separately.
• Flow of data: “builder.Build() → JSON / XML / YAML / IConfiguration”
• Publishing steps: “dotnet pack → NuGet.org” and “docs build → GitHub Pages.”
• Keep the layout logical: Core in center, Extensions around it, Consumer at top, Tests below, CI/CD at side.