Giter VIP home page Giter VIP logo

fullstackhero / blazor-wasm-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
524.0 43.0 335.0 1.65 MB

Clean Architecture Boilerplate Template for .NET 6.0 Blazor WebAssembly built for FSH WebAPI with the goodness of MudBlazor Components.

Home Page: https://fullstackhero.net/blazor-webassembly-boilerplate/general/getting-started/

License: MIT License

HTML 16.95% C# 81.96% CSS 0.24% JavaScript 0.39% Dockerfile 0.10% PowerShell 0.36%

blazor-wasm-boilerplate's Introduction

GitHub Discord Twitter

fullstackhero

Blazor WebAssembly Boilerplate

Built with .NET 6.0 and the goodness of MudBlazor Component Library. Incorporates the most essential Packages your projects will ever need. Follows Clean Architecture Principles.

Goals

The goal of this repository is to help developers / companies kickstart their Web Application Development with a pre-built Blazor WebAssembly Boilerplate that includes several much needed components and features.

Note that this is a frontend / client application only! The backend for this application is available in a seperate repository.

Prerequisites

Getting Started

Open up your Command Prompt / Powershell and run the following command to install the solution template.

dotnet new --install FullStackHero.BlazorWebAssembly.Boilerplate

or, if you want to use a specific version of the boilerplate, use

dotnet new --install FullStackHero.BlazorWebAssembly.Boilerplate::0.0.1-rc

This would install the fullstackhero Blazor WebAssembly Boilerplate template globally on your machine. Do note that, at the time of writing this documentation, the latest available version is 0.0.1-rc which is also one of the first stable pre-release version of the package. It is highly likely that there is already a newer version available when you are reading this.

To get the latest version of the package, visit nuget.org

FullStackHero.BlazorWebAssembly.Boilerplate is now in pre-release state. You can find the latest version on NuGet.org

FullStackHero.BlazorWebAssembly.Boilerplate::0.0.1-rc is compatible only with FullStackHero.WebAPI.Boilerplate::0.0.6-rc and above.

Get the .NET WebApi Boilerplate by running the following command

dotnet new --install FullStackHero.WebAPI.Boilerplate::0.0.6-rc

For more details on getting started, read this article

Community

Contributors

Submit your PR and join the elite list!

License

This project is licensed with the MIT license.

Support ⭐

Has this Project helped you learn something New? or Helped you at work? Here are a few ways by which you can support.

  • Leave a star! ⭐
  • Recommend this awesome project to your colleagues. 🥇
  • Do consider endorsing me on LinkedIn for ASP.NET Core - Connect via LinkedIn 🦸
  • Or, If you want to support this project in the long run, consider buying me a coffee! ☕

black-button

blazor-wasm-boilerplate's People

Contributors

274188a avatar bharathwajv avatar chihabhajji avatar dependabot[bot] avatar fretje avatar iammukeshm avatar matthewcorven avatar mikaelhild avatar mluepkes avatar pedroventura235 avatar pedroventurawork avatar xlogex avatar zigimun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blazor-wasm-boilerplate's Issues

[HELP WANTED] Add / Fix Localization

It would be great if someone from the community can take up this task.

Basically, all you need to do is fix / add localization resources.

Most of the texts in the Blazor components are not localization-ready. You have to add something like

@inject IStringLocalizer<NavMenu> L

to the component where NavMenu is the component name.

Now, you can use @L["Text"] for implementing localization.

For Example

Convert

<MudNavLink Href="/dashboard" Match="NavLinkMatch.All" Icon="@Icons.Material.Outlined.Dashboard">Dashboard</MudNavLink>

into

<MudNavLink Href="/dashboard" Match="NavLinkMatch.All" Icon="@Icons.Material.Outlined.Dashboard">@L["Dashboard"]</MudNavLink>

Similarly, go through each and every component of the project and do the required changes. Even if you could do this change for a single component, I would appreciate it :)

Once that's done, Navigate to the Client project to Client/Resources

Here is where you can find the RESX files arranged in a folder view.

For example,

the NavMenu.razor component resides under Client/Shared/NavMenu.razor

and the RESX file for this component resides under Client/Resources/Shared/NavMenu.{lang}.resx where {lang} is the LanguageKey.

In this RESX file, add the Name and Values, where Name is what you mentioned under @l["Dashboard"] and Value will be the localizes string.

Also note that the existing RESX files are copied over from BlazorHero. Thus, there can be chances that RESX files are in different directories altogether for certain components. So, Re-arrangement of RESX might also be necessary to properly load Localization files.

