Skip to content
EchwaysPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Enfilade

A Blazor Server shell for admin panels. Register routable components as sections. Enfilade provides the navigation, theme, page chrome, dialogs, and error and reconnection handling.

English · Русский

NuGet CI License

builder.Services.AddEnfilade()
    .AddSection<Home>("Home")
    .AddSection<Orders>("Orders");
    .AddSection<Clients>("Clients");

app.MapEnfilade();

An overview page with figures, a chart and a ranking

Why Enfilade

An admin panel is mostly the same pages: a table, a form, a few numbers. Enfilade takes the work around them so a page stays a page.

  • One call per section. A section is a Razor component with a route. Register it and it has a place in the navigation, a title, a 404 and an error boundary.
  • Tables that remember. Listing keeps sorting, paging, search and filters in the address, so a link to a filtered view works for a colleague. It works over IQueryable in one line, EF Core included.
  • Forms without ceremony. Inputs come from the model's types and data annotations. A changed form asks before it is closed or left.
  • Actions that behave. Button confirms, blocks double clicks, reports success, shows a readable error and refreshes the page.
  • Rights where they already are. Sections follow [Authorize] on their pages. What a user may not open is not in the menu.
  • Right time for everyone. Times show in the viewer's time zone, data stays in UTC.
  • Calm when things break. A failing page, count or load stays where it happened; the navigation keeps working. A dropped connection gets a reconnection dialog.
  • Looks finished. Dark and light themes, your accent color, phone layouts with bottom sheets, keyboard and screen reader support. MudBlazor inputs, tables and menus match the theme.
  • English and Russian out of the box, with a language switch.

Installation

dotnet add package Enfilade

Requires .NET 10.

Quick start

using Enfilade;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddEnfilade(shell => shell.Brand = "Orders")
    .AddSection<Home>("Home")
    .AddSection<Orders>("Orders");

var app = builder.Build();
app.MapEnfilade();
app.Run();

Add the namespaces to _Imports.razor:

@using Enfilade
@using MudBlazor

A section is any routable component. A table with search and sorting:

@page "/orders"
@inject OrderStore Store

<PageHead />
<Listing TItem="Order" Load="Store.PageAsync" SearchBy="[order => order.Customer]" Sort="-createdAt">
    <Filters>
        <Search />
    </Filters>
    <Columns>
        <Cell Title="Customer" Value="order => order.Customer" Sort />
        <Cell Title="Total" Value="order => order.Total" Sort />
        <Cell Title="Created" Value="order => order.CreatedAt" Sort />
    </Columns>
</Listing>

A listing with search, filters, selection and paging

What is included

Area Highlights
Navigation Sections with icons and live counters, captions, account menu, language switch.
Listings Server or in-memory data, filters, selection, live reload, loading, empty and error states.
Forms and dialogs Side and bottom sheets, validation, field errors, unsaved-changes guard.
Blocks Figures with change, line and bar charts, rankings, meters, tabs, timeline, facts, expandable catalogs.
Errors Readable messages for your own exceptions, contained failures, retry.
Access Host authentication, roles and policies, per-section visibility.
Formatting Numbers, sizes, durations, ICU plurals, the viewer's time zone.
Extending Section libraries, scoped CSS, design tokens as CSS variables.

Tabs with a timeline on an order page

Documentation

Getting started Installation, the host, the first section
Sections Navigation, icons, counters
Actions Button, Act, CurrentPage
Listings Tables, filters, selection
Dialogs and forms Sheets, Form, Field
Components Figures, charts, tabs and catalogs
Error messages What users see on failure
Formatting Words, ViewerTime
Styling Themes, accent, tokens
Authentication Sign-in, roles, policies
Localization Languages and texts
Configuration All options
Section libraries Sections as packages
Runtime behavior Refreshing, failures, reconnection
Troubleshooting Common messages and questions

License

GPL-3.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages