Skip to content

Application starter template, for implementing isomorphic widgets, using RxJS and React

Notifications You must be signed in to change notification settings

zxbodya/reactive-widgets

Repository files navigation

Reactive widgets

Application starter template, for implementing isomorphic widgets(same code for both server and client side), using RxJS and React

It is build on top of following great projects:

  • React for a view layer
  • RxJS for data layer, and composing asynchronous components
  • Webpack to bundle client and server side scripts
  • Babel to use next generation JavaScript, today.
  • Express.JS for serving prerender application
  • SuperAgent for AJAX requests to API
  • Karma with Jasmine for tests
  • ESLint to watch for coding style issues

For now, application includes following:

  • Utility class RxComponent, to render and combine react components asynchronously in reactive way(a gist about it)
  • DI Container, inspire by https://github.com/angular/di.js but a lot simplified
  • Application for server side components rendering
  • Example of PHP application that uses components
  • Simple widget example

Requirements

  • nodejs
  • for dev environment, pm2 (npm i -g pm2 to install it)
  • PHP v5.4 for server side example and composer to install dependencies

Setup

  1. Install dependencies: npm i
  2. Build project npm run build
  3. Start prerender server: node ./build/server/server.js

Dev environment

  1. start webpack dev server for client-side bundle npm run dev-server(it will watch for changes and automatically recompile scripts and reload page)
  2. start webpack watcher for server bundle npm run watch-prerender
  3. preprender server, using pm2:
  • start pm2 start --watch --name widgets ./build/server/server.js (it will automatically watch for changes in compiled scrip and reload)
  • stop pm2 delete widgets
  1. test it npm run test
  2. lint it npm run lint

PHP server demo that will use implemented widgets

example is in php folder, to try it:

  1. composer install install dependencies, using composer
  2. start php built in server php -S 127.0.0.1:4000
  3. navigate to http:https://127.0.0.1/ to see results

About

Application starter template, for implementing isomorphic widgets, using RxJS and React

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published