npm install
npm start
Note : Please make sure your MongoDB is running. For MongoDB installation guide see this. Also npm3
is required to install dependencies properly.
-
npm run start
- starts the development server with hot reloading enabled -
npm run bs
- bundles the code and starts the production server -
npm run test
- start the test runner -
npm run watch:test
- start the test runner with watch mode -
npm run cover
- generates test coverage report -
npm run lint
- runs linter to check fo
TotoApp uses Webpack for bundling modules. There are four types of Webpack configs provided webpack.config.dev.js
(for development), webpack.config.prod.js
(for production), webpack.config.server.js
(for bundling server in production) and webpack.config.babel.js
(for babel-plugin-webpack-loaders for server rendering of assets included through webpack).
The Webpack configuration is minimal and beginner-friendly. You can customise and add more features to it for production build.
TotoApp uses the express web application framework. Our app sits in server/server.js
where we check for NODE_ENV
.
If NODE_ENV is development, we apply Webpack middlewares for bundling and Hot Module Replacement.
The client directory contains all the shared components, routes, modules.
This folder contains all the common components which are used throughout the project.
Index.js simply does client side rendering using the data provided from window.__INITIAL_STATE__
.
We use babel to transpile code in both server and client with the stage-0
plugin. So, you can use both ES6 and experimental ES7 features.
There are docker configurations for both development and production.
To run docker for development,
docker-compose -f docker-compose-development.yml build
docker-compose -f docker-compose-development.yml up
To run docker for production,
docker-compose build
docker-compose up