.
├── /components/ # Shared or generic UI components
│ ├── /Button/ # Button component
│ ├── /Layout/ # Website layout component
│ ├── /Link / # Link component to be used insted of <a>
│ └── /... # etc.
├── /core/ # Core framework
│ ├── /history.js # Handles client-side navigation
│ ├── /router.js # Handles routing and data fetching
│ └── /store.js # Application state manager (Redux)
├── /node_modules/ # 3rd-party libraries and utilities
├── /pages/ # React components for web pages
│ ├── /about/ # About page
│ ├── /error/ # Error page
│ ├── /home/ # Home page
│ └── /... # etc.
├── /public/ # Static files such as favicon.ico etc.
│ ├── /dist/ # The folder for compiled output
│ ├── favicon.ico # Application icon to be displayed in bookmarks
│ ├── robots.txt # Instructions for search engine crawlers
│ └── /... # etc.
├── /test/ # Unit and integration tests
├── /utils/ # Utility and helper classes
│── main.js # React application entry point
│── package.json # The list of project dependencies and NPM scripts
│── routes.json # This list of application routes
│── run.js # Build automation script, e.g. `node run build`
└── webpack.config.js # Bundling and optimization settings for Webpack
Step 1. Make sure that you have Node.js v6 or newer installed on your machine.
Step 2. Install:
$ cd <<APP>>
$ npm install # Install project dependencies listed in package.json
Step 3. Compile and launch your app by running:
$ node run # Same as `npm start` or `node run start`
You can also test your app in release (production) mode by running node run start --release
or
with HMR and React Hot Loader disabled by running node run start --no-hmr
. The app should become
available at http://localhost:3000/.
If you need just to build the project without publishing it, run:
$ node run build # Or, `node run build --release` for production build