⭐ [Enhancement]: Configuration Editor (UI)
What is it?
A UI designed to create, view & edit a dab-config.json file.
Why?
The configuration file is getting more complex, easier to get wrong.
- Some customers have several hundred entities
Where?
As part of the dotnet tool install process.
How?
The configurator is a Blazor Server app. This is the same approach as the .NET Aspire dashboard. To host a Blazor Server app within a command-line console app (such as how Data API builder's CLI might host a configurator UI), simply use Kestrel, the web server that comes with ASP.NET Core which DAB already uses.
Basic flow:
- Configure
WebHostBuilderinside the CLI to serve Blazor. - When the CLI starts, spin up Kestrel, which serves Blazor.
- The CLI launches the browser to open the configurator.
Server Blazor
Blazor Server uses a persistent SignalR connection to handle UI interactions. UI events (like button clicks) are sent to the server, processed there, and the resulting changes are returned in real time. All app logic, event handling, data binding, and the component lifecycle are managed in C#, allowing you to write both client-side and server-side logic in C#. This eliminates the need for most JavaScript in web development. If needed, JavaScript interop allows optional integration with JavaScript libraries or browser APIs. Razor syntax (HTML + C#) renders dynamic content, and Blazor Server fully supports HTML and CSS, including CSS frameworks (like Bootstrap) and CSS isolation for scoped styling.
- Blazor Server builds web apps in C# with minimal or no JavaScript.
- It fully supports Razor, HTML, and CSS for the UI.
- JavaScript Interop is available for optional integrations.
File system access
Blazor Server can access local files on the server-side because the app runs on the server. You can use C#'s standard file I/O operations (System.IO) to read, write, or modify files on the server where the Blazor Server app is hosted.
How to launch
From the CLI: dab edit -c dab-config.json
Requirements
- Cross-platform
- Browser-based (starting with Edge)
- Development-only, no authentication
- No prerequisites other than
dotnet tools microsoft.dataapibuilder - Support environment variables
Features
- Add additional data-sources
- Add entities from data-source
- Visualize relationships
- Visualize
dab validate - Generate Cosmos schema
Use Cases
| Role | Feature | Purpose |
|---|---|---|
| Developer | Get started from scratch | Create a configuration file and set up entities array. |
| Developer | Add an additional data source | Introduce and manage a new data source. |
| Developer | Add entities from database | Add more entities to the configuration array. |
| Developer | Validate entities in configuration | Verify entities and relationships in the configuration. |
| Developer | Update existing entity | Modify an existing entity’s properties or relationships. |
| Developer | Remove an entity | Safely remove an entity from the configuration. |
| Developer | Edit runtime settings | Adjust performance, caching, or other runtime configurations. |
| Developer | Manage authentication and authorization | Configure security settings like authentication providers and role-based access. |
| Developer | Rollback configuration changes | Revert to fields or files to default values. |
Questions
- What UI standard should we use?
- First choice, Visual Studio's new preview configuration editor
- Second choice, VS Code's existing configuration editor
- Is the configurator independent of the engine?
- Does the configurator rely on hot reload?
Related issues that will be closed
- #1757
- Making entities optional is still a valid scenario.
- #1654
- This was the original specification. Still interesting, but this is the core Enhancement now.
- #1622
- This is no longer in scope as the configurator will load from the command line.
- #1623
- This is no longer in scope as the configurator will load from the command line.
- #1133
- This issue will be closed with "wontfix".
Does the dab tool ship the ASP.NET Core runtime? I think it must.