Thanks for the support! I will leave a sample commit for your reference.

Generating UpdateProductRequest

Hello,
When I generate the UpdateProductRequest with the NSwag command, how can I specify the default value of a property ?
For exemple instead of = default! I want to set = 1.
I made the property in the API class UpdateProductRequest to = 1, but when launching the command it's not taking it.

Is it normal or there is another way to do it ?
Thanks.

Create milestone

Hello @iammukeshm ! I like to contribute in this wasm project in my free time. Can you create a proper milestone for this project as well. so I can see what needs to implement.

Thanks

Cache when create user !

Hi,

When I buid app, and try create user, I alway see email & Password of admin to be cached in creat user user form ,,, Please help to fixed it :
image

Add RTL Support

Switching Language to Arabic should automatically change the app view orientation to RTL.

[BUG] FSH.BlazorWebAssembly.Client.Shared.BaseLayout.SetCurrentTheme - Null Ref while using Azure Auth

While using AzureAd Auth I see the error (below) in the browser tools (so client side wasm) - probably due to the fact we are kind of skip showing thoese controls completely when in AzureAd Auth mode

blazor.webassembly.js:1
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at MudBlazor.Utilities.MudColor..ctor(String value)
at MudBlazor.Utilities.MudColor.op_Implicit(String input)
at FSH.BlazorWebAssembly.Client.Shared.BaseLayout.SetCurrentTheme(ClientPreference themePreference) in C:\Users\274188A\source\repos\CLEAN\WASM\blazor-wasm-boilerplate\src\Client\Shared\BaseLayout.razor.cs:line 49
at FSH.BlazorWebAssembly.Client.Shared.BaseLayout.OnInitializedAsync() in C:\Users\274188A\source\repos\CLEAN\WASM\blazor-wasm-boilerplate\src\Client\Shared\BaseLayout.razor.cs:line 24
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Login remember me support?

Hi there,

Any chance of implementing the remember me for the Login? Not sure how the jwt and cookie thing would work in order to support this?

Cheers

MudSlider wrong value

Hello,

In the product page, the MaximumRate is set to 9999, when moving left the slider one step, the value is 99.

Add ThemeManager

Simple Popover that has options to

  • Toggle Dark Mode
  • Change Primary Colors
  • Change Secondary Colors

Drop-Down blur

While creating a new Product a user selects from the dropdown the brand for the product.
Before saving, the user changes their mind and selects another brand.

Expected: User can select another Brand from the drop-down then proceed to save.
Actual: User is unable to select any other option from the drop-down due to the disabling in the css

CRUD Operations

Brand CRUD
Product CRUD

Advanced Search Component - Column Wise Search
Export to Excel
Responsive
Pagination Support

Invalid Notification Received

Hi all,

I'm getting the below error when I try to add a brand and I'm watching the Dashboard for updates:

 blazor.webassembly.js:1 fail: FSH.Blazor.Client.Components.Notifications.NotificationConnection[0]
      Invalid Notification Received (FSH.Starter.Shared.Notifications.StatsChangedNotification).


notification issue

I was just wondering if there was something I was doing wrong or if this is a bug? I've not made any changes to the code, just launched this and the API.

Many thanks

Cannot open database "preReleaseTest"

I used my test MySQL database on another computer. Migration seems to be successful, many new tables occurred in the database.

On the first run:
ERR] Execution BackgroundServerProcess is still in the Failed state for 00:09:25.6352334 due to an exception, will be retried no more than in 00:00:15
Cannot open database "preReleaseTest" requested by the login. The login failed.

Access field by code

Hello,
I have a little issue, I can't find how to access a field from code.
For exemple in the product form, I want to fill the field description when I'm clicking on a button.

I already did the method on click, but I don't know how to change the description value.
The context.Description is not accessible from Product.razor
Thanks.

ApiHelper returning NullReferenceException

First, thank you for the boilerplate. I am facing an issue while using the ApiHelper.

I am trying to call an API with below method, but ApiHelper is returning NullReferenceException. But i can able to call the same API using swagger successfully.

image

image

Share the Shared Project.

We should find a way to actually share the shared project between blazor and the api.

There's different options:

  • create an entirely separate git repo for it and share it using submodules
  • simply copy over the files periodically using a script (could be combined with the script for generating the api-client)

There's probably more (please tell!), but from those 2 I think the latter will be easier to manage.

