Realtime backend for React/Redux app in one file - thanks to Meteor and DDP ;)


#1

I’ve found some time to play with DDP and Redux. Here I use Meteor as a backend only. So I am able to use all the cool stuff for which I am used to like PostCSS, CSSModules for React, old good testing solutions, HMR and all Webpack functionality, but also powerful realtime Meteor backend.

Just sharing the results in simple demo: https://github.com/juliancwirko/react-redux-webpack-meteor (…it needs cleaning and some demo tests like here in the boilerplate).

All is based on one Meteor file (server side). Asteroid DDP client and my React boilerplate.


Redux and Meteor
Using React and Redux (and Webpack) in the frontend and Meteor (only) in the backend
#2

Could be a great way to integrate with Apollo Client as well, which is based on Redux. That way you can use one container and dev tools for your client data, reactive Meteor data, and GraphQL data!


#3

I like this, however I guess the weakness is any collection change causes a fetch over the wire of the entire collection


#4

yeah, this is just an example. It could be adjusted. I like the control. In most cases I don’t need pub/sub in apps so I can remove asteroid.ddp.on(…) listeners and it will work quite good with only methods triggered by Redux actions. You will just need to refetch the data by yourself if needed. I think pub/sub is really needed in apps like real time messaging etc.

Anyway, this is just my free time demo app (few hours work).
I would love to build something with this architecture and find out all weaknesses :slight_smile:

Also, based only on this I think I’ll fall in love with Apollo Stack :wink:


#5

Blog post about it: React with Webpack + Meteor as a backend