Skip to content

steenhansen/Isomorphic-React-on-Heroku

Repository files navigation

Isomorphic-React-on-Heroku takes a Google Sheet and saves the data in a MongoDB Atlas database to produce isomorphic Html/JavaScript via Node.js which is then injected into a non-cached WordPress page.

Here are all three media types:

PDF WordPress page with injected HTML/JavaScript

RSD WordPress page with injected HTML/JavaScript

Podcast WordPress page with injected HTML/JavaScript

Output

Heroku Environment Variables:

Heroku Config Variables

System Setup:

  • Download Node.js with npm

  • If '$ python --version' yeilds an error then install Python and add Python to global System variables PATH

  • If '$ git --version' yields an error then install command line Git and add '...Git/cmd' to global System variables PATH

  • npm install --global gulp-cli

  • npm install --global webpack

  • npm install --global webpack-cli

  • Get a MongoDb Atlas database

  • Download MongoDB Compass to view Atlas databases

Install:

  • $ npm install

  • $ npm install --force // --force stops "npm WARN notsup SKIPPING OPTIONAL DEPENDENCY"

Build:

  • $ gulp all

Test:

  • $ gulp test --test-isomorphic-react-credentials.js // db secrets from outiside git repo

  • NB, since tests are not local sometimes one or two tests fail because of timeouts; re-run

Launch:

  • $ npm start // start on Heroku, secrets in 'process.env'

  • $ npm start -- real-isomorphic-react-credentials.js // start locally, db secrets from outiside git repo

  • $ npm start -- test-isomorphic-react-credentials.js

Cron:

  • $ node run-cron rsd real-isomorphic-react-credentials.js

  • $ node run-cron pdf real-isomorphic-react-credentials.js

  • $ node run-cron podcast real-isomorphic-react-credentials.js

  • $ node run-cron rsd test-isomorphic-react-credentials.js

  • $ node run-cron pdf test-isomorphic-react-credentials.js

  • $ node run-cron podcast test-isomorphic-react-credentials.js

Heroku Scheduler

Load db ( user/pass ):

View:

Examples:

3212 a town like alice 20209 documents

Releases

No releases published

Packages

No packages published

Languages