Recent

Author Topic: Moving a desktop application to the web  (Read 12418 times)

Luc

  • Jr. Member
  • **
  • Posts: 59
Moving a desktop application to the web
« on: March 03, 2019, 06:16:23 pm »
Hi,

I am looking for a way or another to move an existing windows app to the web.
I think we will all agree that Lazarus+FPC is really a great solution to build desktop applications, no doubt, but not so easy to use when it comes to mobile or web development.

I am currently using windows server in TS mode when I need multi-user access to my desktop application.

To avoid having to rewrite a large part of the application, I have been looking to cloud virtualization solutions:

https://cameyo.com/
A nice service using windows servers but rather slow and too expensive for my needs

https://www.rollapp.com/
Another great service. I think they run your app on linux in a Wine container if needed. I am waiting for further information

https://www.cybelesoft.com/thinfinity/virtualui/
Seems to work great with Lazarus but you need a windows server + CAL so this is also too expensive for my needs

https://guacamole.apache.org/
Was not able to have it running properly...

https://developer.gnome.org/gtk3/stable/gtk-broadway.html

As I was not fully satisfied with what I had found, I started to have a look at other solutions (the main goal is to keep as much as possible of the pascal code used by the application and libraries):

http://www.unigui.com/
Seems great but for Delphi and IIS only ?

https://www.elevatesoft.com
https://smartmobilestudio.com

https://www.tmssoftware.com
Officially, despite the use of Pas2JS, it is Delphi only for the moment


After having a look at what is ready at the moment, I don't think I would be able to use one of them and get the same functionalities I can achieve in a few clicks with Lazarus beacause they offer:

Only limited or very basic reporting capabilities (I use Fast Report Master/Detail, drill-down events in preview, custom components...etc),
Only Basic charting that doesn't match what you can do on desktop (complex layers and drill-down),
Only Basic grids or components,
etc...

I hope not to be the only one beeing an old school desktop programmer in need to move to the web, and whishing to keep the simplicity of app development he knows and appreciates...

I know there are a lot of efforts done with Pas2JS (it is moving really fast and looks very promising). Just for the ones who don't already know it, you can find some demos on the wiki and in the Pas2JS mailing list:

https://www.freepascal.org/~michael/pas2js/chartjs/index.html

Pas2JS clearly could be the winner but it needs to be connected to a backend service or app.
I wish I could be able to find a good tutorial, a real use case example with all the basic code one needs to implement a first application, including:
  • Best tool/editor to design the client UI. Does anybody could recommend a good UI editor we could use until the Lazarus one is ready?
  • Easiest way to deploy the app on the server (embedded, cgi, fast cgi) pro and cons?
  • Easiest way to debug the app
  • How to handle user session and security
  • How to exchange data from UI to/from backend
  • Recommanded backend frameworks : Mormot, Brook, fpWeb
  • How to secure the code if most of the application code is avaliable in the browser via JS
  • Some help on how to wrap an UI library

To summarize, some complete tutorials and examples to help building a first app with Pas2JS with an embeded or cgi backend would
I know there are top noch experts here who could create all this in a couple of hours, but I am not... so I can help testing and writing docs under the experts reviews...  :)

This is just my feeling for now.
Some will say I am mixing things up and I surely do, this is why some help will be welcome.
Believe me, I would really hope to find a good solution to develop web apps with Lazarus.
Win 11 ARM (Running in Parallel VM - Mac OSX) - Lazarus 2.2.6 - i386-win32/win64

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Moving a desktop application to the web
« Reply #1 on: March 03, 2019, 08:03:02 pm »
I believe someday it would be possible to have a widgetset for the web, using whatever available JS toolkit and of course Pas2JS. But indeed for now, your choice is very limited.
Best tool/editor to design the client UI. Does anybody could recommend a good UI editor we could use until the Lazarus one is ready?
All of my web apps are handcoded, including the UI (even this one is not my specialty, we have a frontend team for this matter).
Easiest way to deploy the app on the server (embedded, cgi, fast cgi) pro and cons?
Deploying is as easy as copying the binary then restart the app (there are 0 downtime deployment techniques, but they're out of the scope of my answer), provided you have everything else set up (e.g. a dedicated webserver for reverse proxy if you use embedded server).
Easiest way to debug the app
Use embedded server, it's no different that usual executable.
How to handle user session and security
This is left out to framework of choice, for fpWeb, read my tutorial.
How to exchange data from UI to/from backend
Read and understand how HTTP works.
Recommanded backend frameworks : Mormot, Brook, fpWeb
For now, I stick to fpWeb. But it's a choice, you make your own after trying each.
How to secure the code if most of the application code is avaliable in the browser via JS
Something is wrong at design level if that's what happened. Most (business logic) code should be in backend (with Pas2JS or fpWeb, it's the same), frontend should only serves as UI and bridge, even if it has its own logic but it's still frontend logic, not business one.
Some help on how to wrap an UI library
I believe somebody has just wrapped a JS library for Pas2JS. I haven't, so I can't really comment on this.

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: Moving a desktop application to the web
« Reply #2 on: March 03, 2019, 08:10:42 pm »
Feeling the same troubles, searching for same.
To add some cloud options to your list:
https://www.apponfly.com/en/
https://fra.me/

