This is the Bike Index
Bike registration that works: online, powerful, free.
Registering a bike only takes a few minutes and gives cyclists 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.
-
Ruby 2.2.5 (we use RVM)
-
PostgreSQL >= 9.4
-
Imagemagick (railscast)
-
Sidekiq, which requires Redis. The RailsCast on Resque is a good resource for getting up and running with Redis.
-
If you turn on caching locally: Dalli (railscast - you will need to install and start memcached
/usr/local/bin/memcached
) -
Requires 1gb of ram (or at least more than 512mb)
This explanation assumes you're familiar with developing Ruby on Rails applications.
-
bundle install
install gems -
rake db:setup
create and seed your database -
rake seed_test_users_and_bikes
to:- Add the three test user accounts: admin@example.com, member@example.com, user@example.com (all have password
please12
) - Give user@example.com 50 bikes
- Add the three test user accounts: admin@example.com, member@example.com, user@example.com (all have password
-
./start
start the server.- start is a bash script. It starts redis in the background and runs foreman with the dev procfile. If you need/prefer something else, do that
-
Go to localhost:3001
- if you want to use Pow (or some other setup that isn't through localhost:3001), change the appropriate values in session_store.rb and .env.
We use RSpec and Guard for testing.
-
Run the test suit in the background with
bundle exec guard
-
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
andpsql bikeindex_test
) and add the extension.
CREATE EXTENSION fuzzystrmatch;
- If you're working on frontend development, you can use Guard::LiveReload to reload the frontend as you work with
bundle exec guard -G Guardfile_frontend
For your convenience, this repository includes both a Cheffile and Vagrantfile which are used to automatically set up and configure a virtual local (Xenial) development environment with all of the required dependencies preinstalled and configured (via Chef, because Ruby) for anyone wishing to contribute without needing to set everything up beforehand. This explanation assumes you're somewhat familiar with Vagrant/VirtualBox, Chef, automation, et al.
-
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, then vagrant ssh
and cd /vagrant
, which will point to the root of this repository on your host machine. 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/Chef 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.
If the initial setup fails for any reason, try vagrant reload && vagrant provision
and see if the provision command completes without error. Please try to troubleshoot/google issues as much as possible before filing an issue. Be sure to include all relevant stdout messages and errors.
Have a bug or a feature request? Open a new issue.
Keep track of development and community news.
- Follow @bikeindex on Twitter.
- Read the Bike Index Blog.
Open a Pull request! The earlier you open the pull request, the earlier it's possible to discuss the direction of the changes.
If your pull request contains Ruby patches or features, you must include relevant rspec tests.
... and go hard