Git Product home page Git Product logo

enkodellc / blazorboilerplate Goto Github PK

View Code? Open in Web Editor NEW
1.8K 83.0 369.0 10.62 MB

Blazor Boilerplate / Starter Template with MudBlazor

License: MIT License

HTML 20.07% C# 77.03% CSS 0.71% JavaScript 0.52% Dockerfile 0.12% Batchfile 0.27% PowerShell 0.01% Shell 0.38% Smarty 0.21% HCL 0.63% Smalltalk 0.04%
blazor boilerplate starter-template starter-kit material-design authentication identiyserver4 webassembly authorization blazor-boilerplate

blazorboilerplate's People

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  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

blazorboilerplate's Issues

Docker refactor

Updates to changes introduced in #51 (add docker support)

  1. Clean up dockerfile (add flags --no-restore, --no-build)
  2. Make docker-compose.yml clean, replace docker db related variables with overriden connection string
  3. Remove docker-compose.override.ym as of today it provides no value, and docker-compose project / running app in docker container auto creates that files that overrides content and enables remote debugging
  4. Clean up Startup.cs to remove dependancy to docker-related environment, ap code should not know about environment it runs under (standalone or docker container)

Blazor problem with publish in iis.

It works correctly when running from the exe. but when it comes to the iis, it tends to present the problem with the error, so all pages are waiting to authorize and the answers are loading ..

error

Login function doesn't work

If you try to login using user 'user' with password 'user123', it gives an error saying you are not authorised

Email's Sent History / Audit Log

Create a table with Migration for Email's sent by the application. This is a simple CRUD example to show adding table migrations for a simple feature so an admin for email audits.

Possible fields [Datetime, From, To, Bcc, CC, Subject, EmailTemplate Name]

@npraskins agreed to take on this project.

Should we convert to Server Side Blazor?

Looking for opinions on switching Blazor Boilerplate to Server Side Blazor. I know it will be easier to debug and will be more stable. My end goal is still Client Side Blazor for my future deployments. So if you have an opinion please voice it in a comment. If we move to SSB it will happen with a 0.4.0 version.

Question: Modified version of the boilerplate shows the loading screen only

I have the following problem and maybe you see a quick solution (or had this issue before):

I'm using the boilerplate in a modified way in my project. (I used the version from preview8 and updated the project to preview9 on my own). However, since the update, I only see the loading screen and the project itself isn't shown. The swagger page works correctly when you navigate to it with the browser.

I know, it's quite difficult to tell where this comes from as I can't provide you the exact code, but maybe you already had a similar issue, @enkodellc?

Middleware for Handling Requests

Review all API calls and create a consistent pattern for handling errors that bubble up to Toasts properly. This will create a better user experience as well as developer debugging.

Reset Password Failed

Hi, first of all thank you for the great boilerplate!!!

I successfully managed to (tried with the latest version - 01.8) :

  • Create new user, got email verification email and login.
    -Tested forgot password, got email.
    but unfortunately when i tried to reset the password, receiving "Failed to Reset Password" logs does not have anything either.

Drag and drop not working in Firefox version 69.0.3 (64 bit) on Windows 10

https://blazorboilerplate.com/drag_and_drop

Error: System.ArgumentException: There is no tracked object with id '2'. Perhaps the DotNetObjectReference instance was already disposed.
Parameter name: dotNetObjectId
at Microsoft.JSInterop.JSRuntime.GetObjectReference (System.Int64 dotNetObjectId) <0x2e25a88 + 0x0003c> in <4e424253df194e1299a1044d93a79164>:0
at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet (Microsoft.JSInterop.JSRuntime jsRuntime, Microsoft.JSInterop.Infrastructure.DotNetInvocationInfo invocationInfo, System.String argsJson) <0x2c55d50 + 0x00096> in <4e424253df194e1299a1044d93a79164>:0 blazor.webassembly.js:1:7164

named pipes provider / created in shadow state

I have a fully functional dev environment with connection to SQL Server Express, TCP/IP enabled an open port, allowed remote access etc, i.e. all the checks done to prevent error 40, yet:

The server was not found or was not accessible / Named pipes provider, error 40
and
'0.3.2.0perty '{property}' on entity type '{entityType}' was created in shadow state because there are no eligible CLR members with a matc'

databaseInitializer. SeedAsync().Wait() is where it fails.

I have both created the db (blazor_boilerplate) as well as left it up to the application, same result.

