All Projects → almightycouch → meteorpp

almightycouch / meteorpp

Licence: MIT license
Meteor DDP & Minimongo implementation in C++.

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to meteorpp

meteor-devtools-evolved
The Meteor framework development tool belt, evolved.
Stars: ✭ 146 (+563.64%)
Mutual labels:  meteor, ddp, minimongo
meteorman
A DDP client with GUI (The Postman for Meteor)
Stars: ✭ 51 (+131.82%)
Mutual labels:  meteor, ddp
hypersubs
an upgraded version of Meteor subscribe, which helps optimize data and performance!
Stars: ✭ 13 (-40.91%)
Mutual labels:  meteor, ddp
unity3d-ddp-client
Lightweight DDP client for Unity3D
Stars: ✭ 18 (-18.18%)
Mutual labels:  meteor, ddp
meteor-control-mergebox
Control mergebox of publish endpoints
Stars: ✭ 28 (+27.27%)
Mutual labels:  meteor, ddp
meteor-subscription-scope
Scope queries on collections to subscriptions
Stars: ✭ 20 (-9.09%)
Mutual labels:  meteor, ddp
react-meteor
Meteor Reactivity for your React application, inspired by react-native-meteor.
Stars: ✭ 16 (-27.27%)
Mutual labels:  meteor, ddp
meteor-autoform-bs-datepicker
Custom "bootstrap-datepicker" input type for AutoForm
Stars: ✭ 25 (+13.64%)
Mutual labels:  meteor
tkzd
Meteor Project example ✨
Stars: ✭ 15 (-31.82%)
Mutual labels:  meteor
meteoro
Pomodoro App on Meteor
Stars: ✭ 31 (+40.91%)
Mutual labels:  meteor
Meteor-Template-helpers
Template helpers for Session, logical operations and debug
Stars: ✭ 35 (+59.09%)
Mutual labels:  meteor
constellation
Extensible dev console for Meteor
Stars: ✭ 62 (+181.82%)
Mutual labels:  meteor
meteor-auth
A user authentication solution for Mantra applications
Stars: ✭ 34 (+54.55%)
Mutual labels:  meteor
meteor-cluster
worker pool for meteor using node js native `cluster` module
Stars: ✭ 18 (-18.18%)
Mutual labels:  meteor
meteor-editable-text-wysiwyg-bootstrap-3
WYSIWYG extension for babrahams:editable-text package for bootstrap-3 apps
Stars: ✭ 18 (-18.18%)
Mutual labels:  meteor
setup-meteor
Set up your GitHub Actions workflow with a specific version of Meteor.js
Stars: ✭ 17 (-22.73%)
Mutual labels:  meteor
Grow-IoT
Software packages for smart growing environments.
Stars: ✭ 24 (+9.09%)
Mutual labels:  meteor
deepvac
PyTorch Project Specification.
Stars: ✭ 507 (+2204.55%)
Mutual labels:  ddp
raspberry-noaa
Fully automated ISS SSTV, NOAA and Meteor satellite image downloader using Raspberry PI
Stars: ✭ 155 (+604.55%)
Mutual labels:  meteor
chatbot-bootstrap
A bootstrap application for building a web based chatbot
Stars: ✭ 23 (+4.55%)
Mutual labels:  meteor

Meteor++

Build Status Coverage Status Github Releases Documentation Status GitHub license Github Issues

Cover image

Meteor DDP & Minimongo implementation in C++.

With this library you can:

  • communicate with Meteor applications over Websockets
  • subscribe to real-time feeds, track changes and observe specific queries
  • call server-side methods, query and modify collections
  • keep your data mirrored and simulate server operations (latency compensation)

Quick Start

Install Meteor++:

git clone --recursive git://github.com/almightycouch/meteorpp.git
cd meteorpp/build/
cmake ..
make

Run the examples:

ddp-monitor test

Intregrate the library to your project and enjoy the power of Meteor with the speed of C++.

Documentation

One of the seven principles of Meteor is "simplicity equals productivity".

No esoteric concepts, clear documentation, well-established coding conventions, a set of simple tools designed to integrate seamlessly together.

Meteor++ was built from ground up with the very same philosophy, keep things simple. Both APIs share many similar patterns. If you are familiar to Meteor, you will feel right at home.

Integration

The library is written in modern C++. It depends on following third-party libraries:

Most of these libraries are header-only and do not require any specific installation. However, you must install boost_random, boost_system and ejdb to successfully build Meteor++.

In order to support features such as latency compensation and atomic operations, some files in the EJDB library must be patched. You can get the patch to apply here.

Note that a fork of EJDB containing the required changes is available as a submodule.

Though it's 2015 already, the support for C++11 is still a bit sparse. Do not forget to set the necessary switches to enable C++11 (e.g., -std=c++11 for GCC and Clang).

Installing Boost

Installing Boost is straight forward on most systems.

OSX:

brew install boost

Linux:

sudo apt-get install libboost-dev libboost-program-options-dev libboost-random-dev libboost-system-dev

If you require more specific informations about the installation process, please read this Getting Started on Unix Variants guide.

Installing EJDB

Installing EJDB is pretty easy as well as we provide the patched library as submodule.

cd ejdb/
mkdir build/
cd build/
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../dist ../
make && make install
cd ../../

Building Meteor++

Once the dependencies installed, you can build meteorpp as follow:

cd meteorpp/build/
cmake ..
make

Examples

Here are some examples to give you an idea how to use the library.

#include <boost/asio.hpp>

#include <meteorpp/ddp.hpp>
#include <meteorpp/ddp_collection.hpp>
#include <meteorpp/live_query.hpp>

void print_live_query(std::shared_ptr<meteorpp::live_query> const& live_query)
{
    std::cout << live_query->data().dump(4) << std::endl;
}

int main(int argc, char** argv)
{
    boost::asio::io_service io;

    std::shared_ptr<meteorpp::ddp_collection> coll;
    std::shared_ptr<meteorpp::live_query> live_query;

    auto ddp = std::make_shared<meteorpp::ddp>(io);
    ddp->connect("ws://localhost:3000/websocket", [&](std::string const& id) {
        coll = std::make_shared<meteorpp::ddp_collection>(ddp, "test");
        coll->on_ready([&]() {
            live_query = coll->track({{ "foo", "bar" }});
            live_query->on_changed(std::bind(print_live_query, live_query));
            print_live_query(live_query);
        });
    });

    io.run();
    return 0;
}

License & Warranty

Copyright (c) 2015 Mario Flach under the MIT License (MIT)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].