Microframework which helps to develop web Pascal applications.

risoflora.github.io/brookframework

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

silvioprog 4df04c9d58 Bump v5.1.0 5 anni fa
.github c46cec98a7 Updated badges in the README file. 5 anni fa
Contrib 8617d61337 Merging from branch "expr". 5 anni fa
Examples d9b549b36e Improved the math expression examples. 5 anni fa
Package 8617d61337 Merging from branch "expr". 5 anni fa
PasDoc edf209aece Added reference for the mathematical expression evaluator feature. 5 anni fa
Source 4df04c9d58 Bump v5.1.0 5 anni fa
Test 6a94b6abf9 Dropped support to very old FPC versions. 5 anni fa
.editorconfig d8ac738ef3 Added EditorConfig, Markdown-Lint and git-attributes files. 5 anni fa
.gitattributes d8ac738ef3 Added EditorConfig, Markdown-Lint and git-attributes files. 5 anni fa
.gitignore edf209aece Added reference for the mathematical expression evaluator feature. 5 anni fa
.markdownlint.json 8ae4c3b321 Bump v5.0.0 5 anni fa
LICENSE 1c4d95bf4c Updated LICENSE file. Brook framework remains LGPLv2.1-licensed. 6 anni fa
README.md d9b549b36e Improved the math expression examples. 5 anni fa
THANKS b44afa880d Updates the README and THANKS files. (Fix #1) 5 anni fa
VERSION ba779798dd Merged from https://github.com/silvioprog/brookframework 7 anni fa
_config.yml 6d04ba7f83 Set theme jekyll-theme-cayman 5 anni fa

README.md

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.
  • 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;
    if not Active then
      Exit;
    WriteLn('Server running at http://localhost:', Port);
    Open;
    ReadLn;
  finally
    Free;
  end;
end.

There are other examples available in the Examples/ directory.

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.

Licensing

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

Documentation

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

Downloading

All stable releases are available for download at the releases page.

To download the very latest source from the Git server, do this:

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

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

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. If you have questions, open a new issue at the issues page. For donations to support this project, please click the button below.

Support this project

Support

This project is completely self-explanatory, but, if you need a consulting service to integrate it on your project, contact us.