Git Product home page Git Product logo

blazordemo's Introduction

BlazorDemo

This is my simple Blazor application that demonstrates how to build SPA on Blazor and how to communicate with ASP.NET Core backend. Demo application is simple books database.

Solution contains:

  • Sample database BACPAC file (can be imported to MSSQL using SSMS)
  • Client application with Blazor UI
  • Basic select and CRUD operations are implemented in UI and in back-end
  • Displaying of delete confirmation dialog and deleting of books
  • Fully functioning add/edit form
  • Pager component and support for data paging
  • Dependency injection with custom service classes
  • Protecting Blazor application and Azure Functions based back-end using Azure AD

Azure AD example

For Azure AD there are two project in solution:

  • BlazorDemo.AdalClient - Blazor web application that supports Azure AD
  • BlazorDemo.AzureFunctionsBackend - Azure Functions project with all functions that form back-end for Blazor application

On Azure the following services are needed:

  • Azure AD - free one is okay
  • Azure SQL - instance with minimal size is okay
  • Azure Search - free tier is okay
  • App regitration on Azure AD - Web/Web API type of application
  • Azure Functions - minimal App Service where functions run is okay
  • Azure Storage GPv2 with static websites enabled (optional)

Configuration in code files:

  • BlazorDemo.AdalClient project wwwroot/js/app.js - Azure AD tenant ID and application ID
  • BlazorDemo.AdalClient project BooksAzureFunctionsClient.cs - Azure Functions host and Azure AD application ID
  • BlazorDemo.AzureFunctionsBackend project AzureSearchClient - Azure Search service and index name, access key

To use search you have to comment in calls to search service in BooksAzureFunctionsClient.cs (BlazorDemo.AdalClient project)

BACPAC for SQL Server is in External Files folder. After creating database on SQL Azure it is possible to import it as a data-tier application. Same way it is possible to import it to SQL Server LocalDb used by BlazorDemo.Client project.

More information is available in my blog post Azure AD authentication in Blazor using ADAL.js.

Tools

As of 2019-05-20 the following tooling is needed to build and run this solution:

Your opinion matters

If you tried out this solution and you understand how Blazor works then please find some moments to take brief survey by Microsoft helping to make Blazor even better.

References

blazordemo's People

Contributors

cveld avatar gpeipman avatar seanfeldman 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

Watchers

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

blazordemo's Issues

Local Database Files

Hello Mr. Gunnar,

There is not any local database create files (*.sql etc.) Could you put the database table creator files into the project.

Thanks a lot.

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.