Recent

Author Topic: Opinions on Fano Framework  (Read 2792 times)

kveroneau

  • Full Member
  • ***
  • Posts: 109
Opinions on Fano Framework
« on: September 20, 2021, 06:59:24 pm »
I just noticed a new web framework on the wiki when taking a look at the web programming pages there.  I did a search on the forums, but it doesn't seem that anybody is actually talking about it.  Is there a reason why?  Does anybody here use Fano and if so, what are your experiences with it?

At first glance, the Fano Framework website is very modern and professional.  However, it's not until you dive into some of the documentation that things got a bit more dire for me.  For example, the Hello World example I followed used the Fano CLI(which I assume is a new addition), this Hello World example was super limited in showing the actual framework and is more to show off the CLI.  Now, the other Hello World example doesn't use the Fano CLI, but instead does project creation and management from scratch, but shows how to use query parameters and even create a working view.  The Fano CLI Hello World should also go through the same steps of creating a controller to grab query parameters and the creation of the view.  That's all I'm saying.

Other parts of the documentation are also clearly unfinished making me believe that this framework was only just released within the last year or so.  Makes me wonder how production worthy this framework might actually be.  Has anybody fully tested this framework or built something using it?  If so, please share.  The Docker deployment page has a link, but the page itself is literally blank, which was both a tease and a disappointment.  Then when I saw a tutorial page for "CRUD" that got me excited for a very promising tutorial, then I was met with this disappointing page: https://fanoframework.github.io/tutorials/creating-crud-application/

I've only learned of Fano Framework's existence as of yesterday and actually lost sleep because I went to bed later as I was curious about it.  At first glance, it shows a lot of promise.  Has modern features that remind me of both Django and Ruby on Rails.  It seems like it has the potential to be a killer app for web development for ObjectPascal, but parts of the documentation make it seem unfinished.

Something else to note, which may not bother everyone, is that it lacks any Lazarus integration.  It's almost like the developer didn't even know of Lazarus' existence when building the framework, or just doesn't like Lazarus.  I like using Lazarus as an editor and project manager for any ObjectPascal program, as it has some really nice features that assist in developing applications.  I guess I could say that one of the driving forces for me using ObjectPascal is due to how well Lazarus works as an IDE for any application type, and not just LCL applications.  I use Lazarus extensively for packages, a huge library of common classes and methods I use in a lot of my projects uses a personal package I have.  It doesn't appear that Fano even ships an lpk file to assist with using it's framework within a Lazarus project.  It seems the developer really wants to push their Fano CLI, which isn't bad, reminds me of Django's "manage.py", but for ObjectPascal development, I guess I've just gotten so used to using Lazarus' project management features.  Technically, Fano CLI could manage a Lazarus project, which would allow a developer to open their project with ease in Lazarus for development, but still use the CLI to do specific things.  Maybe there is a command-line option for the Fano CLI to generate Lazarus project files, still didn't look at every option yet.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8386
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Opinions on Fano Framework
« Reply #1 on: September 21, 2021, 07:57:07 am »
The author is in this forum, feel free to contact him directly as I don't see him online here often.
To be fair, though, among all existing web frameworks, this one has the most documentation. Its CLI is indeed one of its main offering, to attract people with Yii, Laravel and Rails experience, among others. I'm not a fan of the code generator approach, as well as the convention where routing is put in a single file. I prefer fpWeb standard approach, where routes are in controller's unit initialization section but this is highly subjective.

kveroneau

  • Full Member
  • ***
  • Posts: 109
Re: Opinions on Fano Framework
« Reply #2 on: September 21, 2021, 06:03:32 pm »
Thank you for your response.  I have been seeing a lack of documentation for many FreePascal/Lazarus projects/packages unfortunately.  It has led me to reading the code to better understand how it works and what calls to make.  However, I am used to this.  Even when I was using Python full-time, although many projects are super well documented, I still found myself scanning through the code to better understand how it all works.  Also looking at other people's code can be very inspiring if written well.

