Recent

Author Topic: Recomendations for converting an LCL app to a web based front end  (Read 1811 times)

kompustelnik

  • Newbie
  • Posts: 4
Re: Recomendations for converting an LCL app to a web based front end
« Reply #15 on: December 14, 2025, 02:34:11 pm »
It is windows only framework ?? Why so ?

Yeah, but you can develop your webapp under Linux in Lazarus and once you compile it you can run the webapp server through WINE.
I did it on Oracle Free Tier VPS (1GB RAM, Ubuntu 22.04 LTS, console only, no desktop) and it works perfectly  8)

There is D2Docker also, but I didn't touched it yet.
Hello, can you explain how do it?
/BlueIcaro

Yeah, it's a bit tricky (Oracle Console >:( )

So, first of all you need to create account on Oracle Free Tier. Then setup your first VPS - Open side menu (left top corner) - Compute -> Instances -> Create Instance
I choose Canonical Ubuntu 22.04 LTS. Then create and save SSH key files (you need it to connect to your VPS through bash console).

Then create Security list - Compute - Instances -> YOUR INSTANCE -> Networking -> Subnet -> Security -> YOUR SECURITY LIST -> Security Rules -> Add Ingress Rules:
Quote
Source type: CIDR
Source CIDR: 0.0.0.0/0
IP Protocol: TCP
Source Port Range: Empty
Destination Port Range: 8888 (Your D2Bridge Web App Port - Default is 8888)

Once you done it log in to your VPS through the terminal:
Quote
ssh -i /home/YOUR_USER/YOUR_NEW_VPS_SSH_KEY_DIR/KEY_NAME_prv.key ubuntu@YOUR_VPS_PUBLIC_IP (Compute->Instances->Public IP)
ex. ssh -i /home/kompustelnik/Documents/MyOracleVPS_prv.key ubuntu@127.0.0.1

sudo apt update && sudo apt upgrade -y

then you have to install wine:
Quote
sudo apt install wine 
sudo apt install wine32

Copy your D2Bridge Project (Web Folder) with all files.
Quote
ex. scp -i /home/kompustelnik/Documents/MyOracleVPS_prv.key -r Web ubuntu@127.0.0.1/home/ubuntu/Web
(Specify your ssh key and your VPS IP)

Last thing you have to do is to run your web app through wine.
Log in to your VPS through terminal:
Quote
ex. ssh -i /home/kompustelnik/Documents/MyOracleVPS_prv.key ubuntu@127.0.0.1
(Specify your ssh key and your VPS IP)

cd Web
wine YOUR_WEB_APP_NAME.exe

That's all.....  8-)
Try to connect from your phone/laptop, put in your browser address "YOUR_INSTANCE_PUBLIC_IP:8888"  :D

I know, the instance configuration on Oracle Free Tier may be a bit confusing, but it's not impossible (I'm a gamedev hobbyist, not engineer  ;) ), I believe you'll succeed.
Forgive me my "perfect" english ;)  ::)

Example:
http://152.67.132.56:8888/
(available for about 2 hrs since 14:40 CET Poland)

PS.
I made an Online Score server in Lazarus (server web app) for my game made with Godot.
It stores players scores in SQLite db. Communication over REST API.
The game server web app is running on my Oracle VPS too (autorun through systemd).
Please give me your feedback about the game:
https://woofitgames.itch.io/solar-lander
It's free to play, but you can donate if you have fun or you feel my "tutorial" about D2Bridge + VPS was helpful in any case... :P

PS2. The game is only for hardcore players, the controls are intentionally difficult, but manageable. I’ve completed this little game many times.
« Last Edit: December 14, 2025, 02:54:59 pm by kompustelnik »

BlueIcaro

  • Hero Member
  • *****
  • Posts: 832
    • Blog personal
Re: Recomendations for converting an LCL app to a web based front end
« Reply #16 on: December 14, 2025, 04:44:57 pm »
Thanks !!
/BlueIcaro

egsuh

  • Hero Member
  • *****
  • Posts: 1729
Re: Recomendations for converting an LCL app to a web based front end
« Reply #17 on: December 15, 2025, 04:39:30 am »
Quote
Check out D2Bridge - https://www.d2bridge.com.br/
I think this is what you're looking for  8)

Does the recent version of it support Lazarus, not only Delphi?
Once I tried this, but not successful to make a running example.

kompustelnik

  • Newbie
  • Posts: 4
Re: Recomendations for converting an LCL app to a web based front end
« Reply #18 on: December 15, 2025, 11:20:05 am »
Quote
Check out D2Bridge - https://www.d2bridge.com.br/
I think this is what you're looking for  8)

Does the recent version of it support Lazarus, not only Delphi?
Once I tried this, but not successful to make a running example.

Yes :)

Although the D2Bridge installation wizard is only available for Windows, but there is a trick to develop your web app on Linux (Xubuntu 24.04 LTS in my case) with Lazarus + D2Bridge.
Steam proton (force compatibility through Proton Experimental works for me) is the way.

BTW. I see that not everyone knows- D2Bridge is available for everyone on GIT, everyone can contribute.
https://github.com/d2bridge/d2bridgeframework

 

TinyPortal © 2005-2018