Luc

  • Jr. Member
  • **
  • Posts: 59
Re: Moving a desktop application to the web
« Reply #3 on: March 04, 2019, 08:55:05 am »
@Leledumbo

As always, you provide detailled and useful information. I have read your fpWeb tutorial last week. Nicely written.

I will give a try for embedded server and will study the reverse proxy need for this kind of application. (Currently, I use lazarus exe on client side, synapse, threads and apache + php on server side, yes I know not the perfect stack for a fpc user...)

http://wiki.freepascal.org/pas2js_widgetsets
I didn't find any "one click demo" here: could it be possible for the widgetsets developpers/fpc team to put some online demo?

For example, but not related to fpc:
http://banano.tuebben.de/kendoui/demo/

I wish I could find an overall picture of what can be done with FPC/Lazarus for the web and the best pratice. Not that I think for myself here, but this will surely boost Lazarus/fpc attractivity: You have 30sec? We are going to show you that Lazarus rocks to write web apps! Click here!

I guess I will have to do my homework first and discover by myself.  :D

« Last Edit: March 04, 2019, 09:07:50 am by Luc »
Win 11 ARM (Running in Parallel VM - Mac OSX) - Lazarus 2.2.6 - i386-win32/win64

Luc

  • Jr. Member
  • **
  • Posts: 59
Re: Moving a desktop application to the web
« Reply #4 on: March 04, 2019, 09:03:09 am »
@Tatamata,

Thanks, I didn't know about them.

Their prices are quite high too and you need high speed connection to really use this kind of services, but with the 5G coming sooner or later, this could be the futur for client/server apps, don't you think ?
« Last Edit: March 04, 2019, 09:09:03 am by Luc »
Win 11 ARM (Running in Parallel VM - Mac OSX) - Lazarus 2.2.6 - i386-win32/win64

nouzi

  • Sr. Member
  • ****
  • Posts: 296
My English is  bad
Lazarus last version free pascal last version
Lazarus trunk  free pascal trunk 
System : Linux mint  64bit  Windows 7 64bit

Luc

  • Jr. Member
  • **
  • Posts: 59
Re: Moving a desktop application to the web
« Reply #6 on: March 06, 2019, 10:30:14 am »
Thanks Nouzi,

I will have a look. ExtJS is quite old and I am not sure about the Sencha License...

Win 11 ARM (Running in Parallel VM - Mac OSX) - Lazarus 2.2.6 - i386-win32/win64

dinmil

  • New Member
  • *
  • Posts: 45
Re: Moving a desktop application to the web
« Reply #7 on: March 06, 2019, 11:21:47 am »
Maybe this solution

http://zebkit.org/

Normal GUI Components in HTML5 Canvas.

ps

  • Full Member
  • ***
  • Posts: 136
    • CSS
Re: Moving a desktop application to the web
« Reply #8 on: March 06, 2019, 11:44:04 am »
Only limited or very basic reporting capabilities (I use Fast Report Master/Detail, drill-down events in preview, custom components...etc),
Only Basic charting that doesn't match what you can do on desktop (complex layers and drill-down),
Only Basic grids or components,
etc...

