Realtime app with signalR and ampesand-reactjs - signalr

Im going to build some kind of voting-app with .net signalR (and .NET Web Api) backend and Reactjs and Ampersand.js on the client.
I have a couple of questions regarding this setup:
What is the differense between using React-router and Ampersand-router?
Will it be easier to manage browser-state if I go with Ampersand-router?
Does anyone have an alternative choice of clientstack when it is importaint to have an organized and responsive client in a high intensity realtime environment (High frequency voting).

Related

Difference in offline-first approach and PWAs?

While googling for the confusion of mine, I didn't found the satisfactory resource.
so the question which I was searching for was, What is the difference between offline-first approached mobile apps and PWAs.
As to my level of understanding any mobile app lets say; a react-native app with redux in use or with SQLITE or with realm can be made as a offline-first approached app.
And with PWAs the service worker(of which i have less knowledge) makes all the offline user-interaction and at last when the net connectivity is confirmed the data is fetch or retrieved as required by PWAs.
Though I am not mentioning about other features PWAs can perform(again of which I have less knowledge). And even when the modern browser can only support for PWAs, why there is a hype of PWAs in todays trends?
Please guide me through with any mistake with my question. Any kind of information, knowledge or link to answer my query is much appreciated.
You can read the first of a series of articles about PWAs to get more details about PWAs features and their benefits.
The two concepts are not mutual exclusive. PWAs, thanks to the Service Worker and caching strategies, are able to implement/provide an offline first approach by caching target assets or data responses.
You can however provide an offline first approach also by using other technologies, without introducing a PWA.
The hype behind PWAs is due to the many extra functionalities we can add to a web app, making it behave and look like a native solution. Think just to the advantages of having your frontend team developing a web app that with very little efforts seems almost entirely a native app. And this without having to hire a dedicated native team (iOS/Android).
However PWAs are not the silver bullet for any scenario. They still have limitations that only native apps can provide (eg. SMS capabilities and accessing to the device contacts), even if there are different APIs that aim to solve these gaps, like Google Contact Picker API.
Most of the major apps till recent times was targeted towards countries having decent internet connections. With access to internet spiking in developing countries, most untapped market is coming to light. Though these parts have internet access now , the connectivity problems are plenty. So, to give the best experience for this new brand of customers, we need apps that can run offline
Offline First Approach :
This approach mostly caters to any device which can run offline until a reliable connection is interfaced. As developers , this would mean build the capabiltity to store information in the device through databases, caches or any other local storage approach.
And then when the user opens the app (desktop/mobile) , these run as normal as possible. Just give the user a heads-up that it is not in sync with the latest.
So, an offline first approach can be
Android native app with an offline capability
IOS App w/ offline features
Internet dependent Desktop app w/ offline support
WebApp w/ offline functionality : PWA is the latest
PWA (Progressive Web Apps) :
A PWA is a Web App which has the capability to run offline. With low cost devices (memory deficient, low processing power ) used by many of these users, it's imperative that people installing new native apps will reduce. Also, it's hard to convince people to download and install a new app.
That is where a Web app can be the game changer. A Progressive Web App which has native experience and offline capabilities could drive more users to try a new offering. Adding to that, without forcing a user to install one more app , a link can be easily marketed.
A Progressive Web App is a subset of the offline first approach. With browsers adding more capabilities to access native functions like Contacts as #Francesco pointed out , PWA might will be the first step towards modern app development to release any new feature.

Meteor API vs external API

Basically I want a real time application (Meteor) so I can see a real time dashboard
This back-end (Meteor server) would eventually be hit by some external application via API to get data from the DB (example: mobile App) or add some entries (not from the front-end)
My question is : What is better: create a Meteor API OR create an external server (ExpressJS) that would be connected to Meteor DB?
Meteor is great for building Full Stack apps (front end + back end), and has native support for MongoDB, which together are powerful for building real-time apps (using DDP for example) relatively easily.
Express is an MVC Framework built in Javascript and powered by Node. You will usually have to consider more technologies and frameworks when using Express (MEAN stack), which has a steeper learning curve when compared with Meteor.
Given that you're intending to develop a Full Stack app, building an API using Meteor is more straightforward. As suggested by Mikkel, restivus would be the Meteor package to consider for building your REST service.
If complexity is not a hurdle, using Express is likely to yield to a more efficient solution.
You can integrate express with Meteor - probably a better solution, because you only need one server.
There are Meteor packages for creating REST API's that work well https://atmospherejs.com/nimble
Another approach (my preference) would be to use GraphQL server with Meteor. Apollo Client and Server were developed by the Meteor Development Group (MDG) https://github.com/abhiaiyer91/sample-graphql-meteor-server

Architecture for an integrated offline windows + Web + android application with minimal duplicate effort

