Skip to content

yinanfang/DBDCapital-Node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBDCapital-Node

Short Intro

Isomorphic Application

Dev Quick Start

    npm install -g flow-bin
    npm install

    # Upload env & SSL files from local. See key.txt for command

    make dev

    # Install correct eslint: https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb#eslint-config-airbnb-1

Production Quick Start

    # Fresh start
    make build && make pm2

    # Update & Restart
    make updateAndRestart

    # Update db if there's schema change. See key.txt for details

    ##############################################################################
    # Options
    # Start with babel-node
    sudo NODE_ENV=production ./node_modules/babel-cli/bin/babel-node.js server
    # One line start
    sudo pm2 start index.js --no-daemon
    # pm2 list
    sudo pm2 list
    # pm2 start with .json
    sudo pm2 start pm2_config.json

Unsecure dev page

Secure dev page

  • Add the following rule to /etc/hosts
# DBD Capital
127.0.0.1 dbd-capital.com
127.0.0.1 www.dbd-capital.com

Dependency update

    # Check available upgrades
    ncu
    # Take a look at the update and handle minor version updates first
    npm update
    # Check Github release updates and handle each major update carefully. Run the tests!
    ncu -u webpack
    npm update
    # Update package.json to include the previous minor version updates too
    ncu -a

MongoLab - Robomongo

    brew update && brew install mongodb
  • Kill mongod
    ps aux | grep mongo
    sudo kill #id

Linter setup

  $ npm install --save-dev eslint eslint-plugin-react babel-eslint eslint-config-airbnb
  Install linter-eslint and react from "Install"
  Completely close and restart Atom

Demo for external user NOT under the same wifi

  • Use global localtunnel instead of BrowserSync tunnel to avoid modifying webpack configuration
  • Guide:
    • comment out require https in server.js
    • make dev
    • lt --port 8080
  • Alternative: ngrok

Note

https://medium.com/@dan_abramov/react-components-elements-and-instances-90800811f8ca#.cx6foekli https://medium.com/@housecor/react-stateless-functional-components-nine-wins-you-might-have-overlooked-997b0d933dbc#.mzql1zm99

Unused packages

  • chai, chalk, color, passport, passport-local, precss, radium, yahoo-finance, reselect, glob, bcryptjs, mailcheck, mobile-detect, postcss-mixins, postcss-nested, postcss-simple-vars, prettyjson, react-event-listener, react-icons, react-responsive, react-timer-mixin, redux-persist, shelljs