DataHub frontend
Clone or download
tanvirchahal Merge pull request #389 from datahq/home-dataset-link
[homepage][xs] - linked datahub homepage table with the dataset - #373
Latest commit dee5e79 Sep 19, 2018
Permalink
Failed to load latest commit information.
blog Added new ml datasets announcement blog post -refs datahq/pm#241 Sep 10, 2018
config [front page][s]: updated list of popular datasets - refs datahq/pm#131 Apr 2, 2018
lib [showcase][xs]: try catch errors when loading validation report Jul 9, 2018
public [homepage][xs] - linked datahub homepage table with the dataset - #373 Sep 19, 2018
routes [collections][sm] - fixed route issues - #371 Sep 11, 2018
tests [collections][sm] - updated tests files - #371 Sep 11, 2018
views [homepage][xs] - linked datahub homepage table with the dataset - #373 Sep 19, 2018
.dockerignore .dockerignore Nov 3, 2017
.gitignore [gitignore][xs]: gitignore. Aug 22, 2017
.gitmodules [submodule][xs]: updated url for dpr-js submodule Oct 28, 2017
.travis.yml [setup][xs]: trying to debug error in testing env so using yarn and f… Jun 17, 2018
Dockerfile [docker][xs]: installing dependencie for puppeteer Jul 2, 2018
LICENSE Initial commit Jun 23, 2017
README.md [puppeteer][xs]: use different settings on alpine and on local dev Jun 30, 2018
env.template [config][s]: from now using .env file for setting up environment vari… Jul 9, 2017
index.js [premium data][s]: track successful form submissions from server-side… Aug 29, 2018
package-lock.json Updated request form fields Jul 3, 2018
package.json [dev][s]: always convert Windows backslashes to forward slash - refs #… Jul 8, 2018
yarn.lock [dev][s]: always convert Windows backslashes to forward slash - refs #… Jul 8, 2018

README.md

DataHub frontend in node.js.

Build Status

Quick Start

Clone the repo, install dependencies using yarn (or npm), and run the server:

# or npm install
yarn install
npm start

Env vars

We use .env file for loading environment variables. Please, use provided env.template as a template:

  • SITE_URL - FQ base URL of the site e.g. https://datahub.io
  • API_URL - FQ base URL of the API endpoint eg. https://api.datahub.io
  • BITSTORE_URL - base URL for the bitstore (pkgstore) e.g. https://pkgstore.datahub.io

When running locally, use test api address in .env:

API_URL=https://api-testing.datahub.io
BITSTORE_URL=https://pkgstore-testing.datahub.io

See the docs for more information.

Developers

The javascript portion of the app, which is responsible for rendering views, comes from a different repo. That repo must be submoduled in and then built:

git submodule init && git submodule update

To build the CSS:

  1. Install sass

  2. Run:

    sass --watch public/sass:public/stylesheets

Now run the server:

export API_URL=https://api.datahub.io
export BITSTORE_URL=https://pkgstore.datahub.io
export dev=true
npm start

To run in watch mode:

# note the -e which means we watch for changes in templates too
nodemon -e "js html" index.js

To run tests (make sure all environment variables are set):

yarn test

Analytics

We use Google Tag Manager to manage all tags (eg, google analytics, optimize and more) so instead of adding a new script into templates, you should consider editing via UI of Tag Manager.