Site Doesn't load on iOS devices

Sorry if this is not the correct place for this but I tested your site on various devices and everything works except iOS devices. I've tested it on iPhone iPad and both hang on the loading screen. Is this a known issue?

login broken

step to reproduce:

  1. use local sql server
  2. run migrations scripts
  3. start app
  4. inspect AspNetUsers Table for user named user - all good.
    click login
    enter user & user123 for username & pw

problem - put a break point in the accountcontroller line 326 for builduserinfo
the line

var user = await _userManager.GetUserAsync(User);

user is null

OnEnter / Form Submission Feature.

Login on Enter from MatTextBox or Keypress for fire an event.

Possible solution is to use a form. Maybe create a MatBlazor Form component for submission?

APIResponseRequestLogginMiddleware produces invalid JSON response

  • I've added my own dto class into the shared project. One of the field is a decimal.
  • I added a service and a controller to the server project for reading all records/a single record.

Basically all I did was copy the logic from the ToDo example.

I'm using SQL Server.

But the produced JSON is then somehow not valid. It looks like there's some duplicate data at the end...

Here's an example:

{"Version":"0.1.9","StatusCode":200,"Message":"Retrieved SI-Einträge","Result":{"moniker":"xxx","sicherheitsIndikatorMoniker":"xx-7","facilityMoniker":"xxx","bewertungMoniker":"normalitaet","userMoniker":"xxx","wertText":"111","wert":16789.123456789122,"bemerkung":"","year":"2018","month":"1","monthsValid":"1","timestamp":"2019-01-01T00:00:00","rowVersion":""}}on":""}}

If I remove the decimal data type (or change it to int), the response is fine.

Edit:

Here's the code that produces the problematic JSON;

public async Task<APIResponse> Get(string moniker)
{
	var siEintrag = await _db.SicherheitsIndikatorEintraege.FirstOrDefaultAsync(t => t.Moniker == moniker);

	if (siEintrag != null)
	{
		var mapped = _autoMapper.Map<SicherheitsIndikatorEintragDto>(siEintrag);
		return new APIResponse(200, "Retrieved SI-Eintrag", mapped);
	}
	else
	{
		return new APIResponse(400, "Failed to Retrieve SI-Eintrag");
	}
}

The following code works (the response gets automatically wrapped in a APIResponse by the middleware):

public async Task<SicherheitsIndikatorEintrag> GetTest(string moniker)
{
	var siEintrag = await _db.SicherheitsIndikatorEintraege.FirstOrDefaultAsync(t => t.Moniker == moniker);
	return siEintrag;
}

Controller Endpoint Protection

So far you can login, but all controller are open for anonymous request. Some have the Authorize Attribute on it but are overwritte by the AllowAnonymous from the controller itself. So I can always request for example all users via PostMan.
As soon as I take out the one from the controller so that the the one from the endpoint comes into effect I always get an 401 Unautherized back.

I'm not sure if that is a bug or something that was not fully implemented :)

CascadingAuthenticationState/Policies/Claims

Hi

I tried to add CascadingAuthenticationState into blazorboilerplate, using the following sources:

Since I've run into some problems merging it back into a fork of your current project, I've created a copy here for now:

https://github.com/nstohler/blazorboilerplateCopy

I also played around with policies/claims.

It's not very clean so far, but compiling and working.

Maybe something to integrate into the project at some point...

contributing : postgres support

Hi,

I have just start to work on your boilerplate, I wish to contribute.

I have add the postgres support, it is a simple and basic contribution.

If you are interested I wish to work on the roles/permissions now, if you agree ?

Thanks

I am unable to get this to work with MS SQL

I get error "provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server" I am sure the connection string is correct, I use the same connection string in other projects.

Navigation links don't auto-activate based on current URL

Not sure if this is a blazorboilerplate issue or a matblazor issue, but I noticed that the navigation items in the drawer menu don't automatically become "active" when the URL changes, or on initial load/reload. They only change to the active state when you click on them. This means the active state of nav links are out of sync initially, and also if you navigate away from a link outside the drawer.

Would be nice if they worked like the built-in NavLink component and do URL path matching for active/inactive state.

EF Shadow Properties Not pulling in UserId

I think I used this Blog as an example: https://trailheadtechnology.com/entity-framework-core-2-1-automate-all-that-boring-boiler-plate/

