To run this locally, clone this repo and cd
in the project directory
- Create a file secrets.js at the root of the project with the following info:
module.exports = { MONGO_URI: 'mongodb://localhost:27017/website', OAUTH_CLIENT_ID: 'google-clientid', CLIENT_SECRET: 'google-client-secret', JWT_SECRET: 'your jwt secret' }
-
Make a file
constants/apiKeys.js
with the following contents:module.exports = { 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
-
Production server
yarn start
-
Cluster with PM2
pm2 start process.json
-
Reload PM2 (zero downtime updates)
pm2 reload process.json
Assuming the website is running on localhost:3000
- 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
secrets.js
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