Code Monkey home page Code Monkey logo

frontend's Introduction

Table of contents


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 the 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, e.g. 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.

Deployment

  1. When pushing any commit to the master branch, it triggers a build on the Deploy repo which then creates a pull request there.
  2. The changes in frontend are auto deployed to the staging site of DataHub, located at https://testing.datahub.io.
  3. Once the staging site looks as expected, deployment to production happens by merging the automatically created pull request from step 1.
  4. That's it! Just wait for about 5 minutes and you should be able to see the changes reflected on DataHub.io.

frontend's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.