Skip to content

Latest commit

 

History

History
128 lines (86 loc) · 4.44 KB

CONTRIBUTING.md

File metadata and controls

128 lines (86 loc) · 4.44 KB

Contributing to ABE

👍🎉 First off, thanks for taking the time to contribute to ABE! 🎉👍

Help Needed

Please check out the the open issues.

Project setup

Clone This Repo

You first need to clone the code from this repository to your computer. To do that, run the following:

git clone https://github.com/olin-build/abe-web.git
cd abe-web

Install Node.js and yarn

Then you'll need to install the Node.js server and a package manager (yarn).

Install nodejs from here, and yarn here.

On macOS running Homebrew, you can install both nodejs and yarn via brew install yarn.

On Ubuntu:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
nvm install node
nvm use node
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn

Install Package Dependencies

Once you have Node installed, you can use yarn to install the necessary packages (read from package.json).

cd into the abe-web directory that the git clone command, above, created, and run yarn install:

cd abe-web
yarn install

(Optional) Configure Environment variables

Certain environment variables may be set before running the server. In particular, set ABE_URL to the URL of an ABE server.

  • ABE_URL (optional) - the URL of the ABE back-end instance you'd like to connect to. (Please use a dev instance when developing.) This defaults to http://localhost:3000/, which is the URL of a local ABE server instance.
  • DEBUG (optional) - set to true to use the Redux devtools
  • GA_ID (optional) - set to your Google Analytics tracking ID

Set these variables by setting environment variables, or by creating a text file called .env in the root of the repository.

If you are a member of Hacking the Library, use this starter .env file.

Otherwise, create your own .env file. You may copy .env.template to .env and the values in that file.

Run

To launch the web app, make sure you have a local ABE instance running on port 3000 (go to https://github.com/olin-build/ABE for instructions on how to run ABE) and run the following:

yarn dev

Then visit http://localhost:8080/ in your browser.

Changes should be reflected in your browser every time you save a file (except CSS files, which currently require a manual refresh), but it may take a couple seconds for Webpack to recompile everything.

Test

yarn test runs Jest.

yarn test --watch runs Jest in watch mode. Jest will run until you press q, and re-run the tests when a source file changes.

yarn test --coverage creates a test coverage report. View the HTML at ./coverage/lcov-report/index.html.

Lint

yarn lint runs ESLint. This verifies that the code matches the project style conventions — mostly the Airbnb JavaScript style guide, with some exceptions.

yarn format fixes some lint errors, such as indentation and spacing.

Built With

A familiarity with some of these technologies is helpful for working on the project, although by no means do you need to know all of them to work on just some parts.

General web development:

  • React lets JavaScript code create and update HTML presentation elements.
  • Redux enables a reactive programming style.
  • Babel enables modern JavaScript features on older browsers.
  • The Ionic Framework is a software development kit for mobile web views (and native apps). Thie project uses CSS files from the framework.

For working on the server or the build system:

  • Node.js runs JavaScript on the server.
  • Webpack combines and optimizes source files.