#About
This is a boilerplate for new apps using a specific technology stack. It contains:
ReactJSfor rendering componentsReduxfor managing application state (client data store)
node.jsweb serverexpress.jsframework for app structure, routing, etc.
#Installation
- Install and configure node-gyp
- Fork the original repository
- Clone your forked repository
git clone https://github.com/<yourusername>/IMReactStack - Open cmd in
folderand run: git remote add upstream https://github.com/ionutmandra/IMReactStacknpm inpm i gulp-cli -gnpm i nodemon -gnpm i mocha -g- If node version has been updated run
npm rebuild
You can do one of the following:
- run
start.batinfolder(optionally create a shortcut to it inStartupto have it run on Windows startup)
- or -
- open 2 consoles in
folderand run: nodemon server(console 1)gulp(console 2)
- run
gulp deploy. This will:- minify css
- uglify and minify source code
- take off source maps
- set process.env.NODE_ENV = 'production', so react code knows it's in production mode (https://facebook.github.io/react/downloads.html)
- run unit tests
- open browser to localhost:8080 (or what the port says in the
nodemonconsole)
#Editor (optional)
-
install Sublime Text 3
-
Preferences > Settings-usershould contain this (possibly among other settings):{... "folder_exclude_patterns": [ ".svn", ".git", ".hg", "CVS", "node_modules" ], ...} -
Preferences > Key bindings-User- add these:[ { "keys": ["ctrl+m"], "command": "reindent" }, { "keys": ["ctrl+-"], "command": "jump_back" }, ] -
install the package manager (
Ctrl + ~then paste the code from theSublime text 3tab) -
Ctrl + Shift + P > Package control: Install Package> installReactJS -
Ctrl + Shift + P > Package control: Install Package> installBabel -
File > Open folder- Selectfolder -
open any
.jsfile thenView > Syntax > Open all with current extension as > Babel > Javascript (babel)- for correct syntax checking