TreeFrog Framework : High-speed C++ MVC Framework for Web Application


Small but Powerful and Efficient

CircleCI TravisCI License Release Docker image

TreeFrog Framework is a high-speed and full-stack web application framework based on C++ and Qt, which supports HTTP and WebSocket protocol. Web applications can run faster than that of lightweight programming language. In application development, it provides an O/R mapping system and template system on an MVC architecture, aims to achieve high productivity through the policy of convention over configuration.


  • High performance - Highly optimized Application server engine of C++
  • O/R mapping - Conceals complex and troublesome database accesses
  • Template system - ERB-like template engine adopted
  • Supports for many DB - MySQL, PostgreSQL, ODBC, SQLite, Oracle, DB2, InterBase, MongoDB and Redis.
  • WebSocket support - Providing full-duplex communications channels
  • Generator - Generates scaffolds and Makefiles automatically
  • Supports various response types - JSON, XML and CBOR
  • Cross-platform - Windows, macOS, Linux, etc. Write once, compile anywhere.
  • OSS - New BSD License


TreeFrog uses the qt qmake build system.

Web Site



Get additional information:

API Reference


Discussion group for TreeFrog Framework:!forum/treefrogframework

Docker Images

  $ docker pull treefrogframework/treefrog

MongoDB communication

