architecting Desktop app plus Web app

Dear xojo experts,

I’m looking for some suggestions of possible best-practices and design ideas for marrying a Web app and a device with a Desktop app.

The Desktop is really an embedded device with an internet connection. The device (xojo) app manages some local activity (motor control, GUI, and local device hardware stuff), and I want to expose some of the functions to a Web app, for giving a remote GUI to an operator via a browser.

The Web app doesn’t need to be hosted on the device - but the device needs to somehow exchange messages with the Web app.

Are there any good service(s) to run in xojo on the device, for pushing/pulling data from a remotely hosted Web app?

In a perfect world the end-user would plug the device into an internet connection, the embedded app would securely search for and connect to a hosted solution. The Web app would connect to the same hosted solution, which would bridge the communications.

I’m just fishing for some good Web Services functions that might be new and improved in xojo that I should research.

Thanks for any suggestions!

Hi William,

We have an app that we are going to start working on with similar requirements, but no local controls. I’m thinking web services might be the best solution for our app that could be utilized by other web apps and even the desktop app. I haven’t done anything like this before so hopefully someone else will be able to chime in on this.

In my search for answers, I found this post .

I hope this helps.

Tim

Hi,

I’m far from being a Xojo expert but, maybe you will find some useful information in how we managed to make a similar setup as yours. By the way, if anyone reading this post has any advice, they are welcome.

We developed a platform for wind turbine blades maintenance. The platform objective is to simplify the inspection/repair process by facilitating data collection, work management and by building an asset history. It is a data management system. The main components of the platform are :

  • Servers
  • Database
  • Web App
  • Mobile App
  • Desktop App
  • APIs

Web, mobile and desktop apps are tightly integrated and all need to access the main database to work.

SERVERS

Since we are more familiar with the Windows environment, we use Windows cloud servers to host the database and the software. Speaking of database, we started with MySQL but rapidly switched to PostgreSQL. It works very well and is fairly easy to maintain. We actually use two servers. One exclusively for the database the other for the applications and storage (mainly pictures).

Server One : Database server
Not much to say. The database server is “theoretically” isolated. It was only accessed by the software installed on server “One” but, since the addition of the desktop app, we broke that rule. The final design will fix that. Only a couple of open ports for RDP, database (only from server Two), and IP address based restricted access for desktop app users. We will get rid of the latter once the API for the desktop app is ready.

Server Two : Applications And Data Storage Server
We have several applications, all web apps running as Services on their own specific port.

  • loggin page (Xojo web app)
  • core web application (Xojo web app)
  • report generator (Xojo web app with wordautomation and MBS zip plugins)
  • data exporter(Xojo web app with wordautomation and MBS zip plugins)
  • RESTful API for mobile-database synchronization (Xojo web app)

DATABASE

As mentioned earlier, we use PostgreSQL (V10.x). We like it a lot and just wish that the XOJO PostgreSQL plugin would allow to move more freely through a recordset… It is on a server on its own, to maximize performance and security. It needs quite a lot of power to be as reactive as we want it to be.

APPLICATIONS

Web app
The main application is a web app made with Xojo ( using plugins from “Bikini” Softwares and GraffitiSuite ). It accesses the database directly. It only interacts with the report generator and the data exporter.

Mobile app
The mobile app is an “Hybrid Application” developed with the Ionic Framework. The first iteration of the mobile app was made with Xojo but we absolutely needed to supply an Android version so we switched to an open source framework. I’d prefer having 2 distinct native apps but it remains an acceptable compromise. It interacts with the database and the server for data synchronization through a specific API (Xojo web app).

Desktop app
This is our latest creation. It is used to integrate external data into the platform. Since it mainly deals with Hi-Res pictures, Its functionalities couldn’t be managed by the web application. The “problem” is that, like the mobile app, it needs an API to interact with the database if you don’t keep the doors wide open. It does a lot more complex stuff that the mobile app, thus the API will necessitate more time to develop and maintain.

APIs
The report generator and the data exporter receive requests from the web app. They use the parameters sent to execute the user request. We verify user authentification for each request.

The mobile API receives POSTs (JSON strings and files) from the mobile app and responds with JSON strings.

This is the structure we adopted. It works quite well. It is a lot of work to maintain since we are bringing regularly new features. Besides that, the system, once stabilized, happens to be very reliable and stable, thanks to the support of the Xojo community…

Don’t hesitate if I can be of any help.

Tim, thanks for the response - I look forward to posting and journaling any good material I come across in hopes of helping others, but mostly myself :wink:

Roger, double-thanks! Your overview is likely to save me a zillion hours of discovery - I’ll be certain to look up the plethora of plug-ins, add-ins, and frameworks you mentioned - it’s very likely I’ll be fast forwarding my design based on these.

Thanks to everyone for their contributions!