4
votes

I want to create a progressive web app with ASP.NET CORE 2.0 using Razor Pages preferably because I like the code behind architecture of Razor Pages.

Please recommend me a tutorial or docs or any course where I can begin to learn this. I already know ASP.NET CORE so I don't need to learn that, but actually I want to learn and create PWA but at server side I want to use ASP.NET CORE 2.0 and Razor Pages (if possible). And then I will be hosting them in Azure.

The courses I've searched so far on the web, all of them are with node.js or any other server side technology. Which is a problem because I don't want to use JS, except on the front end, where I don't have a choice.

2
a good place to start github.com/dhananshan/PWA-Asp.NetCoreNavin

2 Answers

2
votes

This is a very common misconception...that the client-side is tightly coupled to the server-side. They are not.

Your ASP.NET application renders pages/html on demand, at run-time, on the server. The site will work with or without the client-side code, that is why it is progressive....

Your PWA/Service Worker code is only concerned with stuff in the browser. You need to think about it as a stateless concern on the client. The service worker can add a proxy layer to the client-side where you can cache and really perform the task ASP.NET or Node Or PHP, etc perform, just in the browser, before the network must be used.

My advice, to learn the concepts, is to create a static version of your site or a test site. Get comfortable with how to make a PWA and a simple caching service worker, then apply it to your ASP.NET site.

There is nothing in ASP.NET itself your service worker needs to know about, well short of your routes. And your routes are independent of ASP.NET.

4
votes

According to your description, I assume that you could refer to the following tutorials for getting started with PWA using .NET Core:

Yeoman PWA Angular 4 & .NET Core

PWA-Asp.NetCore

Building Progressive Web Applications (PWA) with Visual Studio