Microframework which helps to develop web Pascal applications.

risoflora.github.io/brookframework

#framework #pascal #fpc #delphi #webdev #http #webserver #webapp #library

Silvio Clécio 56ef5cc981 chore: update GitHub funding configuration 2 săptămâni în urmă
.github 56ef5cc981 chore: update GitHub funding configuration 2 săptămâni în urmă
Contrib 61a4853fe5 Added the project logo. 4 ani în urmă
Examples 67a9de3c5e Added a simple Delphi FMX example for how to create a server/client streamed CRUD. 4 ani în urmă
Package 0516127b57 Bump v5.7.2 11 luni în urmă
PasDoc efc9ca65a8 Upgraded all project files. 5 ani în urmă
Source 0516127b57 Bump v5.7.2 11 luni în urmă
Test 9ce8e92ba3 Fix all the tests 1 an în urmă
libsagui @ 451d7240ac 33f69df45c Updated submodule to latest commit 11 luni în urmă
.editorconfig d8ac738ef3 Added EditorConfig, Markdown-Lint and git-attributes files. 5 ani în urmă
.gitattributes d8ac738ef3 Added EditorConfig, Markdown-Lint and git-attributes files. 5 ani în urmă
.gitignore 0248fb3f8f Implement custom host name support 1 an în urmă
.gitmodules 30a18a9ed5 Rewrote CI to Pascal 1 an în urmă
.markdownlint.json d803520ed8 Added Telegram group and more info to the README file. (Fix #24) 4 ani în urmă
DONORS 10d4761d71 Added new donor (Thank you Kevin Morris! :-)). 4 ani în urmă
LICENSE 1c4d95bf4c Updated LICENSE file. Brook framework remains LGPLv2.1-licensed. 6 ani în urmă
README.md 64d0184850 Add a reference to some available tutorials 4 luni în urmă
THANKS 5857348ed8 Added member Alan Telles to THANKS file. 4 ani în urmă
VERSION 15af2209cd Bump v5.2.0 5 ani în urmă
_config.yml 6d04ba7f83 Set theme jekyll-theme-cayman 5 ani în urmă

README.md

Brook framework

Support this project via PayPal GitHub releases

Overview

Brook is a cross-platform microframework which helps to develop web Pascal applications built by Delphi or Lazarus IDE and Free Pascal. Its core has been developed using the Sagui library, that's why it is so fast, compact and useful to run on embedded systems.

Features

  • Three threading modes:
    • Event-driven - single-thread + polling.
    • Threaded - one thread per request.
    • Polling - pre-allocated threads.
    • Isolated request - request processed outside main thread.
  • Fast path routing that supports:
    • Regular expression with JIT optimization.
    • Binary search for path entry-points.
  • HTTP compression:
    • Deflate - for static strings and streaming.
    • Gzip - for file compression.
  • HTTP cookies:
    • Providing classes which handles server side cookies.
  • HTTPS support:
    • Data encryption through GnuTLS library.
  • Dual stack:
    • IPv4 and IPv6 on top of a single socket.
  • Basic authentication:
    • For standard login using username and password.
  • Upload/download:
    • Static body and payload.
    • Content streaming for real-time applications.
    • Small and large files transferring.
  • Mathematical expression evaluator:
    • Arithmetic, bitwise and logical operators.
    • Variables allocation at build and/or run time.
    • Macro support to define functions at run time.
    • Extendable with custom functions.
    • Error handling with error kind and position.
  • Media types:
    • Resolving media types (MIME) in any supported platform.
  • Logging:
    • Allowing to generate logs in console or files.
  • String buffer:
    • For fast operations involving strings.
  • String map:
    • Hashed lists for key-value mapping.
  • And more:
    • Discover more features by playing with our examples.

Examples

The example below shows a minimal hello world HTTP server:

type
  THTTPServer = class(TBrookHTTPServer)
  protected
    procedure DoRequest(ASender: TObject; ARequest: TBrookHTTPRequest;
      AResponse: TBrookHTTPResponse); override;
  end;

procedure THTTPServer.DoRequest(ASender: TObject; ARequest: TBrookHTTPRequest;
  AResponse: TBrookHTTPResponse);
begin
  AResponse.Send('Hello world', 'text/plain', 200);
end;

begin
  with THTTPServer.Create(nil) do
  try
    Port := 8080;
    Open;
    if not Active then
      Exit;
    WriteLn('Server running at http://localhost:', Port);
    ReadLn;
  finally
    Free;
  end;
end.

There are other examples available in the Examples directory.

Downloading

All stable releases are available to download via GetIt, OPM and GitHub releases page.

We strongly recommend you to install Brook using GetIt or OPM, however, if you want to download the very latest source from the Git repository, do this:

git clone https://github.com/risoflora/brookframework.git

It will create a directory named brookframework filled with the source code.

Documentation

The documentation has been written in PasDoc and is available in HTML format at brookframework-docs.

Some tutorials are available at Tutorials for the Brook framework.

Targets

Successfully tested on:

  • Windows
  • Linux
  • Raspbian/Android

compiled using:

  • Delphi XE family (Rio)
  • Lazarus / Free Pascal (Lazarus 2.0+ / FPC 3.2+)

Versioning

Starting from the version 1.0.0, Brook follows the SemVer rules regarding API changes with backwards compatibility across major releases.

Contributing

Brook framework is totally open source and would not be possible without our contributors. If you want to submit contributions, please fork the project on GitHub and send a pull request. You retain the copyright on your contributions.

Donations

Many open source projects, large and small, receive donations to encourage their authors, therefore, it would be not different in Brook.

All money collected from donations are invested to the purchase of study materials. This way, directly or indirectly, all knowledge acquired in the studies influence the spread of this project.

If you want to support this project, please choose one of the options below to make a donation.

Support this project via PayPal Support this project via PagSeguro

(For those who would like to donate in Brazilian BRL, it can be done by a identified bank deposit or via PayPal Brazil.)

Check the list of all donors that lovely supported this idea! :heart:

Community

Would you like to ask questions and talk to more Brook users?

Join us to the official group at Telegram and be welcome! :slightly_smiling_face:

Support

This project values being simple, direct and self-explanatory. However, if you need some help to integrate Brook to your application, we have the option of a paid consulting service. Contact us!

Projects using Brook

  • Brook Telegram - Telegram plugin for Brook framework. [MIT]
  • Aproveita.App - PWA application for supermarket products sales. [Comercial]
  • Client Web Portal - Application to manage appointments, update demographics, download previous invoices from the RUBI medical records system. [Commercial]

Would you like to add your project to that list above? Feel free to open a new issue requesting it! :-)

Licensing

Brook framework is released under GNU Lesser General Public License v2.1. Check the LICENSE file for more details.