All Projects → nicobarray → aquedux

nicobarray / aquedux

Licence: other
Redux over the wire

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to aquedux

Fast portrait segmentation
Fast (aimed to "real time") Portrait Segmentation on mobile phone
Stars: ✭ 215 (+367.39%)
Mutual labels:  real-time
Autobahn Cpp
WAMP for C++ in Boost/Asio
Stars: ✭ 231 (+402.17%)
Mutual labels:  real-time
Rtm3d
The official PyTorch Implementation of RTM3D and KM3D for Monocular 3D Object Detection
Stars: ✭ 244 (+430.43%)
Mutual labels:  real-time
Fairmot
[IJCV-2021] FairMOT: On the Fairness of Detection and Re-Identification in Multi-Object Tracking
Stars: ✭ 3,194 (+6843.48%)
Mutual labels:  real-time
Tosdatabridge
A collection of resources for pulling real-time streaming data off of TDAmeritrade's ThinkOrSwim(TOS) platform; providing C, C++, Java and Python interfaces.
Stars: ✭ 229 (+397.83%)
Mutual labels:  real-time
Gwion
🎵 strongly-timed musical programming language
Stars: ✭ 235 (+410.87%)
Mutual labels:  real-time
Rtm3d
Unofficial PyTorch implementation of "RTM3D: Real-time Monocular 3D Detection from Object Keypoints for Autonomous Driving" (ECCV 2020)
Stars: ✭ 211 (+358.7%)
Mutual labels:  real-time
DeepFaceLive
Real-time face swap for PC streaming or video calls
Stars: ✭ 7,917 (+17110.87%)
Mutual labels:  real-time
Gcc Nmf
Real-time GCC-NMF Blind Speech Separation and Enhancement
Stars: ✭ 231 (+402.17%)
Mutual labels:  real-time
Covid19 Tracker Cli
A curl-based command line tracker for Novel Coronavirus or COVID-19 pandemic. It Supports terminal for linux and macos, command prompt for windows, and termux for android with real-time updates.
Stars: ✭ 244 (+430.43%)
Mutual labels:  real-time
Caffe2 Ios
Caffe2 on iOS Real-time Demo. Test with Your Own Model and Photos.
Stars: ✭ 221 (+380.43%)
Mutual labels:  real-time
Deeppruner
DeepPruner: Learning Efficient Stereo Matching via Differentiable PatchMatch (ICCV 2019)
Stars: ✭ 226 (+391.3%)
Mutual labels:  real-time
Playgrounds
Better playgrounds that work both for Objective-C and Swift
Stars: ✭ 2,586 (+5521.74%)
Mutual labels:  real-time
Sanity
The Sanity Studio – Collaborate in real-time on structured content
Stars: ✭ 3,007 (+6436.96%)
Mutual labels:  real-time
Aresdb
A GPU-powered real-time analytics storage and query engine.
Stars: ✭ 2,814 (+6017.39%)
Mutual labels:  real-time
Yave
Yet Another Vulkan Engine
Stars: ✭ 211 (+358.7%)
Mutual labels:  real-time
Horaires Ratp Api
Webservice pour les horaires et trafic RATP en temps réel
Stars: ✭ 232 (+404.35%)
Mutual labels:  real-time
deadsfu
Dead-simple WebRTC broadcasting. From the browser, or your application. Cloud-native and scalable.
Stars: ✭ 23 (-50%)
Mutual labels:  real-time
Plotoptix
Data visualisation in Python based on OptiX 7.2 ray tracing framework.
Stars: ✭ 252 (+447.83%)
Mutual labels:  real-time
Plezi
Plezi - the Ruby framework for realtime web-apps, websockets and RESTful HTTP
Stars: ✭ 239 (+419.57%)
Mutual labels:  real-time
Disclamer: This project is not actively maintained anymore. Feel free to take on the idea and improve it if you choose so.

svgr

Redux over the wire

Aquedux is a Redux enhancer that enables seamless real-time synchronization across many JavaScript clients.

npm version npm version lerna Conventional Commits

Philosophy

With Aquedux, you can write your server code with the same logic than your web/native app. No need to use another library that forces you to add GraphQL or RESTfull endpoints. Everything is a Redux app.

Aquedux shares your App state across every connected instance. It can be a Node.js microservice, a React app, or anything that can depend on Redux.

It makes the writing of client and server app easy. There is no need to add another technical layer. If you know how to use Redux, you know how to use Aquedux.

For more on this, check out:

Installation

Aquedux

If you use Yarn

// Client side (aka browser & Redux app)
yarn add aquedux-client
// or
npm i aquedux-client

// Server side (aka Node.js & Redux app)
yarn add aquedux-server
// or
npm i aquedux-server

Redis

For the aquedux-server app to work, you have to install a Redis server on your machine. Don't worry, if you have never installed one, it is extremly simple:

  • On OSX: Install it with brew with brew install redis-server
  • On Linux: Install it with your system package manager. For instance, if it is apt, with apt-get install redis-server
  • On Windows: For windows you have two options, either download it from the redis website, or install it on your Ubuntu On Windows.

You don't have to configure anything, just running it. You should now have a running Redis instance.

Getting Started

Let see the required steps to integrate Aquedux in your current Redux workflow for the client and the server app.

The client app

import { applyMiddleware } from 'redux'
import { createStore, createAquedux, subscribe } from 'aquedux-client'

// The app reducer is shared with the server app.
import reducer from './reducers'

const aquedux = createAquedux({
  hydratedActionTypes: ['ADD_TODO', 'TOGGLE_TODO'],
  endpoint: 'http://localhost:3001/aquedux',
  channels: [ 'todos' ]
})
  
const store = createStore(reducer, applyMiddleware(aquedux));

/* 
** When subscribing to a channel you are telling Aquedux to receive all related actions in real-time.
** The first action you receive is the channel's state snapshot.
** In a real world app, this dispatch should be done in a container/component at route level or cDM.
*/
store.dispatch(subscribe('todos'))

The server app

import { createAqueduxServer, aqueduxMiddleware, aqueduxReducer } from 'aquedux-server'
import { createStore, applyMiddleware } from 'redux'
// The app reducer is shared with the client app.
import rootReducer from './reducers'

const appReducer = combineReducer({
  ...rootReducer,
  aquedux: aqueduxReducer
})

const todoTypes = ['ADD_TODO', 'TOGGLE_TODO']

const configureAquedux = (store) => {
  const aqueduxOptions = {
    hydratedActionTypes: todoTypes,
    secret: 'todoExample'
  }

  let server = createAqueduxServer(store, aqueduxOptions)

  /*
  ** The server-side channel definition.
  **
  ** It takes a name to identify it (same as for the front-side definition).
  ** It takes a predicate to filter action types related to it.
  ** It takes a reducer to translate the desired state into a snapshot for first front-side hydratation.
  ** The last argument is a key prefix used to store the channels action.
  */
  server.addChannel(
    'todos',
    action => todoTypes.indexOf(action.type) !== -1,
    getState => {
      const todos = getState().todos
      return todos
    },
    'todos'
  )

  return server;
}

// The middleware who is responsible for the front and back communication.
const enhancers = applyMiddleware(fromAquedux.aqueduxMiddleware)

const store = createStore(appReducer, {}, enhancers)

const aquedux = configureAquedux(store)

aquedux.start('localhost', 3031);

And you are good to go! For more help you can check out the example/ directory. You can also check out each package for their API documentation:

FAQ

  • Is it used somewhere?

At Winamax. It is used on two projects that helped shape Aquedux the way it is. We hope that by open-sourcing the project, it will sparkle others to create interesting stuff.

Authors

Thanks

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].