This is the scaffold of a react application project with express on the server side.
Clone the repo:
git clone [email protected]:full-stack/react-express-scaffold.git
cd app-name
Install yarn:
npm install -g yarn
Install dependencies:
yarn global add create-react-app
yarn
Start server:
# Start server
yarn start
# Selectively set DEBUG env var to get logs
yarn start:debug
Tests:
# Run tests written in ES6
yarn test
# Run test along with code coverage
yarn test:coverage
# Run tests on file change
yarn test:watch
# Run tests enforcing code coverage (configured via .istanbul.yml)
yarn test:check-coverage
Lint:
# Lint code with ESLint
yarn lint
# Run lint on any file change
yarn lint:watch
Other gulp tasks:
# Wipe out dist and coverage directory
gulp clean
# Default task: Wipes out dist and coverage directory. Compiles using babel.
gulp
# compile to ES5
1. yarn build
# upload dist/ to your server
2. scp -rp dist/* user@dest_ip:/appName
# install production dependencies only
3. yarn --production
# Use any process manager to start your services
4. pm2 start dest_ip/appName/pm2.config.js --watch