However, the lack of documentation in these areas could be a valid reason why the ObjectPascal userbase hasn't really grown.  As not everybody is willing to deep dive into someone else source code to learn how stuff works, and would rather read a document from readthedocs.io instead.  I'm not really good at writing documentation, or I'd help out with this.  I do plan on starting a new blog soon, in similar vein to my older http://www.pythondiary.com/ blog I worked on when I was using mainly Python for everything.  The entire blog site was written from scratch using the Django framework, so it was a great way to also learn more about Django.  I am thinking of doing the same with my Pascal blog, where the blog itself is also entirely written entirely in Pascal to showcase the language while readers read about it.

Oh, and I do believe when I searched for Fano online, a post from your blog Pascal Warrior did come up in the results.  Pascal as a language does need more active blogs out in the wild to churn up more search results and to gain more interest in the language in general.

PierceNg

  • Full Member
  • ***
  • Posts: 133
Re: Opinions on Fano Framework
« Reply #3 on: September 22, 2021, 04:53:01 am »
I played with Fano a little. Below IMHO.

Fano first requires building a CLI tool.

The getting started page says "Fano Framework has no opinion about your project directory structure. You can structure your project directories and files the way you like. However, Fano CLI creates several files and directories that follows certain assumptions."

So Fano doesn't have an opinion on the folder structure. But Fano does have an opinion on the folder structure.

Getting started also requires setting up Apache, mod_Xcgi and root access for setting up virtual hosting. That's just too much to ask for up front. Who sets up CGI just to try things out these days?

CLI is good for showing off "go from git cloning this repo to having a running hello world web app in 1 min, with source code templates for routing, controllers, views, models and so on all set up". But the Apache requirements totally get in the way. The framework should just run a Pascal web server directly to serve the web app being built.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8386
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Opinions on Fano Framework
« Reply #4 on: September 22, 2021, 10:09:14 am »
So Fano doesn't have an opinion on the folder structure. But Fano does have an opinion on the folder structure.
The framework and CLI must always be clearly stated then. Although it's rather unconventional to have a framework without any particular structure.
Getting started also requires setting up Apache, mod_Xcgi and root access for setting up virtual hosting. That's just too much to ask for up front. Who sets up CGI just to try things out these days?

CLI is good for showing off "go from git cloning this repo to having a running hello world web app in 1 min, with source code templates for routing, controllers, views, models and so on all set up". But the Apache requirements totally get in the way. The framework should just run a Pascal web server directly to serve the web app being built.
Indeed, the fpWeb way of getting started is as simple as:
Code: Pascal  [Select][+][-]
  1. uses
  2.   httpdefs,
  3.   httproute,
  4.   fphttpapp;
  5.  
  6. procedure HelloHandler(ARequest: TRequest; AResponse: TResponse);
  7. begin
  8.   AResponse.Content := 'Hello, World';
  9. end;
  10.  
  11. begin
  12.   HTTPRouter.RegisterRoute('/', @HelloHandler);
  13.   Application.Initialize;
  14.   Application.Port := 9876;
  15.   Application.Run;
  16. end.
  17.  
then simply compile and run normally, nothing else necessary.

kveroneau

  • Full Member
  • ***
  • Posts: 109
Re: Opinions on Fano Framework
« Reply #5 on: September 22, 2021, 05:57:51 pm »
So Fano doesn't have an opinion on the folder structure. But Fano does have an opinion on the folder structure.
Maybe after the developer created the new CLI tool they forgot to update the documentation, or if you don't use the CLI then your folder structure can be whatever you choose?

Getting started also requires setting up Apache, mod_Xcgi and root access for setting up virtual hosting. That's just too much to ask for up front. Who sets up CGI just to try things out these days?