Goal: Use Interface IAuditable on Model's to generate / populate. CreatedOn, CreatedBy, ModifiedOn, ModifiedBy properties / fields for that Model.

In the ChangeTrackerExtensions class you will find the SetShadowProperties method which is called in the EF ApplicationDbContext. This fires fine but the userSession is not null.

Testing procedure: Set a breakpoint in either SaveChanges of ApplicationDbContext or SetShadowProperties . Insert or Edit a Todo item and you should hit your breakpoint and see _userSession is empty.

There are some notes / comments in ChangeTrackerExtensions

Loading Blazor Boilerplate... slow loading

Hi,

I have a strange side effects, the "Loading Blazor Boilerplate..." page take a lot of time before continuing...

I mainly got this the first time I tried your Demo URL : https://blazorboilerplate.com/

PS: In JavaScript we have "webpack" to manage the bundle, to avoid very long loading at once, not sure it is related.

Flyout / Submenu Menu

In the main navigation create a submenu with option of flyout menu when minimized. Feature for MatBlazor

Sliding Nav Shelf animation a little glitchy

The animation that plays when the side-bar navigation slides in and out or transitions is sometimes a little bit glitchy. I think the text elements jump to the left before sliding and fading out to the right, and there are text-wrapping issues as the drawer width animates.

Also, when in auto-hide mode, the expand/collapse arrow shifts down after the drawer slides out:

image

Where it normally looks like this:
image

Have you had any success in publishing this to azure?

I've been trying out this project and learning blazor as I go, but I've been unable to publish the project to azure, getting just the error message "HTTP Error 500.0 - ANCM In-Process Handler Load Failure" (which I understand is because .net core 3 is not yet supported on azure, but there are extensions and it should work "self-contained"). Have you had any success and do you have any tips to get it working?

IS4 Branch: Serialized claims cannot be put into a Dictionary

You cannot serialize ExposedClaims as a Dictionary, as claim types are not unique. A drop-in fix for this is to swap List<KeyValuePair<string,string>> for Dictionary<string,string> for ExposedClaims in UserInfoDto/UserSession, and change the lambda in AccountController to:
ExposedClaims = User.Claims.Select(claim => new KeyValuePair<string,string>(claim.Type,claim.Value)).ToList()

Edit:
Since newtonsoft.json can't serialize this type properly (causes a self-referencing loop), this will need to be reworked slightly.

SQLServer / Sqlite config mixup

In 907aabd, startup.cs, I had to change

if (Convert.ToBoolean(Configuration["Authentication:UseSqlServer"] ?? "false"))

to

if (Convert.ToBoolean(Configuration["BlazorBoilerplate:UseSqlLite"] ?? "false"))

Then I was able to dotnet ef database update and create and use the SQLServer db.

Matblazor Error

Hi, maybe this is an MatBlazor error.. but when i run the Blazor boilerplate i'm getting this error:

image

Login page flashing

why login page shows up again for a moment after logging in? Any ideas on preventing this?

Login on Enter is broken (blocked by ASP bug)

You'll need to add @bind-value:event="oninput" in order for the data binding to update to the MatTextField password element since onchange isn't triggered until focus is lost, however due to an upstream issue, this will cause a crash on Blazor 3.0, and is triaged in 3.1

More details can be found here:
https://github.com/aspnet/Blazor/issues/236
dotnet/aspnetcore#13192
dotnet/aspnetcore#13181

A dirty workaround would be to call a JS interop in the meantime

user name not displayed after login

Problem

When I logged in, the index page only displayed "Hello !!!" (missing username). When I refreshed the page, I got the correct result: "Hello tester !!!"

How to fix it

in AuthorizeApi.cs:

public async Task<UserInfo> Login(LoginParameters loginParameters)
{
    var result = await _httpClient.PostJsonAsync<UserInfo>("api/Authorize/Login", loginParameters);
    return result;
}

"Switch from Entity Framework Core to Dapper" ?!

In your road map it is written that: "Switch from Entity Framework Core to Dapper. So far EF is not my cup of Tea. I think dapper will be stronger and faster"

Entity Framework Core does not slow down the database in any way. The speed is limited not by Entity Framework Core, but by the relational DBMS itself. Dapper will be just as slow, but will consume a little less CPU time for mapping and tracking objects. To accelerate, you do not need to downgrade to dapper. To speed up, you need to add a second level cache to the perfect Entity Framework Core!

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.