Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Aj Starter Radzen Blazor with FastEndpoints .Net 9
Aj Starter Radzen Blazor with FastEndpoints .Net 9

Aj Starter Radzen Blazor with FastEndpoints .Net 9

Amarjyoti Mahanta

|
14 installs
| (0) | Free
A clean, production-ready Blazor WebAssembly and ASP.NET Core (.NET 9) solution template using Radzen Blazor and FastEndpoints. Includes client-server projects with built-in authentication, modular ar
Download

Aj Blazor Solution Template .NET 9 (Radzen)

Aj Blazor Solution Template .NET 9 (Radzen) is a modern, modular, and extensible Blazor WebAssembly application built on .NET 9. It provides a robust foundation for user, role, and permission management, leveraging best practices in authentication, authorization, and UI development with Radzen blazor.


Table of Contents

  • Features
  • Project Structure
  • User, Role & Permission Module
  • Data Flow & Lifecycle
  • How to Run
  • Development Notes
  • References

Features

  • Blazor WebAssembly SPA with .NET 9
  • Modular user, role, and permission management
  • JWT-based authentication and role/permission-based authorization
  • Modern UI with Radzen Blazor
  • FastEndpoints for minimal, high-performance APIs
  • Entity Framework Core with support for SQL Server, SQLite, and PostgreSQL
  • Clean separation of client, server, and shared code

Project Structure

AjStarter.WebApp/ ├── AjStarter.WebApp/ # Server-side (API, DB, Identity) │ ├── Data/ # EF Core DbContext and configurations │ ├── Endpoints/Identity/ # API endpoints for user, role, permission, token │ ├── Services/Identity/ # Business logic for identity management │ ├── Validators/ # FluentValidation for input validation │ ├── Migrations/ # EF Core database migrations │ └── ... ├── AjStarter.WebApp.Client/ # Blazor WebAssembly client │ ├── Pages/Identity/ # UI pages for user, role, permission management │ ├── Services/Identity/ # HttpClient-based API services │ ├── Shared/Dtos/Identity/ # Data transfer objects (DTOs) │ ├── Components/ # Reusable UI components │ ├── Layout/ # Main layout and navigation │ └── ...

User, Role & Permission Module

Key Features

  • User Management: Create, update, delete users; assign roles.
  • Role Management: Create, update, delete roles; assign permissions.
  • Permission Management: Assign permissions to roles.
  • Authentication: Login/logout with JWT tokens.
  • Authorization: UI and API protected by roles and permissions.

Main Files

  • API Endpoints:
    • Endpoints/Identity/UserEndpoint.cs
    • Endpoints/Identity/RoleEndpoint.cs
    • Endpoints/Identity/RolePermissionsEndpoint.cs
    • Endpoints/Identity/TokenEndpoint.cs
  • Services:
    • Services/Identity/UserService.cs
    • Services/Identity/RoleService.cs
    • Services/Identity/RolePermissionService.cs
  • Client Pages:
    • Pages/Identity/User/Users.razor
    • Pages/Identity/Role/Roles.razor
    • Pages/Identity/Role/RolePermissions.razor
  • DTOs:
    • Shared/Dtos/Identity/RoleDto.cs
    • Shared/Dtos/Identity/Token.cs

Data Flow & Lifecycle

Example: Assigning Permissions to a Role

  1. UI Loads:
    RolePermissions.razor calls RoleService to fetch all permissions and assigned permissions for the selected role.

  2. User Interaction:
    User toggles checkboxes to assign/unassign permissions. Local state is updated.

  3. Save:
    On save, RoleService.AssignPermissionsAsync sends the updated list to the API.

  4. API Endpoint:
    RolePermissionsEndpoint receives the request, updates the database via RolePermissionService, and returns a result.

  5. UI Updates:
    The UI reflects the new assignments.

Blazor Lifecycle Methods Used

  • OnInitializedAsync: Fetches data when the page loads.
  • Event handlers (e.g., OnPermissionToggled): Update state on user actions.
  • Async service calls: Communicate with the backend.

How to Run

  1. Requirements

    • .NET 9 SDK
    • Visual Studio 2022 (latest recommended)
  2. Setup

    • Open the solution in Visual Studio.
    • Restore NuGet packages.
    • Apply EF Core migrations if needed (see Migrations/).
  3. Run

    • Set project as the startup project.
    • Press F5 or Ctrl+F5 to run.
  4. Access

    • The app will open in your browser. Use the navigation menu to access user, role, and permission management.

Development Notes

  • Blazor WebAssembly is used for the client UI. All business logic and API calls are handled via injected services.
  • FastEndpoints provides minimal, high-performance API endpoints.
  • Entity Framework Core is used for data access and migrations.
  • RadzenBlazor is used for all UI components.
  • Authentication/Authorization is enforced both in the UI (using <AuthorizeView>) and in the API endpoints.
  • DTOs are used for all data transfer between client and server.

References

  • Blazor Documentation
  • RadzenBlazor Docs
  • FastEndpoints Docs
  • Entity Framework Core Docs

This project is a solid starting point for building secure, modular, and modern Blazor WebAssembly applications with robust user, role, and permission management.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft