Recent

Author Topic: How to convert a desktop app into a web app?  (Read 14043 times)

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
How to convert a desktop app into a web app?
« on: July 25, 2018, 08:58:20 am »
A have never done any web application, so please excuse me if my question is stupid,
is there a simple way to convert a Lazarus desktop application into a web application?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: How to convert a desktop app into a web app?
« Reply #1 on: July 25, 2018, 10:11:38 am »
Other than approach through a webbased terminal server: no.

it sounds like you have a lot of reading to do.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: How to convert a desktop app into a web app?
« Reply #2 on: July 25, 2018, 09:01:24 pm »
A have never done any web application, so please excuse me if my question is stupid,
is there a simple way to convert a Lazarus desktop application into a web application?
None that I know.
Take a look on these videos to have an idea of what a web application might be:
HTML 5, CSS 3, PHP , Jquery, Ajax website design (E.commerce) - Younes RM
https://www.youtube.com/playlist?list=PLQsP7Ksoaqq1JZQqd3K2O5a5ic9R5TUQq

There are many languages, frameworks and technologies you could choose from, including Pascal CGIs:
CGI (Common Gateway Interface).
https://en.wikipedia.org/wiki/Common_Gateway_Interface

Object Pascal para Web - aula 00 - Zendrael
https://www.youtube.com/watch?v=wRRDjQk9kjM

Formulario de cadastro simples para web com Lazarus e fcl-Web - ANDERSON JUNIOR GADO DA SILVA
https://www.youtube.com/watch?v=iZNx-44Rtn8

I have been consulting for teams that develop only desktop, desktop + web, desktop + mobile, desktop + web + mobile. And teams that decided to migrate from desktop to web, to mobile, and to web + mobile.
It's not easy at all. It demands a lot of hard work keeping everything fast, UX and UI high quality, integrated and making sense.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: How to convert a desktop app into a web app?
« Reply #3 on: July 25, 2018, 09:07:34 pm »
Some extra information just in case you decide to keep Pascal for everything:
FCGI (FastCGI) step by step, using fpweb/fcl-web for Windows/Linux
https://forum.lazarus.freepascal.org/index.php/topic,13312.0.html

soerensen3

  • Full Member
  • ***
  • Posts: 213
Re: How to convert a desktop app into a web app?
« Reply #4 on: July 26, 2018, 12:00:40 am »
What exactly do you mean by web application? Web application can be an application that is run on the server as a service or on demand like php. A web application can also be a desktop application that is run on the client only (usually in a browser or a plugin). If not for the plugin it is usually a website that uses java script so you have to convert your project to java script. Where probably pas2js is your best choice but there might be other ways. Don't expect your application to just work out of the box. The interface of a website is usually very different from a desktop application.
There was another thread about using electron (A JS framework for a user interface) with lazarus I think.
In theory you can even generate java byte code with fpc but I only read that and I don't know the status of that. However the browser must allow to call jar files and java vm must be installed on the client. If you want to address a big mass of users this is probably not a good idea.
Lazarus 1.9 with FPC 3.0.4
Target: Manjaro Linux 64 Bit (4.9.68-1-MANJARO)

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: How to convert a desktop app into a web app?
« Reply #5 on: July 26, 2018, 12:05:21 am »
You can! But you need to learn new stuff. There is no automatic conversion. Basically you can port your application but not convert.

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: How to convert a desktop app into a web app?
« Reply #6 on: July 26, 2018, 05:11:13 pm »
The question is natural as we all need to build applications for desktop, web and mobile. And it would be really nice to keep just one code for all those targets. But the ultimate solution to build such universal application is not easy task and it would take lots of time to develop. There are many differences between platforms and such framework would need to generalize and abstract from all of them. For example LCL would need a new widgetset which would be web server generating HTML, CSS and Javascript. Not all components would be fully supported. Also classic desktop applications are designed as single user, while web applications are designed as multi-user and client-server connection needs to be basically stateless and state needs to be kept using cookies and other means. But it should be feasible. There are some solutions like https://www.xojo.com/ which tries to target Desktop, mobile and web. I would like to see FPC/Lazarus moving in similar direction. But there aren't enough programmers to work on this huge task. Lazarus/FPC can't even simply target Android and iOS mobile platforms. So for the web we need to implement own CGI or web server without any web page design-time support from IDE.

So for now, no, you can't simply convert Lazarus desktop application to web application.

tatamata

  • Hero Member
  • *****
  • Posts: 787
    • ZMSQL - SQL enhanced in-memory database
Re: How to convert a desktop app into a web app?
« Reply #7 on: July 27, 2018, 07:30:09 am »
Thank you all for answers.
Is there any way to embed a Lazarus desktop app into a simple web app, so that it appears as if it was a web app?
Or some kind of application virtualization that can expose a desktop application via internet?

fred

  • Full Member
  • ***
  • Posts: 201
Re: How to convert a desktop app into a web app?
« Reply #8 on: July 27, 2018, 09:19:11 am »
This is for Delphi to change from desktop to web with one line they say, Thinfinity VirtualUI.
I do not have a recent Delphi so can't test it.
I think they create a virtual desktop on a server which you can access.
Would be nice for Lazarus...

https://www.cybelesoft.com/delphi-web/

sash

  • Sr. Member
  • ****
  • Posts: 366
Re: How to convert a desktop app into a web app?
« Reply #9 on: July 30, 2018, 12:19:31 am »
expose a desktop application via internet?

In my time they called it "download link". :D
Ok, RDP server will work too.
Lazarus 2.0.10 FPC 3.2.0 x86_64-linux-gtk2 @ Ubuntu 20.04 XFCE

egsuh

  • Hero Member
  • *****
  • Posts: 1273
Re: How to convert a desktop app into a web app?
« Reply #10 on: July 30, 2018, 07:56:32 am »
ActiveX would have been the nearest.  But probably only within Internet Explorer. I'm not sure whether it is still supported.

If you want your application to communicate to webserver, it is possible via webservice.

marioluna

  • Newbie
  • Posts: 1
Re: How to convert a desktop app into a web app?
« Reply #11 on: May 29, 2019, 03:52:47 pm »
This is for Delphi to change from desktop to web with one line they say, Thinfinity VirtualUI.
https://www.cybelesoft.com/delphi-web/

Hi Fred! You happened to land on the Delphi page, but VirtualUI can conver almost any PC-based app into HTML5 to be served on a web browser.

Here you have the tutorial page that lists many examples, including a Lazarus one:

https://www.cybelesoft.com/thinfinity/virtualui/tutorials/

fred

  • Full Member
  • ***
  • Posts: 201
Re: How to convert a desktop app into a web app?
« Reply #12 on: June 03, 2019, 12:26:26 pm »
Yes I see it now, thank you.
Sadly at my work they started using M$ PowerApps...

zamronypj

  • Full Member
  • ***
  • Posts: 133
    • Fano Framework, Free Pascal web application framework
Re: How to convert a desktop app into a web app?
« Reply #13 on: August 12, 2019, 04:09:15 am »
Converting desktop application into web application is not an easy task. It may require a complete redesign.

If the goal is just to be able to run desktop application over network, you can try running application over virtual desktop infrastructure, such as Citrix, which allow users to remotely access a desktop application on other remote machine from a web browser. It will be much slower but it works.
« Last Edit: August 12, 2019, 07:29:22 am by zamronypj »
Fano Framework, Free Pascal web application framework https://fanoframework.github.io
Apache module executes Pascal program like scripting language https://zamronypj.github.io/mod_pascal/
Github https://github.com/zamronypj

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: How to convert a desktop app into a web app?
« Reply #14 on: August 12, 2019, 04:17:57 am »
A have never done any web application, so please excuse me if my question is stupid,
is there a simple way to convert a Lazarus desktop application into a web application?


As long as the following is part of the requirement, I'm going to say that the most accurate answer is "NO"


--- "a simple way to convert"


Moving away from the theoretical, it really depends on what the app does today, and what technologies it uses.  But there is no easy way to simply convert apps from one modality to another (certainly not both easy and inexpensive) unless they were designed to be in both modalities.

-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

 

TinyPortal © 2005-2018