I hope not to be the only one beeing an old school desktop programmer in need to move to the web, and whishing to keep the simplicity of app development he knows and appreciates...
Why not move your app to "cloud" instead of web? First you need server API and in next step you can think about UI (web or/and native or/and mobile).  Many modern services have native desktop client in present days (mainly build with Electron).
Small simple CSS/box model implementation: https://github.com/pst2d/csscontrols/tree/dev

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: Moving a desktop application to the web
« Reply #9 on: March 06, 2019, 10:10:57 pm »
Does anybody know whether TMS Web Core (https://www.tmssoftware.com/site/products.asp?t=web) is supported for Lazarus and CodeTyphon?
In the TMS Web Core docs (http://www.tmssoftware.biz/download/manuals/TMSWEBCoreDevGuide.pdf) there is no mention of the Lazarus.
Is there anybody on this forum to share his experience with the TMS Web Core commercial package?

berocoder

  • Newbie
  • Posts: 4
Re: Moving a desktop application to the web
« Reply #10 on: January 25, 2021, 11:18:07 am »
I believe Quartex Pascal https://jonlennartaasenden.wordpress.com/category/quartex-pascal/ is the best solution to webify your Delphi applications.

The author Jon Aasanden is an old democoder. it means that he is passionate about performance. No compromises. It is fast!
If you have good separation in you app between GUI and logic you should be able to move logic as is and just rewrite GUI for the web. It is the cleanest solution.

Unfortunately Quartex Pascal is not ready for release yet but Jon publish updates every day in the closed facebookgroup. It should be ready soon. It is free for opensource and hobby projects. For commercial applications the price is $300.

A long presentation about the project from Jon.
https://youtu.be/sBoPScUDt30
« Last Edit: January 25, 2021, 11:20:30 am by berocoder »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Moving a desktop application to the web
« Reply #11 on: January 25, 2021, 12:38:33 pm »
Does anybody know whether TMS Web Core (https://www.tmssoftware.com/site/products.asp?t=web) is supported for Lazarus and CodeTyphon?
In the TMS Web Core docs (http://www.tmssoftware.biz/download/manuals/TMSWEBCoreDevGuide.pdf) there is no mention of the Lazarus.
Is there anybody on this forum to share his experience with the TMS Web Core commercial package?
Enjoy:

Blade

  • Full Member
  • ***
  • Posts: 177
Re: Moving a desktop application to the web
« Reply #12 on: April 04, 2021, 07:50:13 am »
I think the FreePascal/Lazarus answer for most people would be pas2js (https://wiki.lazarus.freepascal.org/pas2js) and then Lazarus Widgetset (to have the LCL on the web), which is also something more in line with open-source. 

Appears to me that most would want to port over an app or create HTML client apps, where they can utilize their existing Object Pascal code or skill, and shortcut bypass CSS, HTML, and JavaScript as much as possible (or just sprinkle some in when needed).  Also, HTML client apps can be a lightweight shortcut around getting deep into Android and iOS development.

Sadly progress seems quite slow.  Looks like maybe a call has go out to those with that skill to be volunteer developers or some type of bounty.
« Last Edit: April 07, 2021, 04:11:30 am by Blade »

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Moving a desktop application to the web
« Reply #13 on: April 04, 2021, 10:43:11 pm »
You may try RDW (REST Dataware Component Suite):

REST Dataware and you, get to the clouds effortlessly and with peace of mind
https://forum.lazarus.freepascal.org/index.php?topic=47141.0

REST Dataware Componentes
https://sourceforge.net/p/rest-dataware-componentes/activity/?page=0&limit=100#606653b88cdbb33f113e6e42

Projeto Rest Dataware
https://www.restdw.com.br/
https://cursos.projetorestdataware.com.br/

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Moving a desktop application to the web
« Reply #14 on: April 05, 2021, 01:05:22 am »
Many years ago I wrote and maintained a series of tax calculators in Delphi 1 for a legal publishing company to replace 100s of pages of tax tables. In 1994 we were moving from print products (typeset pages stuck down on boards with wax) to CD-ROM products (encrypted SGML content rendered by DynaText). Later in 1999 we were expanding to the web (encrypted SGML content rendered by DynaWeb) and I used the new Delphi 5 WebBroker to turn my desktop programs into ISAPI DLLs for a Windows IIS server (the actual web products ran under Dynaweb on a Sun Solaris UNIX server with links to IIS for the calculators). The conversion was a fairly trivial exercise, as I recall, simply replacing the GUI with generated HTML.
« Last Edit: April 07, 2021, 02:40:36 am by trev »

 

TinyPortal © 2005-2018