TreeFrog Framework uses the 10gen-supported C driver to communicate with the MongoDB server. The source code of the driver is included in this package. See the README also.

  • Get real client IP address behind the reverse proxy

    Get real client IP address behind the reverse proxy

    I'm using the nginx server as a reverse proxy for Qt TreeFrog as described on this page:

    The problem is that in this case the TActionController::clientAddress() and TWebSocketEndpoint::peerAddress() functions return the proxy address instead of the client's IP address.

    In nginx, you can add an X-Forwarded-For header containing the client's IP address:

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    but unfortunately Qt TreeFrog does not have functionality similar to that of mod_remoteip Apache server:

    Would it be possible to add an option in the TreeFrog configuration to define the name of the HTTP header containing the client's original IP address (RemoteIPHeader) and the list of trusted proxy (RemoteIPTrustedProxy) ? The TActionController::clientAddress() function would return the client's IP address instead of the proxy IP address if the proxy is trusted.


    opened by amiart 13
  • File session expire when browser sends multiple concurrent requests

    File session expire when browser sends multiple concurrent requests

    This happens when browser sends to treefrog multiple concurrent requests and each access session stored in file. One of the action threads try to write to file session, and another one reads session from the file at the same time.

    In treefrog.log there is ERROR: Failed to load a session from the file store, and then session id is regenerated.


    In debugger QDataStream::status() returned QDataStream::ReadPastEnd


    Please add QWriteLocker in TSessionFileStore::store() just before session in written, and QReadLocker in TSessionFileStore::find() - tried this and worked for me.

    Config: Windows 10 x64 Qt 5.9 +MSVC 2015 32bit TreeFrog 1.17.0

    application.ini: Session.StoreType=file Session.AutoIdRegeneration=false Session.LifeTime=0 Session.CookiePath=/ Session.GcProbability=100 Session.GcMaxLifeTime=1800

    opened by amiart 13
  • Fix parsing X-Forwarded-For header.

    Fix parsing X-Forwarded-For header.

    Fixes parsing of the header, and it is now possible to trust Unix domain socket proxy and proxy servers in a subnet.

    In nginx configuration (reverse proxy) add this line:

    proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;

    In Treefrog configuration add these lines:

    TrustedProxyServers="unix:;;"   # the value must be in quotes

    Fixes #285

    opened by amiart 11
  • Routing enhancements

    Routing enhancements

    Please review my changes carefully. Will recommend reviewing commit by commit, and using ?w=1 parameter to avoid seeing indentation changes as additions/removals.

    !!As I could not get master running correctly on my machine, I worked on top of 1.7.5. Will probably need some merging and conflict resolution, sorry!.

    My pull request:

    • fixes routing errors (a get or post route would accept any http verb, even invalid ones, not only the get and post). Same for match
    • added support for put, patch, delete routes and http verbs
    • when adding a rule both /rule and /rule/ was added to the routing list, removed that doubling and now appending the '/' when the incoming requests don't have it.
    • fixes a debug output message
    • now returning 404 instead of 400 in some cases when there is no actual route match.
      • Rails-like support for put, patch, delete. Browsers are incapable of sending anything other than get and post. Rails overcame this shortcoming by reserving the "method" parameter, and when present overriding the incoming verb with it.

    Todo: update documentation about support for put, patch, delete

    opened by axos88 10
  • Add OTHER_FILES erb/html/otm files in views/_src/

    Add OTHER_FILES erb/html/otm files in views/_src/

    Currently, in Qt creator, the views (erb/html/otm)files doesn't list in the project, so we need to go to these folders then open them. when coding, if we write controller and write views at the same time, change selected view files, it became so inconvenience.

    opened by hks2002 9
  • TSmtpMailer: Prevent STRIPTLS attacks

    TSmtpMailer: Prevent STRIPTLS attacks

    The STARTTLS in TSmtpMailer class is vulnerable to STRIPTLS attacks.

    According to Wikipedia:

    Because the initial handshake takes place in plain text, an attacker in control of the network can modify the server messages via a man-in-the-middle attack to make it appear that TLS is unavailable (called a STRIPTLS attack). Most SMTP clients will then send the email and possibly passwords in plain text, often with no notification to the user. ... STRIPTLS attacks can be blocked by configuring SMTP clients to require TLS for outgoing connections (for example, the Exim Message transfer agent can require TLS via the directive "hosts_require_tls")

    The solution is to add a new parameter in application.ini:

    ActionMailer.smtp.EnableSTARTTLS=true ActionMailer.smtp.RequireTLS=true # <-- new parameter (default false)

    arnd then check it in tsmtpmailer.cpp before line 170:

    if (requireTls && !tlsEnable) {
         tSystemError("STARTTLS not enabled");
         return false;
    if (requireTls && !tlsAvailable) {
        tSystemError("The mail server does not support TLS");
        return false;
    if (tlsEnable && tlsAvailable) {
        if (!cmdStartTls()) {
            return false;
    opened by amiart 8
  • configure with --enable-mongo not available in macOS

    configure with --enable-mongo not available in macOS

    Following the guide:

    The --enable-mongo option its not available in treefrog in the macOS Mojave. I'm using the 1.23.0 version of treefrog.

    I used the --enable-shared-mongoc option instead, but after changing the .ini files to set the database to my localhost the command tspawn --show-collections in my project folder show me the error:

    DatabaseName: databaseName HostName: localhost MongoDB opened successfully Segmentation fault: 11

    How can I find more informations about the error?

    opened by rafiqueud 8
  • All helper header auto included in to each view source file.

    All helper header auto included in to each view source file.

    tmake auto include all helper header to all views source file. Even all validators, one validator is normally used for one form. maybe let developer manually include these helper headers as required is better.

    opened by hks2002 7
  • SELECT * FROM user problem in PostgreSQL

    SELECT * FROM user problem in PostgreSQL

    ORM generated SQL command like SELECT * FROM user won't fetch data from user table in PostgreSQL. It must be SELECT * FROM "user" (quoted table name).

    opened by whitglint 7
  • added support for ARM

    added support for ARM

    Adding support for ARM.

    Now it seems to be compiling on the Raspberry PI, and the basic tutorial is running fine. I've not got the knowledge yet where this code would actually be used, so it's not tested thouroughly.

    Why isn't perftools used as a git submodule btw? The support for ARM is already out there, but the source files here are outdated.

    opened by axos88 7
  • Feature: Show a list of running projects

    Feature: Show a list of running projects

    Suggestion command: treefrog -l

    When I type 'treefrog -l' command, I'll get something like this:

    2 projects running: * /home/account/project1 + url: http://localhost:8800/project1/index * /home/account/project2 + url: http://localhost:8801/project2/index

    Sorry my bad english!

    opened by tienvx 7
  • Conditionally build lz4 and glog

    Conditionally build lz4 and glog

    opened by chenrui333 0
Your high performance web application C framework is a C micro-framework for web applications. includes: A fast HTTP/1.1 and Websocket static file + application server. Support for c

Bo 1.7k Dec 29, 2022
Tntnet is a web application server for web applications written in C++.

Tntnet is a web application server for web applications written in C++.

Tommi Mäkitalo 73 Sep 26, 2022
Drogon: A C++14/17 based HTTP web application framework running on Linux/macOS/Unix/Windows

English | 简体中文 | 繁體中文 Overview Drogon is a C++14/17-based HTTP application framework. Drogon can be used to easily build various types of web applicat

An Tao 8.5k Dec 31, 2022
CppCMS - High Performance C++ Web Framework

CppCMS - High Performance C++ Web Framework What is CppCMS? CppCMS is a Free High Performance Web Development Framework (not a CMS) aimed at Rapid Web

Artyom Beilis 375 Dec 25, 2022
A high performance, middleware oriented C++14 http web framework please use matt-42/lithium instead

A high performance, middleware oriented C++14 http web framework please use matt-42/lithium instead

Matthieu Garrigues 1.7k Dec 17, 2022
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.

Cutelyst - The Qt Web Framework A Web Framework built on top of Qt, using the simple and elegant approach of Catalyst (Perl) framework. Qt's meta obje

Cutelyst 809 Dec 19, 2022
Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)

Crow is C++ microframework for web. (inspired by Python Flask) #include "crow.h" int main() { crow::SimpleApp app; CROW_ROUTE(app, "/")([]()

Jaeseung Ha 7k Jan 8, 2023
QDjango, a Qt-based C++ web framework

QDjango - a Qt-based C++ web framework Copyright (c) 2010-2015 Jeremy Lainé About QDjango is a web framework written in C++ and built on top of the Qt

Jeremy Lainé 249 Dec 22, 2022
This is a proof-of-concept of a modern C web-framework that compiles to WASM and is used for building user interfaces.

DanCing Web ?? ?? (DCW) Getting Started Dancing Web is now distributed with the Tarantella Package Manager — a tool I've made to simplify setup of pro

Danilo Chiarlone 3 Sep 11, 2021
C++ application development framework, to help developers create and deploy applications quickly and simply

ULib - C++ library Travis CI: Coverity Scan: ULib is a highly optimized class framework for writing C++ applications. I wrote this framework as my too

stefano casazza 950 Dec 24, 2022
The application framework for developer module of EdgeGallery platform

crane-framework crane-framework将可复用的计算和软件功能抽象成插件,APP开发者面向使用插件进行MEC APP开发。这样屏蔽了和MEC平台交互的细节,实现MCE APP和MEC平台的松耦合。而且插件框架基础能力可裁剪,按需提供最小的APP系统。 特性介绍 为了方便开发者

EdgeGallery 21 Aug 30, 2021
Embedded C/C++ web server

CivetWeb The official home of CivetWeb is Continuous integration for Linux and macOS (Travis CI): Continuous inte

null 2.3k Jan 8, 2023
C library to create simple HTTP servers and Web Applications.

Onion http server library Travis status Coverity status Onion is a C library to create simple HTTP servers and Web Applications. master the developmen

David Moreno Montero 1.9k Dec 31, 2022
A C++11 RESTful web server library

Served Overview Served is a C++ library for building high performance RESTful web servers. Served builds upon Boost.ASIO to provide a simple API for d

Meltwater 696 Dec 28, 2022
cserv is an event-driven and non-blocking web server

cserv is an event-driven and non-blocking web server. It ideally has one worker process per cpu or processor core, and each one is capable of handling thousands of incoming network connections per worker. There is no need to create new threads or processes for each connection.

null 43 Nov 6, 2022
Experimental, scalable, high performance HTTP server

Lwan Web Server Lwan is a high-performance & scalable web server. The project web site contains more details. Build status OS Arch Release Debug Stati

Leandro A. F. Pereira 5.7k Jan 9, 2023
A high-performance REST Toolkit written in C++

Pistache Pistache is a modern and elegant HTTP and REST framework for C++. It is entirely written in pure-C++14 and provides a clear and pleasant API.

null 2.8k Dec 29, 2022
Cetus is a high performance, stable, protocol aware proxy for MySQL Group Replication.

Introduction Cetus is a high performance, stable, protocol aware proxy for MySQL Group Replication. Getting started 1. Prerequisites cmake gcc glib2-d

null 37 Sep 19, 2022