All Projects → tutanck → Regina

tutanck / Regina

Licence: other
Real-time MongoDB's database server using Socket.IO

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to Regina

aioudp
Asyncio UDP server
Stars: ✭ 21 (+10.53%)
Mutual labels:  socket-io
story-point
👕 Story pointing (or T-shirt sizing) app built with Svelte
Stars: ✭ 20 (+5.26%)
Mutual labels:  socket-io
socket.io-react-hooks-chat
A real-time chat app with React hooks and Socket.io
Stars: ✭ 75 (+294.74%)
Mutual labels:  socket-io
redparty
Host Youtube watch party with friends. Sync videos and chat in real-time
Stars: ✭ 70 (+268.42%)
Mutual labels:  socket-io
socket.io-rails
Rails asset pipeline wrapper for socket.io
Stars: ✭ 57 (+200%)
Mutual labels:  socket-io
socketChat
💬 A real-time messaging application built using Socket.IO and Express
Stars: ✭ 31 (+63.16%)
Mutual labels:  socket-io
local-party
A website where you can create rooms and chat while watching local video files synchronized with your friends.
Stars: ✭ 196 (+931.58%)
Mutual labels:  socket-io
pdfdraw
Nextcloud app to annotate PDF documents
Stars: ✭ 32 (+68.42%)
Mutual labels:  socket-io
react-app-simple-chat-app
A Simple Chat Application using MERN stack (MongoDB, Express JS, React JS, Node JS) and Socket.io for real time chatting
Stars: ✭ 41 (+115.79%)
Mutual labels:  socket-io
darkwire-server
Encrypted web socket chat - Darkwire.io Chat Server
Stars: ✭ 18 (-5.26%)
Mutual labels:  socket-io
node-server-template
This is Node.js server tidy template / boilerplate with Express (with asyncified handlers, custom error handler) framework and MongoDb. The server use ES6 and above. On different branches you can see different techniques' and technologies' usage, such as Kafka, nodemailer, file download... You also can find postman collections.
Stars: ✭ 116 (+510.53%)
Mutual labels:  socket-io
socketio
No description or website provided.
Stars: ✭ 23 (+21.05%)
Mutual labels:  socket-io
chat-app-server
Back-end server for chat application built using express, moongodb & socket.io for Frontend (https://github.com/binbytes/nuxt-chat-app).
Stars: ✭ 30 (+57.89%)
Mutual labels:  socket-io
python react blog back end
Redis Celery Fabric Gunicorn Personal Blog
Stars: ✭ 12 (-36.84%)
Mutual labels:  socket-io
RRQMSocket
TouchSocket是.Net(包括 C# 、VB.Net、F#)的一个整合性的、超轻量级的网络通信框架。包含了 tcp、udp、ssl、http、websocket、rpc、jsonrpc、webapi、xmlrpc等一系列的通信模块。一键式解决 TCP 黏分包问题,udp大数据包分片组合问题等。使用协议模板,可快速实现「固定包头」、「固定长度」、「区间字符」等一系列的数据报文解析。
Stars: ✭ 286 (+1405.26%)
Mutual labels:  socket-io
laravel-echo-redis-socketio
It's a very simple chat demo, use laravel-echo-server and Laravel Echo
Stars: ✭ 30 (+57.89%)
Mutual labels:  socket-io
node-vue-chat
🚀 🌠 Real Time Chat Application created with MEVN Stack
Stars: ✭ 89 (+368.42%)
Mutual labels:  socket-io
socket.io-redis-adapter
Adapter to enable broadcasting of events to multiple separate socket.io server nodes.
Stars: ✭ 2,598 (+13573.68%)
Mutual labels:  socket-io
socket.io-client-core
High-Performance Socket.IO client in C#
Stars: ✭ 70 (+268.42%)
Mutual labels:  socket-io
socket.io-redis-emitter
The Socket.IO Redis emitter, allowing to communicate with a group of Socket.IO servers from another Node.js process.
Stars: ✭ 673 (+3442.11%)
Mutual labels:  socket-io

Regina : Real-time database using MongoDB and Socket.IO

  • Regina allows to run MongoDB 'insert', 'find', 'update', 'delete', 'count', and 'aggregate' methods directly from the client side (such as firebase).

  • Regina can track tags based events and send back messages containing the result of the requests and their context to client's sockets subscribed to these tags.

  • Regina uses Socket.IO for client-server communication and event tracking.

How it works

alt text

Installation

  • npm install -g regina

Usage

Server side

Run with the default settings (db='localhost:27017/reginadb' and port=3009) :

  1. mongod
  2. regina
  3. open your browser at localhost:3009 and check that you are on the regina home page.

Run with custom settings :

  1. mongod --port 5000
  2. regina 'localhost:5000/mydb' 6000
  3. open your browser at localhost:6000 check that you are on the regina home page.

Client side

Import socket.io client and follow these instructions :

  1. create a socket instance with the regina server address :
  • var socket = io('http://localhost:3009/');
  1. send requests to the regina server using one of these type of requests :
  • socket.emit('insert', collection, docs, options, meta, ack);
  • socket.emit('find', collection, query, options, meta, ack);
  • socket.emit('count', collection, query, options, meta, ack);
  • socket.emit('update', collection, query, update, options, meta, ack);
  • socket.emit('remove', collection, query, options, meta, ack);
  • socket.emit('aggregate', collection, pipeline, options, meta, ack);

It is also possible to use IOS and Java clients

Example : JS Client (index.html)

  <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.js"></script>

  <script>
  //create a socket instance with the regina server address 
  var socket = io('http://localhost:3009/');

  //be aware of the misuse of regina methods
  socket.on('regina_noack_callback_error', (msg) => { console.log(msg); })

  //follow the 'new-msg' tag
  socket.on('new-msg', (res, ctx) => { console.log(res, ctx); });

  //send an insert request to the regina server with the 'new-msg' tag
  socket.emit('insert' //CRUD operation
    , 'messages' //collection

    //query|doc|pipeline
    , { msg: "Hello Regina", sender: "Paris MongoDB User Group" }

    , {} //mongo options

    , { "tags": [{ "val" : "new-msg" }] }  //meta (tags)

    , (err, res, ctx) => { console.log(err, res, ctx); } //ack (callback)
  );
</script>

See the full example here.

Use of tags

You can use any tag you want except socket.io reserved events. In the meta parameter, simply add an object containing the tags key and an array of objects each containing the val key.

  • {"tags":[{"val":"find-users"}, {"val":"@users-coll"}, {"val":"#users"}]}

You can also specify the kind (scope) for each tag :

  • {"tags":[{"val":"find-users","kind":"emit"}, {"val":"#users","kind":"broadcast"}]}

There are 3 kinds of scopes:

  • emit : sends a message only to the client that sent the request to the server.
  • broadcast : sends a message to all connected clients except the client that sent the request to the server.
  • io : sends a message to all connected clients including the client that sent the request to the server. By default the scope is io.
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].