* * *

Author Topic: The Brooks Framework  (Read 3263 times)

RedOctober

  • Full Member
  • ***
  • Posts: 218
The Brooks Framework
« on: May 25, 2018, 09:36:31 pm »
I'm looking to build my next web-app using the Brook Framework, but the documentation site is unreachable. 
I'd like the official "Getting Started" documents to start reading up how to use it.
I have already installed the latest Brook framework (2018-May-09 version) using the Online Package Manager just a few minutes ago.

https://brookframework.org/doc/index.html

I can only find really old posts by Silvio Clécio in the forum.

Zoran

  • Hero Member
  • *****
  • Posts: 1246
    • http://wiki.lazarus.freepascal.org/User:Zoran

RedOctober

  • Full Member
  • ***
  • Posts: 218
Re: The Brooks Framework
« Reply #2 on: May 26, 2018, 01:24:37 am »
Hi Zoran, thanks.  I now have the reference docs.  I'm wondering if there is a "How to get started" book somewhere, especially for the most recent stable version (3.9.9). 

Platform:  Windows Server 2016 Essentials, Lazarus 1.8.2, FPC 3.0.4

I was able to load the chat demo, I click Run and a window quickly flashes and disappears before I can read it.  Not sure what is wrong, or where to go next. 

Also, I need Brook to connect to the Firebird RDBMS.  Does anyone know if that's possible? 
« Last Edit: May 26, 2018, 01:28:46 am by RedOctober »

valdir.marcos

  • Hero Member
  • *****
  • Posts: 508
Re: The Brooks Framework
« Reply #3 on: May 26, 2018, 06:27:07 am »

Leledumbo

  • Hero Member
  • *****
  • Posts: 7953
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: The Brooks Framework
« Reply #4 on: May 26, 2018, 04:11:39 pm »
Also, I need Brook to connect to the Firebird RDBMS.  Does anyone know if that's possible?
Brook is not tied to any DB libraries nor it has its own. You are free to use anything that can connect to any DBMS. Well, Silvio did develop the now abandoned dOPF (but I still use and extend it) which is a little OPF with SQLdb backend (but the structure should allow you to write another backend) so you might want to use that. Using SQLdb directly is also possible, you just need to do it by hand instead of drag n drop-ing component.

RedOctober

  • Full Member
  • ***
  • Posts: 218
Re: The Brooks Framework
« Reply #5 on: May 27, 2018, 12:08:21 am »
Hi valdir.marcos. The link https://brookframework.org/  is dead.  It shd be removed from the Firebird web page.

Hi Leledumbo.  I don't know what a "OPF" is.  Once some one gets me a "How to get started" document, then I'll be back to ask you more.

Does anyone use Brook? Seems like it's been abandoned.  Version 4 is supposed to come out some time, but it's been 4 years since the announcement was made.  I'm kind of hesitant to use something that's been abandoned and hardly anyone is using it, no matter how good it is.

Leledumbo

  • Hero Member
  • *****
  • Posts: 7953
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: The Brooks Framework
« Reply #6 on: May 27, 2018, 12:30:43 am »
Hi Leledumbo.  I don't know what a "OPF" is.  Once some one gets me a "How to get started" document, then I'll be back to ask you more.
Google: Object Persistence Framework. Can be somewhat interchanged with Object Relational Mapping, though they're complementing each other conceptually.
Does anyone use Brook? Seems like it's been abandoned.  Version 4 is supposed to come out some time, but it's been 4 years since the announcement was made.  I'm kind of hesitant to use something that's been abandoned and hardly anyone is using it, no matter how good it is.
I do, version 3 though as I don't want to use C library in my code. But I might port the code to latest fpWeb, since the routing is no longer as overly complicated as it was. In fact, Brook 3 layer (on top of fcl-web) looks thicker than fpWeb now. No change to dOPF, though, as I haven't found a free open source replacement that's as easy to use nor I have successfully written my own.

dbannon

  • Sr. Member
  • ****
  • Posts: 302
Re: The Brooks Framework
« Reply #7 on: May 27, 2018, 04:44:32 am »
... Brooks...... But I might port the code to latest fpWeb, ....