CLI is good for showing off "go from git cloning this repo to having a running hello world web app in 1 min, with source code templates for routing, controllers, views, models and so on all set up". But the Apache requirements totally get in the way. The framework should just run a Pascal web server directly to serve the web app being built.
Yes, this was my gripe as well when I went through the tutorial.  I ran it all inside an LXC container, so I wasn't too worried, but was still a bit struck by it.  It is kind of nice that it can auto-generate apache VirtualHost configuration like it does, making deploying to a server pretty easy, but running a deploy tool as root is never recommended.  I'd prefer it just spit out the config files to a build or output directory, then let me use whichever deployment tools I choose to put all the pieces together.  There's just a bit too much magic happening under the hood for comfort.

There is an empty page in the deployment section for Docker support, so I assume that once that support is ready, it will just create a Docker container with apache and everything inside.  Then just run the container to easily test without root/sudo access needed.  This does greatly limit development and testing to Linux however.  Docker on Windows and Mac are coming along I believe, but I mostly use Linux so I haven't seen what progress they made on those fronts.

devEric69

  • Hero Member
  • *****
  • Posts: 607
Re: Opinions on Fano Framework
« Reply #6 on: September 23, 2021, 09:07:41 am »
I've only learned of Fano Framework's existence as of yesterday and actually lost sleep because I went to bed later as I was curious about it. At first glance, it shows a lot of promise. Has modern features that remind me of both Django and Ruby on Rails. It seems like it has the potential to be a killer app for web development for ObjectPascal, but parts of the documentation make it seem unfinished.

I didn't know Fano. I've read. It's an interesting solution. Unfortunately, clearly, the documentation is not yet complete, which is a problem. Well, I hope its author will soon do the editorial work of writing the html code, in order to complete the synopsis pages of his online help.

However, the lack of documentation in these areas could be a valid reason why the ObjectPascal userbase hasn't really grown.  As not everybody is willing to deep dive into someone else source code to learn how stuff works, and would rather read a document from readthedocs.io instead.

This being said, really, the fpWeb framework documentation is very complete: take a look at https://wiki.freepascal.org/fpWeb_Tutorial .

Nevertheless, to be honest, the fpWeb's CRUD examples are buggy, too. Maybe\probably because the developers didn't resist the sirens of the too pretty ExtJS at the time (unfortunately, ExtJS doesn't version its javascript engines; we know that, now; it's not a blame: i've succumbed to the same sirens at the time; i.e. too much deporting of functionalities towards javascript), at the cost of the stability of an operational full server-side fpWeb CRUD example, AMHO.

The fpWeb CRUD examples worked, for sure (globally, with a html table producer, a html navigation producer i.e. an hypertext page numbering of the table at its bottom, the ability to edit a html table row, and then to post the modifications and display the modified table again): rustic but fully functional for small tables published on the internet.

Waiting for a sponsor\donor to offer a bounty in order to have a fully operational and working CRUD example inside fpWeb...

« Last Edit: September 23, 2021, 10:14:28 am by devEric69 »
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8386
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Opinions on Fano Framework
« Reply #7 on: September 23, 2021, 11:32:42 am »
Waiting for a sponsor\donor to offer a bounty in order to have a fully operational and working CRUD example inside fpWeb...
This is rather simple and indeed fpWeb isn't tied to any kind of CRUD mechanism, you're free to use whatever you want. Combining with SQLdb is straightforward.

devEric69

  • Hero Member
  • *****
  • Posts: 607
Re: Opinions on Fano Framework
« Reply #8 on: September 23, 2021, 12:22:54 pm »
Hello @Leledumbo,

It's maybe pretty straightforward. But the point is that the weblaz.lpk and weblazextra.lpk code source packages - containing the THTLMDatasetContentProducer, ... , i.e. the equivalent of Delphi's TDataSetProducer - and all the TClasses\objects implementing in Pascal the DOM-<html> tags, are present, written. But without any more minimalist working application in order to handle a visual CRUD example of a simple SQL table management on the internet. I'm just saying that it's a damage. To manage small SQL tables, there's no need with such javascript-side database engines to produce a weak html visual result, at the end.

Sorry for rambling, but Lazarus and its fpWeb framework doesn't provide - and no more than Fano - such a working RAD example of a database-oriented web CRUD. This comment is based on these 2 links (at least):
- https://forum.lazarus.freepascal.org/index.php/topic,16115.msg365313.html#msg365313
- https://forum.lazarus.freepascal.org/index.php/topic,7439.msg35484.html#msg35484

I know it's not complicated to debug (need just to drop the buggy units into a deprecated project's directory, and do a slight refactoring. But it would takes at least 1, 2 weeks. And like many others, I know Php very well and immediately; hence the fork to Php in such a use case).
« Last Edit: September 23, 2021, 12:45:09 pm by devEric69 »
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8386
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Opinions on Fano Framework
« Reply #9 on: September 28, 2021, 07:47:59 am »
It's maybe pretty straightforward. But the point is that the weblaz.lpk and weblazextra.lpk code source packages - containing the THTLMDatasetContentProducer, ... , i.e. the equivalent of Delphi's TDataSetProducer - and all the TClasses\objects implementing in Pascal the DOM-<html> tags, are present, written. But without any more minimalist working application in order to handle a visual CRUD example of a simple SQL table management on the internet. I'm just saying that it's a damage. To manage small SQL tables, there's no need with such javascript-side database engines to produce a weak html visual result, at the end.
AFAIR Michael as their author also didn't use them. I didn't remember the motivation to make them, but anyhow he's the same as me, we use fpWeb without any componentization, only pure hand coding. I'm not sure with the future of those, so maybe ask Michael?

