Requirements

C++ Direct Dependencies

boost

Note: We are moving to using Qt a lot more than boost. Qt offers many of the boost features and it handles XML, XSLT, and a few other things that we're using for Snap! (libQtCassandra, libQtSerialization, etc.)

The boost library is full of goodies. We use it for all sorts of things although we try to limit ourselves to the basics such as shared pointers1 and signals 2.

So... we use boost because it offers a signal implementation that we like. Especially, we like the fact that it is very strongly typed2 and you cannot send a signal that does not exist3.

dl

In order to load our plugins we use the standard Dynamic Linking feature of POSIX.1-2001 (i.e. dlopen() function.)

libmagic

A library used to magically determine the type of a file. This is used by the file tool in Unix environments.

log4cplus

The server logs messages to log files. This is done using the log4cplus library which gives you the ability to send the logs to files, syslog, consoles, etc. Internally we still use our own log wrapper so we're not locked to log4cplus and our logging mechanism can use C++ capabilities in a better way than what log4cplus offers by default.

Qt

The Qt library to make use of the different protocol capabilities (i.e. TCP/IP client/server) and the XML support.

Generated output uses XML

The XML support in Qt is used to create a DOM tree (instead of generating HTML "by hand") which can be passed through XSLT parsers to transform the raw data in a beautifully laid out HTML document for perfect display.

The XSLT can also be used to generate other output formats such as PDF4, Text, RDF...

Regular Expressions

Many parts of the software require a regular expression library. We use Qt for this purpose. Qt is a C++ implementation of the perl regular expressions and other patterns (such as shell patterns).

QScript: a JavaScript implementation

The QScript implementation offers us a way to run JavaScript code which makes for powerful extensible ways to let users enter JS code at runtime (without having to recompile Snap!) For example, it is used to determine which theme to use based on parameters such as the browser in use (i.e. Desktop, laptop, iPhone?)

OpenSSL

We use the OpenSSL library to compute all sorts of things from random numbers (for session numbers) and to encrypt passwords.

Later we may also do some more such as encrypt some sensitive information that we save in our database.

libQtCassandra

The C++ library based on Qt used to access the Cassandra database system.

We are hosting this project on this very website: libQtCassandra.

libQtSerialization

A C++ library used to serialize data. This is a Qt extension (it uses Qt and follows their coding style.)

We are hosting this project on this very website: libQtSerialization.

Controlled Variables

The Controlled Variables project is a set of C++ templates used to enhance your C++ development by protecting you from not initializing variables using a basic type (i.e. char, short, int, long, float, double, etc.)

How many times have you been adding an int variable to your class and forgot adding it to ALL your constructors? The controlled variables project allows you to automatically initialize these variables or force you to add the necessary variable to your constructor (i.e. variables without a default constructor!)

TLD Extractor

The libtld project is used to determine the top level domain name of any world wide domain.

This library has a list of all the existing top level domain names and determines the position of the top domain name in any URI. This gives you a way to extract the domain part itself and each sub-domain.

We use this library to avoid relying on the end users to determine what their domain name really is. This is used in Snap! Websites to determine the domain options and find the corresponding website definitions.

Cassandra

The Snap! Websites CMS is a data driven system so a form of database is required. Since an SQL database is very slow and we want an efficient system, we'll use Cassandra. Cassandra itself is a data server. It offers a key / data pair to reference all the data and supports 3 level arrays (4 with super columns, but these are now used in our environment.)

If you are running a Debian Linux flavored system, you can download a .deb file directly.

To access the Cassandra server, we developed the libQtCassandra library.

Note that Cassandra itself is written in Java.

Image Libraries (JPEG, PNG, GIF, TIFF, pnm, ZLib, gd, ImageMagick, etc.)

With the support of graphical interfaces comes graph features (hits on your website, increase in the number of users, number of pages, number of comments, etc.), image transformations (rotations, resizing, cropping, adding shadows, edges, ...), and other such things. We will make use of different image libraries to offer all of these capabilities in a way that can be used across the entire application. (i.e. one memory image class that can be used with all the image libraries with pixel format conversions as required.)

Note that Qt can be used to load and save images to different image file formats.

3rd Party Dependencies

Operating System: Linux

At this time we are working on Linux and making the system only available under Linux. However, you are free to convert the necessary code to make use of another system.

Database System: Cassandra and hence Java

We choose Cassandra for speed and automated duplicability on any number of servers. This way we avoid complicated SQL installations and especially backup/duplicability issues most often linked with SQL servers.

Web Server: Apache2

A very stable and fast web server for Linux. We need a certain number of features that Apache2 offers and are not available in other systems. This being said, other web servers may very well work with Snap! Websites too.

Firewall: iptables

In order to block spammers and scammers, we want to auto-update the firewall and block people who abused the system. This is in link with DoS or unwanted users who try too many times to log in their user account.

See: iplock firewall tool

cmake

In order to compile the source code, we make use of the cmake tool which makes it very easy to manage very large projects without the need to hire 100 developers. (And because the autotools are really dreadful!)

The minimum version is something around 2.8.x. We allows 2.8.0 and up at this point although if you have problems it could be because you have too old a version. This being said, everything should compile on Ubuntu 12.04 and up so you're likely going to be in good shape.

Access to Source Code

The source code is available on sourceforge.net. To retrieve it, you'll want to have git. The instructions to retrieve the code are available from sourceforge directly.

http://sourceforge.net/p/snapcpp/code/ci/master/tree/

Doxygen

We use doxygen to extract the documentation from the source. This works automatically if doxygen is installed. cmake will know and just not generate any documentation if doxygen is not present. (i.e. this dependency is optional.)

JavaScript helper libraries

CDNs

Google and Microsoft offer Content Delivery Networks (CDN). We can also make use of a large CDN database at:

https://cdnjs.com/

jQuery

http://jquery.com/

Google Web Toolkit (GWT)

http://www.gwtproject.org/doc/latest/DevGuide.html

CKEditor

http://ckeditor.com/

This editor makes use of pop-up windows which act exactly like a widget toolkit. It may be worth looking into it to determine how they've done it.

Testing

C++

We want to test everything we can with full coverage tests. For this purpose cppunit is well adapted since we are writing code in C++.

JavaScript

TBD. Probably http://code.google.com/p/js-test-driver/ ? (I would imagine we can look into using Qt QScript actually... still TBD...)

Now there is also V8 which is the JS environment used in Google Chrome and it can run standalone (although that means we'd have to "replace" all the DOM environment which may not be that easy!) The project is on Google Code: http://code.google.com/p/v8/

 

  • 1. Note that we will not be using the boost shared pointers much since Qt offers a similar object and we are switching to Qt instead. Also we could use the standard library shared pointers instead.
  • 2. Even so it seems that even with those strong C++ definitions of signals, the compiler can missinterpret the types of some messages, we prefer that to using a string as in Qt!?
  • 3. We are also using Qt which offers slots and signals... but (1) all the connections are done dynamically at run time which is slow and without 100% proper aliasing at compile time; (2) signals can be created with the wrong name, the code will run but they won't connect at runtime and thus your code won't work right; (3) the signals and slots require running moc on the code (the Qt pre-compiler) which is not always friendly.
  • 4. For PDF we're likely to use the wkhtmltopdf tool or some similar ready-made tool.
Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly