An open API service indexing awesome lists of open source software.

https://github.com/kardelruveyda/github-copilot-modernization-microsoft-fluentui-blazor

.NET 10 Blazor Server demo showcasing Microsoft FluentUI Blazor with a Minimal API backend. Azure Portal-style UI: data grid, charts, dialogs, wizard, theming, EN/TR localization. Deployable to Azure App Service via azd + Bicep, or run instantly in GitHub Codespaces.
https://github.com/kardelruveyda/github-copilot-modernization-microsoft-fluentui-blazor

azd azure bicep blazor blazor-server copilot-modernization dotnet fluentui fluentui-blazor minimal-api net10

Last synced: 3 days ago
JSON representation

.NET 10 Blazor Server demo showcasing Microsoft FluentUI Blazor with a Minimal API backend. Azure Portal-style UI: data grid, charts, dialogs, wizard, theming, EN/TR localization. Deployable to Azure App Service via azd + Bicep, or run instantly in GitHub Codespaces.

Awesome Lists containing this project

README

          

# FluentUI Blazor Demo

[![Live Demo](https://img.shields.io/badge/Live%20Demo-Azure%20App%20Service-0078D4?logo=microsoftazure&logoColor=white)](https://app-fluentdemo-web-ygi6c27opusmo.azurewebsites.net/)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/KardelRuveyda/github-copilot-modernization-microsoft-fluentui-blazor?quickstart=1)

๐ŸŒ **Live demo:**
Sign in with username `admin` and any non-empty password.

A showcase application built with **.NET 10**, **Blazor Server** and **Microsoft FluentUI Blazor**.
The goal of this repository is to demonstrate how the FluentUI Blazor component library can be
used to build a rich, Azure Portal-style web application โ€” including data grids, charts,
dialogs, navigation, theming and localization โ€” on top of the latest .NET stack.

> No real backend, no real authentication. Everything runs in-memory so the demo can be
> cloned and started in a few seconds.

---

## โœจ What this demo shows

This is a small, opinionated tour of the FluentUI Blazor component library. The pages in
this app are intentionally varied so that each one focuses on a different set of components
and patterns.

| Area | FluentUI components / patterns used |
| --- | --- |
| **App shell** | Custom native HTML shell with `FluentPopover`, `FluentButton`, `FluentIcon`, `FluentSearch`, `FluentDesignTheme`, `FluentToastProvider`, `FluentDialogProvider`, `FluentMenuProvider`, `FluentMessageBarProvider`, `FluentTooltipProvider` |
| **Navigation** | `FluentNavMenu`, `FluentNavLink`, `FluentNavGroup`, custom collapsed rail, command-palette style search dropdown |
| **Login** | Custom themed login screen, native inputs, `FluentMessageBar`, `FluentButton` with `Loading` state |
| **Dashboard / Home** | KPI cards, command bar, service tiles, activity timeline (CSS grid + FluentUI icons) |
| **Incentives list** | `FluentDataGrid` with `PropertyColumn`, `TemplateColumn`, sorting, filter chips, three-dot row menu, pagination, status badges |
| **Create wizard** | Multi-step form with `FluentSelect`, `FluentTextArea`, `FluentRadioGroup`, `FluentSwitch`, `FluentNumberField`, `FluentDatePicker` |
| **Reports & analytics** | KPI cards, **SVG pie / donut / area / line / gauge charts**, **activity heatmap**, leaderboard data grid, Excel export |
| **Users CRUD** | Toolbar, `FluentDataGrid` with pagination, `FluentDialog` for create/edit, `FluentSelect`, `FluentSwitch`, `IToastService` |
| **Resources** | Split panel with `FluentTreeView` and a detail pane |
| **Activity log** | Filterable `FluentDataGrid` with level badges, `FluentPersona`, pagination, Excel export |
| **Settings** | `FluentTabs` with five tabs, theme + accent color pickers, security list, system info |
| **Chat assistant** | Floating FAB built from FluentUI primitives, button-driven (no AI), keyword routing |
| **Theming** | `FluentDesignTheme` with light / dark / system modes and customizable primary color |
| **Localization** | Custom `LocalizationService` with EN / TR strings, live switching via the language popover |
| **Excel export** | `ExcelExportService` powered by `ClosedXML` + a small `download.js` interop helper |

---

## ๐Ÿงฑ Stack

- **.NET 10** (SDK 10.0.x)
- **Blazor Server** with `@rendermode InteractiveServer`
- **Microsoft.FluentUI.AspNetCore.Components** (FluentUI Blazor)
- **ASP.NET Core Minimal API** (in-memory data store)
- **ClosedXML** for Excel export

---

## ๐Ÿ—‚๏ธ Project structure

```
src/
โ”œโ”€โ”€ FluentDemo.Shared โ†’ DTOs / records shared between API and Web
โ”œโ”€โ”€ FluentDemo.Api โ†’ ASP.NET Core Minimal API with in-memory data
โ””โ”€โ”€ FluentDemo.Web โ†’ Blazor Server UI (this is where the FluentUI demo lives)
```

Inside `FluentDemo.Web`:

```
Components/
โ”œโ”€โ”€ App.razor โ†’ Root document
โ”œโ”€โ”€ Routes.razor โ†’ Router
โ”œโ”€โ”€ AuthGuard.razor โ†’ Demo route guard
โ”œโ”€โ”€ ChatBot.razor โ†’ Floating assistant UI
โ”œโ”€โ”€ Layout/
โ”‚ โ”œโ”€โ”€ MainLayout.razor โ†’ Top bar, search palette, rail nav, popovers
โ”‚ โ”œโ”€โ”€ NavMenu.razor โ†’ FluentNavMenu / NavGroup / NavLink
โ”‚ โ”œโ”€โ”€ EmptyLayout.razor โ†’ Layout used by /login
โ”‚ โ”œโ”€โ”€ Breadcrumbs.razor โ†’ FluentBreadcrumb wired to NavigationManager
โ”‚ โ””โ”€โ”€ NotifItem.razor โ†’ Reusable notification row
โ””โ”€โ”€ Pages/
โ”œโ”€โ”€ Login.razor
โ”œโ”€โ”€ Home.razor โ†’ Dashboard
โ”œโ”€โ”€ Incentives.razor
โ”œโ”€โ”€ CreateIncentive.razor โ†’ Wizard
โ”œโ”€โ”€ Reports.razor โ†’ Charts + heatmap
โ”œโ”€โ”€ Users.razor
โ”œโ”€โ”€ UserEditDialog.razor
โ”œโ”€โ”€ Resources.razor
โ”œโ”€โ”€ ActivityLog.razor
โ””โ”€โ”€ Settings.razor

Services/
โ”œโ”€โ”€ AuthState.cs โ†’ Singleton fake auth state
โ”œโ”€โ”€ LocalizationService.cs โ†’ EN / TR strings
โ”œโ”€โ”€ ThemeService.cs โ†’ Mode + primary color
โ”œโ”€โ”€ ExcelExportService.cs โ†’ ClosedXML wrapper + JS interop
โ””โ”€โ”€ ChatBotService.cs โ†’ Button-driven responses
```

---

## โ–ถ๏ธ Running locally

Requires **.NET 10 SDK**.

Open two terminals:

**Terminal 1 โ€” API**

```powershell
dotnet run --project src/FluentDemo.Api
```

**Terminal 2 โ€” Web**

```powershell
dotnet run --project src/FluentDemo.Web
```

Then open the URL printed by the Web project (default: ).

### Demo credentials

| Field | Value |
|----------|-------|
| Username | `admin` |
| Password | `123` |

The Web app posts to `/api/auth/login` and the API just compares strings โ€”
**no real authentication, no token, no cookie**. The signed-in state lives in
the singleton `AuthState` service inside the Blazor app only.

---

## ๐ŸŽจ Using FluentUI Blazor โ€” quick reference from this project

A few patterns that come back over and over again in the codebase:

### 1. Registering FluentUI

```csharp
// Program.cs
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();

builder.Services.AddFluentUIComponents();

// Required at the root of the layout:
//
//
//
//
//
```

### 2. Theming

```razor

```

### 3. Data grid with template + property columns

```razor





@context.Status

```

### 4. Popovers anchored to native buttons

```razor
_open = !_open)">

...

```

### 5. Toast + dialog services

```csharp
@inject IToastService Toast
@inject IDialogService Dialog

Toast.ShowSuccess("Saved");

var dlg = await Dialog.ShowDialogAsync(
model,
new DialogParameters { Title = "Edit user" });
```

### 6. Excel export with ClosedXML

```csharp
await Excel.ExportAsync(
$"users_{DateTime.Now:yyyyMMdd_HHmm}.xlsx",
"Users",
_filtered,
("Username", x => x.Username),
("Full name", x => x.FullName),
("Email", x => x.Email),
("Role", x => x.Role));
```

### 7. Charts without an extra library

The Reports page draws **pie, donut, area, line and gauge** charts using plain SVG
helpers (`PiePath`, `DonutPath`, `AreaPath`, `LinePath`) computed in C# and rendered
inside `FluentCard`s. This keeps the dependency list minimal while still showing
that FluentUI plays nicely with custom visualizations.

---

## ๐Ÿงช Notes & limitations

- This is a **demo**. There is no persistence, no auth, no validation hardening.
- The API and Web ports may differ โ€” check the console output.
- Some pages (Resources, Activity Log, Settings) use mocked client-side data only.
- The chat assistant is rule-based; there is no AI involved.

---

## ๐Ÿ“œ License

MIT โ€” feel free to fork, copy, and use as a starting point for your own
FluentUI Blazor experiments.