Skip to content
All the code for the Bike Index, because we love you
Ruby HTML CSS JavaScript CoffeeScript Shell
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Add external registry search results (#1190) Sep 3, 2019
.cloud66 Put some extra stuff in here that's required for deployment (#737) May 2, 2019
app Add how to file a police report information (#1273) Sep 18, 2019
bin Add terminal notifier, growlnotify (#1242) Sep 10, 2019
config merge to unblock translation Sep 18, 2019
db Complete contact_type data migration (#1269) Sep 18, 2019
lib Migrate customer_contacts.contact_type to kind enum (#1268) Sep 18, 2019
log added gitignore May 31, 2014
public accept bulk uploads from ascend (#536) Feb 9, 2019
script put script back in Oct 23, 2014
spec Complete contact_type data migration (#1269) Sep 18, 2019
.babelrc Multiple serial search with React. Upgrades webpack, webpacker, and a… Apr 10, 2019
.codeclimate.yml Update guard, rufo, Guardfile, CodeClimate config (#886) Jun 13, 2019
.editorconfig Consistify whitespace, code style in Ruby, CoffeeScript, SCSS (#711) Apr 24, 2019
.env Add stolen bike twitter alerts (#1236) Sep 11, 2019
.eslintignore Update /stolen page (#682) Apr 11, 2019
.eslintrc.json Update guard, rufo, Guardfile, CodeClimate config (#886) Jun 13, 2019
.gitignore Maintain legacy Guardfile (#888) Jun 14, 2019
.nvmrc Add partner data field to users (#468) Nov 30, 2018
.postcssrc.yml Add webpacker - fix #450 (#464) Nov 26, 2018
.rspec Optimize test suite, CI config (#866) Jun 9, 2019
.rspec_parallel Optimize test suite, CI config (#866) Jun 9, 2019
.rubocop.yml Update guard, rufo, Guardfile, CodeClimate config (#886) Jun 13, 2019
Gemfile Add terminal notifier, growlnotify (#1242) Sep 10, 2019
Gemfile.lock Add background job monitoring from skylight (#1248) Sep 11, 2019
Guardfile Add directories statement to guardfiles (#891) Jun 14, 2019
Guardfile_parallel Add directories statement to guardfiles (#891) Jun 14, 2019
LICENSE ... and we're open! Aug 7, 2013
Procfile switch to unicorn Aug 3, 2016
Procfile_development Optimize test suite, CI config (#866) Jun 9, 2019
README.markdown Add translation sync build step (#1100) Jul 31, 2019
Rakefile Consistify whitespace, code style in Ruby, CoffeeScript, SCSS (#711) Apr 24, 2019
Vagrantfile Update Ruby version in Vagrantfile (#1142) Aug 6, 2019
bike_index.png srsly, stop failing travis Nov 12, 2014
config.ru switch to unicorn Aug 3, 2016
jest.config.js Add external registry search results (#1190) Sep 3, 2019
package.json Add JS for new admin layout/News views (#931) Jul 25, 2019
start Optimize test suite, CI config (#866) Jun 9, 2019
yarn.lock Add JS for new admin layout/News views (#931) Jul 25, 2019

README.markdown

BIKE INDEX Cloud66 Deployment Status CircleCI Test Coverage View performance data on Skylight

Bike registration that works: online, powerful, free.

Registering a 🚲 only takes a few minutes and gives 🚴‍♀️ a permanent record linked to their identity that proves ownership in the case of a theft.

We're an open source project. Take a gander through our code, report bugs, or download it and run it locally.

Dependencies

Running Bike Index locally

This explanation assumes you're familiar with developing Ruby on Rails applications.

Toggle in development command default
Spring bin/rake dev:spring disabled
Caching bin/rake dev:cache disabled
letter_opener bin/rake dev:letter_opener enabled

Translation

We're using translation.io to manage internationalization: translation.io/bikeindex/bike_index

To contribute, sign up for an account there and ask to be added to the project as a translator.

Non-English translation files should be treated as read-only. We sync these with our translation.io project

If you modify the English translation file config/locales/en.yml, run:

bin/rake prepare_translations

before pushing to GitHub. This will normalize translation file formatting and check for missing or unused keys.

Syncing Translations

When building master, we check for un-synced translations and, if any are found, stop the build and open a PR to master with the translation updates. (See #1100 for details.)

To update the keys on translation.io, run bin/rake translation:sync (requires having an active API key locally).

Testing

We use RSpec and Guard for testing.

  • Run the test suite continuously in the background with bin/guard (watches for file changes/saves and runs those specs)

  • You may have to manually add the fuzzystrmatch extension, which we use for near serial searches, to your databases. The migration should take care of this but sometimes doesn't. Open the databases in postgres (psql bikeindex_development and psql bikeindex_test) and add the extension.

    CREATE EXTENSION fuzzystrmatch;

We use parallel_tests to run the test suite in parallel. By default, this will spawn one process per CPU in your computer.

  • Run all the tests in parallel with bin/rake parallel:spec

  • Run bin/rake parallel:prepare to synchronize the test db schema after migrations (rather than db:test:prepare).

  • Run specific files or test directories with bin/parallel_rspec <FILES_OR_FOLDERS>

  • Run Guard with parallelism bin/guard -G Guardfile_parallel

Code Hygiene

We use the following tools to automate code formatting and linting:

EditorConfig

EditorConfig ensures whitespace consistency. See the Download a Plugin section of the EditorConfig docs to find a plugin appropriate to your editor.

Rufo

Rufo is an opinionated Ruby formatter we use to maintain consistent style with minimum configuration. See the Editor support section of the project README to find a suitable editor plugin.

RuboCop

RuboCop is configured to ignore Ruby style and layout (deferring to Rufo) and focus on code complexity, performance, and suggested best practices.

To run it from the command line, issue bin/rubocop, optionally passing a specific file(s). For a performance boost, you can also start a rubocop daemon with bundle exec rubocop-daemon start, in which case you'd lint with bundle exec rubocop-daemon exec.

See the Editor integration section of the rubocop docs to find an appropriate plugin for on-the-fly linting.

ESLint

ESlint is configured to run on project JavaScript. To run it, issue yarn lint.

Vagrant development box

In general, we recommend installing and running the app without Vagrant for local development

If, however, you would prefer to have a virtual environment, this repository contains a Vagrantfile which is used to automatically set up and configure a virtual local (Ubuntu Xenial) development environment with all of the required dependencies preinstalled.

Dependencies/Requirements

  • A computer that supports hardware virtualization (Intel VT-x/AMD-V)

  • Vagrant

  • VirtualBox

  • At least 1.5GB of free memory

Run vagrant up to start the virtual machine. Upon first run, it will run various provisioning scripts to install all of the required packages, configure PostgreSQL, and run all of the Ruby commands to initalize a local Bike Index dev environment. Port 3001 is forwarded locally for testing. Be warned, it will take around a half hour or longer (depending on your internet connection) on first run to download additional Vagrant dependencies and to provision the dev environment. You may observe some informational warning messages during the initial setup which you can safely ignore. vagrant halt to shutdown the VM. Subsequent startups will take considerably less time after the initial run.

Troubleshooting

If the initial provisioning fails for any reason, try running vagrant provision and see if running the provisioner again completes without error. If not, please try to troubleshoot/google issues as much as possible before filing an issue. Many Vagrant related errors/issues have already been solved and are documented between Stackoverflow and Github. If you run in to an issue you're unable to solve, be sure to include all relevant stdout messages and errors.

Bug tracker

Have a bug or a feature request? Open an issue.

Community

Keep track of development and community news.

Contributing

Open a Pull request!

Don't wait until you have a finished feature before before opening the PR, unfinished pull requests are welcome! The earlier you open the pull request, the earlier it's possible to discuss the direction of the changes.

Once the PR is ready for review, request review from the relevant person.

If your pull request contains Ruby patches or features, you must include relevant Rspec tests.

... and go hard

You can’t perform that action at this time.