To run this locally, clone this repo and cd
in the project directory
-
echo "MONGO_URI=mongodb://localhost:27017/website PORT=3001 REDIS_HOST='127.0.0.1' REDIS_PORT=6379 REDIS_PASSWORD='' OAUTH_CLIENT_ID='your-google-oauth-client-id' CLIENT_SECRET='your-google-ouath-client-secret' JWT_SECRET='your-jwt-secret' GMAIL_USER='gmail-email' GMAIL_PASS='gmail-pass' ELASTIC_URL='elastic-url'" > .env
(* The server uses NodeMailer to send emails to admins!) -
Make a file
constants/apiKeys.js
with the following contents:export default { TINY_MCE_API_KEY: 'your-api-key', WIDGETPACK_PLUGIN_ID: 'your-plugin-id', GTAG_ID: 'your-google-tag-id' };
- For the first time execution, run
node init.js
-
Install packages with
yarn
-
Development server
yarn dev
-
Production build
yarn build
-
Staging server
yarn start:stag
-
Production server
yarn start
-
Cluster with PM2
pm2 start process.json
-
Reload PM2 (zero downtime updates)
pm2 reload process.json
For server,
yarn run analyse-server
For client,
yarn run analyse-client
- Go to https://console.developers.google.com/ and create an OAUTH2 Api key for web. Specify localhost:3000 as authorized origin and localhost:3000/auth/redirect as redirect URI.
- Copy the client id and secret into .env file.
- Go to localhost:3000/auth/login and you should be able to login with email that you specified earlier when doing
node init.js