We are looking to develop an application wherein the requirement is such that we need some help on designing the architecture. I am putting down below the requirements of the application.
Brief Description
1) The application shall work on web + Android + Offline desktop version (Offline version meaning entirely offline environment wherein full functionality shall work without internet)
if possible offline android as well (which as per my research is difficult to do in same backend so caching can be used for temporary offline usage)
2) While designing the architecture we want to minimise the rework such that we shall be able to use the same Database, Logic code and Frontend as much as possible
3) Everytime application is updated then web and android will reflect it immediately due to API integration. And for offline application, we want to update the logic and database everytime it connects to internet.
Challenges I am facing
1) Database choice : Since it has to be an offline solution as well, I understand that we will have to use either SQLite or SQL compact edition so that we can use the free version and installation file is also not very big
2) Logic : Due to offline requirement, we may have to put entire logic in Asp.net / (any other suggestions) since stored procedures are not supported in above mentioned databases
Some links I found regarding this :
https://www.codeproject.com/Questions/346702/How-to-make-work-an-Online-Web-application-Offline
3) Application framework : Which framework MVC / MVVM etc would be suitable to minimise the work for web based and offline app.
4) Frontend : I understand that we will have to make different screens for web and android. However want to know whether we can use HTML 5 (cache feature) or Angular JS which can be used in offline environment as well or do we have to make offline screens seperately?
Build an ASP.Net web app with offline functionality
https://www.html5rocks.com/en/tutorials/appcache/beginner/
5) Can apache cordova be used in someway for better architecture (I dont know much about it hence)
6) I am sure I might be missing something. If you can offer some suggestion on best way to go about developing this application then will really appreciate your help
Your requirements are not very clear to me.
But if i have backend which is catering to multiple clients with different devices.
I will take the following strategy.
I will expose the backend functionality through rest/HTTP and let the clients consume them.
If i want to make the same UI and functionality and want to do it quickly for different mobile platforms. i will go for a Cordova,Phonegap or a Xamarin app. But keep it in mind that they lack some native functionality.
For web i will go with a UI framework which is device screen size responsive like like openUI5 ( i am sure there are dozen others ), such that an user can open the application in a web browser in any device and it gets rendered easily.
For Desktop based apps again i have to develop a separate UI. If you again have multiple flavors in Desktop application like Windows , Mac etc. You can take multiple strategies like Have a common Java layer + Minimal native layers for each OS or having full blown native layers or have the logic exposed as API in a low level language as C++ and then let high level languages consume them.
For all the apps you can use DBs like SQLite . Have the common DB and scripts ready which easily replicate the table structure for you.
Determination of a technology for the backend can be upto you (depending upon your requirements) and should not matter to clients if you expose your functionality in a restful manner.
Hope this helps.
Best Regards,
Saurav

Do I still need a backend like RoR or Django if I use Firebase?

I am a Front-end developer with limited backend knowledge.
My question is do I need other backend frameworks like Django or Ruby on Rails if I use Firebase as a backend? In other words, can I solely depend on Firebase as a backend and build a single page web application or Mobile application without writing a single line of backend code?
Thanks for your time viewing the question.
I was also looking for a platform to minimize server code and I found that firebase can help a lot.
You will get plenty of docs on net. You can start at angular fire + firebase doc
https://www.firebase.com/docs/web/libraries/angular/quickstart.html
Following document was helpful for me to design my app, which requires some amount of off-line processing too.
https://firebase.googleblog.com/2013/03/where-does-firebase-fit-in-your-app.html

Can Microsoft's Sync Framework work with .Net Membership/Roles, even through a web API?

We've got a .Net MVC/EF web application that is already in place with a client. The app was developed using .Net Membership and Roles for security/login. The app runs on tablet devices placed in the client's locations.
Now the client wants a different company to build a new UI for a portion of the site (not the whole thing), that has to integrate with our DB. This other company has been doing this type of work for a long time, so they've established how they operate, which is using a disconnected, distributed methodology to avoid Internet problems messing up an always-connected setup. Basically, they want each device to pull down only the segment of the DB that is relevant to the device's location and then sync it every two minutes through an API. The device will need to allow user logins.
So basically, we are being asked to adapt our web app/DB structure to accommodate this. And it boils down to 2 questions:
1) Since we are using .Net Membership and Roles, can we use the MS Sync Framework for syncing the DB of users (or at least, the ones relevant to the device's location)? I'm guessing the answer is yes because as long as the other party's UI is coded to utilize .Net Membership as well, the DB should be in the right format to read the data. I just want to confirm this is the case.
2) Can all the synchronization requests (up and down) be run through a web API that we write and expose to the devices? Since the UI is not going to be part of the code base, it needs to connect that way.
Thanks in advance!
1.Yes. from Sync Fx perspective, they're just tables.
2.Sync Fx out of the box doesnt work over http. You will in the documentation how to n-tier setup using WCF though. If you want Web API, you will have to code it as well.

Resources