Akhil
Akhil

Reputation: 381

How to work web application in offline and online (in .NET)

Our company recently built a (POS) web application for our clients, but the client needed the application to work both offline and online, depending on the availability of internet connection.cloud based database is using here. The project is used for retail business(supermarkets, shops etc..).

I have no idea, how to work like this.

Anyways, I'm looking for a way to allow my application to run offline and online. The following technologies are used: .NET(layered structure), MySQL, jQuery, javascript, Ajax, HTML, and CSS.

If anyone knows please suggest a way to do?

Upvotes: 0

Views: 1674

Answers (3)

Ashish Garg
Ashish Garg

Reputation: 60

You can also create a docker file and create image of your technologies for offline mode. You can check this link for offline: How run docker images without connect to Internet?.

Upvotes: 0

LPLN
LPLN

Reputation: 473

I would suggest using Progressive Web Apps (PWAs) is the “progressive”. You don’t have to implement every feature of a PWA to consider your site as a PWA. Instead, the idea is that you implement a range of steps, each making your app better for your end-users.

or following this below: https://www.codeproject.com/Articles/1134703/Net-application-that-works-online-and-offline-Sma

https://medium.com/dev-channel/learn-how-to-build-a-pwa-in-under-5-minutes-c860ad406ed

Upvotes: 0

Athanasios Kataras
Athanasios Kataras

Reputation: 26430

If you need to access cloud data, then that complicates things. You will need to create some kind of synchronization mechanism for when you are back online.

Let's break down the requirement a bit.

What is offline? Can you just fallback to your local networks and access iis or any other web server? If yes, then it's even simpler.

When offline is internal network.

  1. Create your website and have a local internal database to connect to when offline.

  2. Create a daemon of some sort that will consolidate the remote data with the local one. Add some limitations for offline mode, like no history (otherwise the local db will become as big as the cloud one).

  3. Instead of two and if you have no limitations, try https://dev.mysql.com/doc/refman/8.0/en/replication.html

When offline is per workstation

A similar solution depending on the limitations. First you need to identify how the people will access the code without having a web server. The .net part can't be served without one so,

  1. You will either have a local iis for everyone
  2. Create a lightweight version of the website were state still be saved in cookies or browser db, or local storage depending on retention.
  3. Create a desktop application instead. This way it can work offline with databases like a SQL-lite and synchronize as needed.

Upvotes: 2

Related Questions