Recent

Author Topic: Lazarus and web application  (Read 2994 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2257
    • Lazarus and Free Pascal italian community
Lazarus and web application
« on: December 22, 2023, 02:39:15 pm »
Good morning everyone, I created a small Git Hub project to demonstrate how to create an application based on http application that acts as a web server to manage the frontend part (kept external to the executable itself), so as to be able to intervene on the graphic part quickly , and integrates the backend so that it cannot be modified by those who do not have the source.

Currently only tested on Win 10. I hope it helps someone.
The frontend of the example is based on AdmiLte a bootstrap template. You can find more information on the blog of the Italian community (the article is in Italian, but you can easily translate it with Google Translator).

https://blog.lazaruspascal.it/2023/12/21/creare-una-web-application-con-lazarus/

I then tried to cross compile it for arm/android but the compilation fails because somewhere there is a reference to gtk3. If anyone could help me cross compile it for Android I would be grateful.

Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

tkay

  • Newbie
  • Posts: 1
Re: Lazarus and web application
« Reply #1 on: March 24, 2024, 08:25:40 pm »
This is a great example thank you.

ginoo

  • Full Member
  • ***
  • Posts: 113
Re: Lazarus and web application
« Reply #2 on: March 25, 2024, 08:13:43 am »
Thank you

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Lazarus and web application
« Reply #3 on: March 25, 2024, 09:09:30 am »
Thank you very much for the example xiniman.

Quote
I then tried to cross compile it for arm/android but the compilation fails because somewhere there is a reference to gtk3. If anyone could help me cross compile it for Android I would be grateful.
I just compiled your example (Linux) using the commandline compiler and there is no sign whatsoever of such dependencies.

Code: Bash  [Select][+][-]
  1. cd LazWebServer-main
  2. fpc -FEbin -Fusrc -Fusrc/jwt_unit -dUseCThreads -dSmartDebugLogWriteActive -B prj/lazwebserver.lpr
  3.  

I suspect it might be related to the android part of things. Are you able to paste some log that is able to show what exactly the compiler is looking for ?

I do not have a cross setup for android for this machine (sorry as I have no intention to do so either (*)) so you might perhaps have more luck with someone that is more versed in/with android.

(*) just discovered multipass  :) .

A perhaps possible solution for you:
- use FPCUpDeluxe to install (only) FPC 3.2.2 somewhere temporary (e.g. do not mix with your current setup unless you really want to)
- Use FPCUpDeluxe to to add an arm android cross-compiler
- download and extract (or clone) your project source-files
- cd LazWebServer-main
- /full/path/to/your/temporary/installed/FPCUpDeluxe/directory/fpc/bin/[x86_64-linux]/fpc.sh -FEbin -Fusrc -Fusrc/jwt_unit -dUseCThreads -dSmartDebugLogWriteActive -Parm -Tandroid -B prj/lazwebserver.lpr

The [x86_64-linux] part is specific to my host so might be different for you in case using another host OS.

Though I am not 100% sure about (your) ARM (target) options. Might be that there is need to specify some additional details (depending on your requirements).
« Last Edit: March 25, 2024, 09:57:51 am by TRon »
Today is tomorrow's yesterday.

irawan

  • New Member
  • *
  • Posts: 13
Re: Lazarus and web application
« Reply #4 on: May 09, 2024, 02:50:30 am »
this one just amazing.
(AdminLTE + Bootstrap + DataTable) serves management well.

 

TinyPortal © 2005-2018