OK, now you have mentioned Brooks and fpWeb in the same message. For some time I have been thinking I need to look at these packages. However, neither appear to have any authentication model build it. Is that because its not possible/practical, no one has bothered yet or is authentication (and authorization) more appropriately done at another level ?

Davo

(Sorry for hijacking your thread redoctober)
Lazarus 1.8, Linux (and reluctantly Win10, OSX)

Leledumbo

  • Hero Member
  • *****
  • Posts: 7953
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: The Brooks Framework
« Reply #8 on: May 27, 2018, 06:06:37 am »
However, neither appear to have any authentication model build it. Is that because its not possible/practical, no one has bothered yet or is authentication (and authorization) more appropriately done at another level ?
Both are thin framework on top of fcl-web libraries, in the sense that neither has other facilities other than routing handler. fcl-web is, however, is a lot richer. It has libraries for JWT, OAuth 2, HTTP/2, JSON-RPC, etc. It's just they come only with examples, no documentation.

dbannon

  • Sr. Member
  • ****
  • Posts: 302
Re: The Brooks Framework
« Reply #9 on: May 27, 2018, 06:28:07 am »
OK, thanks for that Leledumbo, I did not pick up fcl-web coud do, eg OAuth2. I had looked through your PDF and browsed the Laz examples dir. Where should I look for the fcl-web examples ?

(I take a lot of notes while writing so, sometimes, those notes can form a start of some documentation....)

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)

Leledumbo

  • Hero Member
  • *****
  • Posts: 7953
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: The Brooks Framework
« Reply #10 on: May 27, 2018, 10:52:39 am »
Where should I look for the fcl-web examples ?
In the source code folder.

dbannon

  • Sr. Member
  • ****
  • Posts: 302
Re: The Brooks Framework
« Reply #11 on: May 27, 2018, 11:52:14 am »
Ah, you mean /usr/share/fpcsrc/3.0.4/packages/fcl-web/examples ?

I was looking in the Lazarus tree, but that now makes sense.

Yep, thanks   Leledumbo, that looks like a good start. I need to do some reading !

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)

dbannon

  • Sr. Member
  • ****
  • Posts: 302
Re: The Brooks Framework
« Reply #12 on: May 27, 2018, 01:43:52 pm »

Edit : I really should have created a new thread, this is about fcl-web - sorry !

OK, I tried following the PDF tutorial, it installed fine, rebuilt IDE, extra options on the New Project file. So I tried first example. The HTTP Server Application, "hello world".

It builds and launches fine and I note that you expect to see a number of handled exceptions but all I see is one (presumably handled) and then I get a
----------------------------------
httpproject1: ERROR
The application encountered the following error:
    Error: Not found
    Stack trace:
    $000000000049D460
    $000000000049CA0F
----------------------------------
in the browser. The one exception shows us -

Project httpproject1 raised exception class 'EHTTPRoute' with message
Not Found

Interestingly, the binary is not in project directory but down in lib, if I run it from command line, same result in browser window but as expected, no exception.

Now, I cannot trace execution back through fcl-web because its compiled without debug info so I am sort of lost as to how to proceed. 

Can I remove the package, rebuild it "in user space" for want of a better term so I can step through and find out just where the problem lies ?

Davo
« Last Edit: May 27, 2018, 01:46:29 pm by dbannon »
Lazarus 1.8, Linux (and reluctantly Win10, OSX)

nummer8

  • New member
  • *
  • Posts: 40
Re: The Brooks Framework
« Reply #13 on: May 27, 2018, 03:14:52 pm »
There is a new routing system in place.
To get the fp-web examples working use the following line in the application.
Application.LegacyRouting := True;

Jos

dbannon

  • Sr. Member
  • ****
  • Posts: 302
Re: The Brooks Framework
« Reply #14 on: May 28, 2018, 01:00:47 am »
Thanks Jos, I may not get a chance to try it out for a day or so so thanks in advance !

If that works, I'll update the wiki but, of course, not the PDF. I guess 'we' need to know a bit more about that issue ?  Do you know how the 'new' routing model works ? I assume it should be used ?

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus