Giter Club home page Giter Club logo

check-web's Introduction

Check Web

Travis

Verify breaking news online.

Overview

This is the web client of Check.

Dependencies

Installation

If you are just getting started, you probably want to install the full Check stack with Docker.

The full Check environment will install Node packages into an invisible node_modules/ directory. Instead of using npm run ..., run docker-compose exec web npm run ... to run in the Docker container: the Docker container can see the node_modules/ directory.

Watching for changes

The dev-mode Docker container will watch for file changes in src/ and rebuild whenever a file changes. It will output a message (success or error) after each rebuild.

Localization

Translations are managed in Transifex. All the contents are stored in the localization directory which contains the following subfolders:

  • localization/react-intl: files extracted by babel-plugin-react-intl (localizable strings)
  • localization/transifex: files above, but converted to Transifex JSON format
  • localization/translations: files downloaded from Transifex in JavaScript format

The application is displayed in the browser's language using the files from the localization directory.

Developing

Adding a new language

Copy config-build.js.example to config-build.js (if you don't have it yet) and add your Transifex user and password.

Then you can use npm run transifex:upload and npm run transifex:download to upload and download translations, respectively.

Maintaining package-lock.json

Run docker-compose exec web npm install [--save-dev] MODULE [...]. This will overwrite package-lock.json. Commit and deploy package-lock.json alongside any change to package.json.

Publishing meedan-maintained modules to npmjs.org

(For Meedan employees.) If:

  • You are a member of the Meedan npmjs org; and
  • You mean to install a fork of a buggy JavaScript module -- or a new module

Then publish it to npm. Name the module @meedan/name-of-my-module (in its package.json) and then npm publish. After, you may docker-compose exec web npm install [--save-dev] MODULE to use it in check-web.

Integration tests

Running

  • Start the test environment in the check repo: docker-compose -f docker-compose.yml -f docker-test.yml up
  • Copy test/config.yml.example to test/config.yml and set the configurations
  • Copy test/config.js.example to test/config.js and set the configurations
  • Run docker-compose exec web npm test:integration

Writing

  • Use API calls (instead of using Selenium) to create all test data you need before the real thing that the test is testing
  • Tag the test with one of the existing tags

Unit tests

  • Run docker-compose exec web npm run test:unit

Missing tests

If you don't have time to implement an integration test for your feature, please add a pending test for that, like this:

it "should do whatever my feature expects" do
  skip("Needs to be implemented")
end

In order to implement a pending unit test, do this:

it("should do whatever my unit expects");

Notes and tips

  • Remove your node_modules directory if you face errors related to npm install

check-web's People

Contributors

adamhooper avatar ahmednasserswe avatar amoedoamorim avatar bnfinet avatar caiosba avatar cesargdm avatar clarissacastella avatar danielafeitosa avatar danielevalverde avatar dependabot[bot] avatar hfikry92 avatar huslage avatar infojunkie avatar laurian avatar melsawy avatar mhamzawey avatar zda avatar

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.