diff --git a/documentation/development/architecture.md b/documentation/development/architecture.md index fa46bb1cdd31bb241f1785d2a0df0ba6bd1b954e..3a63ce36e44bd9de741a8980de0a0afa8472880f 100644 --- a/documentation/development/architecture.md +++ b/documentation/development/architecture.md @@ -12,13 +12,15 @@ Spectrum 2 consist of several separate parts which cooperates together. This pag Directory| Description ---------|------------ ./src|Libtransport source codes -./include/transport|Libtransport headers +./include/transport|Libtransport header ./plugin/cpp|Libtransport-plugin source codes ./backends/|Various Spectrum 2 backends source codes +./spectrum/src|Spectrum 2 source codes +./spectrum/src/frontends| Spectrum 2 frontends source codes ## Libtransport -Libtransport is library providing the high-level interface for creating XMPP transports. It's used by the Spectrum 2 and by several transports. +Libtransport is library providing the high-level interface for creating transports. It's used by the Spectrum 2 and by several backends and by all frontends. Libtransport contains NetworkPluginServer class, which acts as server to which backends connect. Libtransport spawns the backend's processes when they are needed (for example when new user logs in) and destroys them when they are not needed anymore (for example when there are no active users on the backend). @@ -28,17 +30,19 @@ Name| Reason ----|------- Spectrum 2|It's the Spectrum 2 core Some backends|Connect the Spectrum2, use of Spectrum 2 database, parsing the config file, ... +Frontends|Core library for frontends development Libtransport uses: Name| Reason -----|------- -Swiften library|Connecting to Jabber sever and sending/receiving data from XMPP users +Swiften library|Historical reasons. It's used as a utils library and basic data structures are represented using classes from Swiften library. log4cxx|Logging protobuf|Protocol for libtransport - backends communication mysql-client|MySQL support sqlite3|SQLite3 support pqxx|PostgreSQL support +curl|HTTP requests for OAuth2 and REST frontends ## Libtransport-plugin @@ -74,3 +78,7 @@ Libtransport|Core library... Backends allow communication with particular legacy network and implements things like logging the user in, sending/receiving messages from legacy network and so on. Backend's life-cycle is controlled by the Spectrum 2 (or better said by the Libtransport's NetworkPluginServer class). Spectrum 2 spawns the backend and gives it `"--host localhost --port 32453"` parameters. Backend then has to connect the Spectrum 2 located at the given host/port and start receiving the commands sent by the Spectrum 2 main instance. For C++, there is wrapper class called NetworkPlugin which does the parsing and allows programmer to code backend just by implementing few virtual methods. + +## Frontends + +Frontends allow communication with the network Spectrum 2 users are using. Frontends are statically linked libraries currently. They are implementing `./include/transport/Frontend.h" class.