zamronypj

  • Full Member
  • ***
  • Posts: 131
    • Fano Framework, Free Pascal web application framework
Re: Opinions on Fano Framework
« Reply #10 on: October 09, 2021, 04:53:57 am »
Thank you for feedback


Something else to note, which may not bother everyone, is that it lacks any Lazarus integration. 

I know Lazarus and support for Lazarus is planned. I just want it independent of IDE and can be built only from shell so that I can deploy it using CI tools such as Jenkins only with FPC.

Fano first requires building a CLI tool.

The getting started page says "Fano Framework has no opinion about your project directory structure. You can structure your project directories and files the way you like. However, Fano CLI creates several files and directories that follows certain assumptions."

So Fano doesn't have an opinion on the folder structure. But Fano does have an opinion on the folder structure.

Fano CLI is supplemental tool. It is not required by Fano Framework but it is recommended way to setup project.

If you use Fano CLI, it will generate certain project directory structures, such as config for storing application configuration files, storage directory for storing run-time dynamically generated files such as logs or session files.

If you do not use Fano CLI to setup application project, you are free to use any directory structure to organize where you store your controller files, views, logs, etc

if you don't use the CLI then your folder structure can be whatever you choose
Correct


Yes, this was my gripe as well when I went through the tutorial.  I ran it all inside an LXC container, so I wasn't too worried, but was still a bit struck by it.  It is kind of nice that it can auto-generate apache VirtualHost configuration like it does, making deploying to a server pretty easy, but running a deploy tool as root is never recommended.  I'd prefer it just spit out the config files to a build or output directory, then let me use whichever deployment tools I choose to put all the pieces together.  There's just a bit too much magic happening under the hood for comfort.


Deployment command in Fano CLI tool helps setup deployment during development. You need root privileges to modify Apache configuration just like when you do it manually.

If you just want generate virtual host configuration without actually modify apache configuration, use --stdout parameter which does not require root privileges. As explained in https://fanoframework.github.io/deployment/fastcgi/

If you do not trust magic under the hood, you can always inspect Fano CLI source code.

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

 

TinyPortal © 2005-2018