Authenticate via FSH Api

  • Setup Login Page
  • Setup CORS
  • Pass username, password, and tenant key to API
  • store access token to local storage
  • redirect to home page/dashboard
  • in case of auth failure, show toast notification

notifications are not shown when there are errors in the data of a new user

Hello, congratulations for this amazing project. The issue is when you want to register a new user when clicking on register the page only returns to the login page, but does not show any notification to the user of what happened so that he can know what the error is and can correct them , I also consider that it should not return to the login page if there is an error to give the user the opportunity to correct the errors and not rewrite all the fields again. I don't know if this only happens to me, anyway thanks for your attention. Regards

register-user

image

Add Logout Dialog

User must be shown a logout confirmation dialog as soon as he clicks on the Logout Button.

Error while update Role

Hello,
I think there is a regression in the front while updating role, before there was no bug, this month I tried to update a role and I have the error bellow
Unhandled exception rendering component: The given key 'PermissionViewModel { Description = View Dashboard, Action = View, Resource = Dashboard, IsBasic = False, IsRoot = False, Name = Permissions.Dashboard.View, Enabled = True }' was not present in the dictionary.

I download the last version in this repo and the error existe too.

To reproduce, juste go to Basic role and check or uncheck any field then save.

[BUG] GetTenant

ClaimsPrincipalExtension

public static string? GetTenant(this ClaimsPrincipal claimsPrincipal)
    => claimsPrincipal.FindFirstValue(ClaimTypes.Name);

Fix:
public static string? GetTenant(this ClaimsPrincipal claimsPrincipal)
=> claimsPrincipal.FindFirstValue("tenant");

MudSwitch not working in EditFormContent

Hello,

The behavior of the MudSwitch is not working inside the EditFormContent section.
The property that the @bind-Checked is linked to is not changing.

Exemple :
<MudSwitch @bind-Checked="@_checked3" ThumbIcon="@(_checked3==true ? Icons.Material.Filled.Done : Icons.Material.Filled.Close)" ThumbIconColor="@(_checked3==true ? Color.Success : Color.Error)">Changing</MudSwitch>

The code above when is inside the EditFormContent will not work, otherwise it's working when outside

@code{bool _checked3 = false;}

The _checked3 is always false even if the switch is done

Can you help me with that please ?
Thanks

Misundestrand with the Architecture

Hello,

I don't understand the architecture of the project, where are the controllers and connection string ?
Can you please can you enlighten me ?
Thanks

First Run Issue

I created a project of blazor wasm using visual studio 2022 and found issues. The logs of the console are added in the log file attached to this issue.

Looking forward to knowing how can I fix this issue
LOG FILE

Move Dense, Bordered and Striped to the ThemeManager Pane

Having those 3 switches on every table is a sore on the eye (it makes the first column wider than it has to be and it's totally messed up when the first column isn't wide enough anymore).

I think these would fit perfectly in the ThemeManager SidePanel as user-configurable global settings for all the tables in the app (at least those that subscribe to the changes of those properties)

RolePermissions

The new RolePermissions view could be made more user friendly.

Nothing personal, @PedroVentura235, you did a great job with the initial version! Just want to iterate on it a bit more ;-)

The Permissions should be split into their respective categories. Similar like how it's done in BlazorHero.
There it's done using tabs. It can be anything: tabs, groups in a table, a treeview or any other of visual representation of groups, but like it is now it's not really easy to find what you need.
The groups in FSHPermissions.cs actually have DisplayName and Description attributes which values could be used in the UI (after running them through the localizer maybe?). I guess they are put there for that reason?

About the descriptions: like it's implemented now, the descriptions of the individual permissions will always be empty.
I thought those descriptions were in FSHPermissions.cs as well. But apparently, as it looks, they live in the database in the RoleClaims table now?

That doesn't make much sense to me to be honest. As one particular permission can be added to different roles, this means those descriptions would have to be duplicated everywhere, and permissions that aren't added to any roles can't have a description? And where would the descriptions come from in the first place?

I think there's something wrong in the design here?

I think we should also put Description attributes on all the individual Permissions in FSHPermissions.cs, And take them from there in stead for the UI. And then simply remove the Description property from ApplicationRoleClaim and the dto's that are derived from it... no need to send those over the wire either...

Question on Proxy Generation

Hi. I am currently checking out the wasm Blazor project, added new entitities/controllers using the Api boilerplate.

Now the question is, Blazor project cant see updated proxy, The WebApiClient does not reflect the new controllers?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.