Skip to content

Real-time push notification service with RethinkDB, Node.js, Express and socket.io

Notifications You must be signed in to change notification settings

naoko/RethinkPush

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RethinkPush

Works almost like firebase - Internal hosted solution powered by RethinkDB, Node.js, Express.js and Socket.IO

Data pushed to RethinkDB synchronized in realtime to every connected client via WebSocket

  • Use of RethinkDB Changefeeds for Realtime messaging
  • Socket.IO enables real-time bidirectional event-based communication. It works on every platform, browser or device, focusing equally on reliability and speed.

How does it work

view sequence diagram in stackedit.io

direct

alt text

  • client app: web browser (use WebSocket)
  • app: RESTful API Server
  • RethinkPush: push notification service
  • RethinkDB: JSON doc storage (in lieu of Firebase)

install dependencies

# test dependency
npm install -g mocha  
npm install

how to run test

npm test

JSON schema

{
	"title": "Message Schema",
	"type": "object",
	"properties": {
		"namespace": {
			"description": "resource identifier. e.g.: chat, case_count, notification",
			"type": "string"
		},
		"channel": {
			"description": "channel name e.g: uuid_for_private, public_for_broadcasting",
			"type": "string"
		},
		"message": {
			"description": "message to be consumed",
			"type": "object"
		}
	},
	"required": ["namespace", "channel", "message"]
}

data example

r.db('notification').table('messages').insert({
	'namespace': 'chat',
  'channel': 'public',
  'message': {'greeting': 'Ahoy from RethinkDB'}
});

Roadmap

  • docker or vagrant for quick up and running
  • primitive authentication
    • app wide secret key
  • add more tests and run on jenkins
  • production provisioning with pm2
  • add ts_to_send for scheduled notification
    • add filter on changes query
  • REST api
    • post notification
    • subscription level authentication
  • make record deletion optional after notification is sent

ref:

About

Real-time push notification service with RethinkDB, Node.js, Express and socket.io

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published