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
- nodejs
- for dev environment, pm2 (
npm i -g pm2
to install it) - PHP v5.4 for server side example and composer to install dependencies
- Install dependencies:
npm i
- Build project
npm run build
- Start prerender server:
node ./build/server/server.js
- start webpack dev server for client-side bundle
npm run dev-server
(it will watch for changes and automatically recompile scripts and reload page) - start webpack watcher for server bundle
npm run watch-prerender
- 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
- test it
npm run test
- lint it
npm run lint
example is in php folder, to try it:
composer install
install dependencies, using composer- start php built in server
php -S 127.0.0.1:4000
- navigate to http:https://127.0.0.1/ to see results