0

Intro

My question is I personally spent last 2 years working on a Django project for a factory, it uses the standard MVC pattern. The app uses the factory IP for authentication for terminals in the factory. It was my first web project and I have learnt a lot from it, and hence re-written many aspects of it.

3 Problems with Django MVC

However I have now reached a point where I am wondering if it needs a re-write since I see no great solutions to the following problems with the MVC pattern:

  1. I wish to be able to POST data, and control what happens if it fails on the client side. With a normal POST, once one has submitted the form, one let's go of control. This means if the server is restarting, or receiving an update, and the reverse proxy is not up yet, Nginx shows an error and it parks on the error. I would like to be able to perform updates (take the Fast CGI (Django) down for 5 seconds) and have the website handle it seemlessly. Currrently if a GET is performed while the proxy is down, I serve up a maintenance page that tries to refresh every 5 seconds, so GETs work fine, but POSTs are a problem. SPA uses AJAX so one is still in control after the submission of data.

  2. If the internet connection is down, I would like to cache the POST, like a PWA?, then when online, send all the POSTS through. PWA solve this issue with their offline caching ability.

  3. When the internet goes down, the factory has a back up 3G internet connection, but then their IP address changes, hence IP based authentication then fails. There are public input station in the factory, hence they don't use user based authentication, so I need to figure out a new auth method. SPA use a token method which I think solves this problem.

Question

The above issues seems to be inheritantly solved when one moves to a SPA/PWA (according to my research, but I have never made a SPA/PWA). Would you recommendend changing to SPA/PWA or hammering the MVC to solve the above issues?

3
  • #1 sounds like something your reverse proxy (a.k.a. nginx, I don't understand why you talk about a separate reverse proxy when nginx is the reverse proxy) could do. #3 sounds like something you can do with a token, which has nothing to do with SPAs. – user253751 Dec 3 '20 at 18:05
  • also you have 3 separate questions here? – user253751 Dec 3 '20 at 18:05
  • @user253751 Sorry, I corrected the incorrect use of reverse proxy. Theres 3 parts to the question of whether to change artitecture, because if one changes to a solution that cannot solve all 3, then its pointless. – run_the_race Dec 3 '20 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.