Giter Club home page Giter Club logo

webcompat-metrics-client's Introduction

CircleCI status travis status appveyor status PRs Welcome

webcompat-metrics is a JavaScript application using Next.js and React to power metrics for webcompat.com

Quick Setup

git clone https://github.com/webcompat/webcompat-metrics-client.git

cd webcompat-metrics-client

yarn
yarn dev
# or
npm install
npm run dev
# Go to http://localhost:3001

Production

yarn build
yarn start
# or
npm run build
npm run start
# Go to http://localhost:3001

Configuration

Environment variables

You can create a .env file (or copy .env.example) and modify variables, make sure variables are all set.

By default .env.local is loaded and injected through the Next.js configuration.

Testing

For testing DOM, React components, and other JavaScript, we use Jest, Enzyme and Sinon.JS.

For the linting JavaScript process, we use Prettier and Eslint.

For the linting CSS process, we use stylelint.

You can test the full application locally with:

# for all tests
npm run test
# or
yarn test
# only do linting:
npm run lint
# or
yarn lint
# only run DOM/React tests:
npm run test:jest
# or
yarn test:jest

If your changes will alter the appearance of any views, be sure to update the Jest snapshots before running tests:

npm run test:jest -- -u

How to Add a New Dashboard

  1. Add an endpoint for the new dashboard in src/routes/index.js.

  2. Add a new container directory for your dashboard in the src/containers/ directory, and build a container for it using theMetricsTemplate model.

  3. Add at least one test for your new dashboard container in a __tests__ directory inside your container directory.

  4. Add a new page in src/pages.

  5. Import your new dashboard component to your new page in src/pages.

  6. Update the Jest snapshots so that they will include your new dashboard views -- as shown in the testing section.

Webcompat has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

License

MPL 2

webcompat-metrics-client's People

Contributors

magsout avatar dependabot-preview[bot] avatar dependabot[bot] avatar greenkeeper[bot] avatar laghee avatar karlcow avatar ksy36 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.