= Tufão - an asynchronous web framework for C++ built on top of Qt =
--------------------------------------------------------------------

Tufão is a web framework for C++ that makes use of Qt's object communication
system (signals & slots). It features:
  * High performance standalone server
  * Cross-plataform
  * Support modern HTTP features
   * Persistent streams
   * Chunked entities
   * 100-continue status
   * WebSocket
  * HTTPS support
  * Flexible request router
  * Static file server with support for conditional requests and partial
    download
  * Plugin-based server to allow change running code at runtime
  * QtCreator's plugin to allow create new applications rapidly
  * Lots of tests
  * Timeout support

It uses Ryan Dahl's HTTP parser to provide good performance.

You can generate documentation from the source code using Doxygen. The
documentation will be put on the doc folder in the html and tex formats. There
is also experimental support for Qt compressed help files.

== LICENSE ==
-------------

The library is under the LGPLv2 and public header files, documentation and
examples are under MIT license.

The library is dynamic linked against Qt and include code from Ryan Dahl's HTTP
parser. Qt library is licensed under LGPL and Ryan Dahl's HTTP parser is
licensed under MIT license.

So, you can create commercial applications (the *only* restriction is that *if*
you do any modifications to *Tufão*, these modifications must be redistributed).

== BUILD ==
-----------

Make sure you have Qt installed, then run:

<pre>
$ qmake OPTIONS
$ make
</pre>

OPTIONS can be null or have a combination of the following values:
  * INSTALLDIR=${INSTALLDIR}
  * CONFIG=debug
  * CONFIG=staticlib (force creation of static lib)

If you want to combine values for the same variable, just use a single string
space separated, as in the following example:

<pre>
$ qmake 'CONFIG=debug staticlib'
</pre>

NOTE:
Qt 4.7 or later is required.

After build the project, the following directories will be created:
  * build: where temporary build objects are
  * lib: where the library file is

To generate the documentation, just run doxygen using Doxyfile as configuration
file and the documentation will be generated in the folder doc. The
documentation is available in the following formats:
  * HTML: Always generated. It should be in the doc/html folder.
  * latex: You can use this format to generate a pdf. Just run make inside the
    doc/latex folder.
  * Qt Compressed Help file: If you have qhelpgenerator binary tool in the
    system PATH, then the file is generated when you run doxygen and should be
    in doc/qch/tufao.qch. If you have qhelpgenerator tool installed, but not
    configured in the system PATH, but still want to generate the documentation
    in this format, just run the tool using doc/html/index.qhp as input file.

Tufão also have a lot of code to test its correctness. These codes are seperated
in one different qmake project for each Tufão class and are located in the
folder tests. If you got Tufão from a git checkout (not a stable release), then
you may be interessed in run these tests. To compile and run them, just run the
execute-tests.sh script.

== INSTALL ==
-------------

The default install prefix is /, if you don't intend to change it, just run:

<pre>
# make install
</pre>

To install to a different prefix, run:

<pre>
$ qmake INSTALLDIR=${DESTDIR}
$ make install
</pre>

NOTE:
If you just install the release version, you won't be able to compile debug
Tufão projects. I highly recomend you install both versions (see next section).

=== EXECUTING A SYSTEM-WIDE FULL INSTALL ===

If you want to install release and debug versions, run the following commands:

<pre>
$ qmake
$ make
# make install
$ qmake CONFIG=debug
$ make
# make install
</pre>

NOTE:
If you want to create a package and the variable $PKGROOT holds the package root
dir, you should run the previous commands using the INSTALLDIR=$PKGROOT option
when executing the qmake command.

== USAGE ==
-----------

To use Tufão in your Qt projects, just edit your .pro file and add the line:

<pre>
CONFIG += TUFAO
</pre>

You can find some examples in the examples folder.

If you want use Tufão in other build system, just add the compiler option
-ltufao for release version and -ltufao_d for debug version.

You can also see Tufão documentation integrated in QtAssistant (this feature is
experimental and is recomended to use the documentation in html format).

== NEWS ==
----------

Version 0.3
  * More application templates in QtCreator Tufão's plugin
  * Class to serve static files with support for conditional requests and
    byte-range requests
  * Robust request router added
  * HTTP plugin server added
  * Using newer version of Ryan Dahl's HTTP parser
  * Changed license from public headers to MIT
  * MSVC support
  * Some minor improvements

Version 0.2:
  * Code is more stable
  * Documentation improved
  * HttpServerResponse is easier to use
  * WebSocket support
  * TUFAO_VERSION_MAJOR and TUFAO_VERSION_MINOR macros added
  * QtCreator plugin
  * New examples

== ROADMAP ==
-------------

Here is a small roadmap for Tufão:

0.4:
  * Session/cookies support
  * Forms and file uploads

0.5:
  * Better (and easier) multi-thread support

0.6:
  * RPC support
  * Service discovery and description support
