If you want a complete stack with proper integration to the backend, please refer to Redux + GraphQL or Relay + GraphQL tutorials. This seed project is provided for those who want to build their own setup with the most minimal integrations (React Router and a simple Express server). If you wish to create distributables please continue reading this section and then head over to the next section.
You need NodeJS installed. Download the latest version of NodeJS (recommended 6.3.1 or above) from here: http://nodejs.org/
If you are on Windows, you need to setup your system to be able to compile Node native modules. There are two options available:
Option 1 (recommended): Install all the required tools and configurations using Microsoft's windows-build-tools for compiling Node modules. To do that just run:
npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).
Option 2: Install tools and configuration manually:
Visual C++ Build Environment:
Option 1: Install Visual C++ Build Tools using the Default Install option.
Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup. This also works with the free Community and Express for Desktop editions.
Install Python 2.7 (v3.x.x is not supported), and run
npm config set python python2.7
npm config set msvs_version 2015
Once you have NodeJS installed, open a terminal/command prompt and change the current working directory to the rubix/node-seed directory in your downloaded Rubix folder like so (on Windows you would need to replace the backward slash "/" with the forward slash ""):
$ cd rubix/node-seed
Then install all NPM dependencies:
$ npm install
You may get some deprecation warnings as well as peerDependency warnings in your terminal while/after the NPM installation. Please ignore those warnings.
Once installed, launch the web server like so:
$ npm run dev -s
After the startup compilation finishes, you should get a message in your terminal saying "Node.js app is running at http://localhost:8080". Once you get the message, navigate to http://localhost:8080 in your browser.
A dashboard should render with a message saying: "Hello, World!".
All React source files are stored in
src folder with the entrypoint being
src/main.js. The routes are defined in
src/routes.js. Plugins are defined in
src/plugins.js. The Sidebar, Header and Footer reside in
src/common. All pages are defined in
SASS files are stored in
sass/main.scss file being the entrypoint.
For more NPM Launch Options (like running development server on remote instance, generating sourcemaps, generating production builds, testing, RTL support etc) click here: Launch Options