Skip to content

bikeindex/bikebook

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

#BikeBook.io BikeBook.io

Compare bikes!

Research bikes!

Open source everything!

Technical

BikeBook.io is a single page web application that accesses default bike information through it's own RESTfull JSON API.

This repository contains the web application and also all of the of bike data. All the data is stored in flat files, BikeBook just reads the file you requested.

How?

Simple.

Send a query with field value pairs, get shit back.

There are three main requests you can make:

  • Get a list of all the unique model names a manufacturer has produced
  • Get a list of models from a manufacturer by year
  • Get information about a bike

Get unique models

Send a query with a manufacturer to BikeBook.io/model_list

So for Heritage cycles, BikeBook.io/model_list?manufacturer=Heritage cycles

Get models by year

Send a query with manufacturer to BikeBook.io

So for Cinelli, BikeBook.io?manufacturer=Cinelli

If you submit a year in the request, the response is an array of the model names from that year (not wrapped in a hash), eg BikeBook.io?manufacturer=Cinelli&year=2014

For all the manufacturers and all the years, BikeBook.io/assets/index.json

Get Information about a bike

You need to submit three things to get information about a bike: manufacturer, year and frame_model.

So for a Fuji Outland 29 1.1 from 2014,

BikeBook.io?manufacturer=fuji&year=2014&frame_model=Outland 29 1.1

Also, since it's a query string, position of the key doesn't matter, i.e. frame_model can come first or last.

Errors

If we can't find what you've asked for, we return a 404 status error. We might put something fun in the body, we might not, deal with it.

Requests

Feel free to make GET requests to BikeBook from your application. We'll send you JSON back, regardless of your domain.

BikeBook.io uses Cross-Origin Resource Sharing (CORS), which allows web applications to make cross domain AJAX calls without using bullshit like JSONP. For more information read this post about CORS (or the spec if you're hardcore).

Dev, local, party

Contributing

All the bike data is stored this repository in JSON files. So if you see a mistake or want to update something, do it!

Running it

Locally we use rerun to restart the app on changes. Launch the app in development mode with rerun 'rackup'. You can run the tests with rerun 'rake spec' (sometimes this breaks and infinitely reloops. Srys.)

Asset compilation with sass --watch assets/styles/style.scss:public/site.css and coffee -cw -o public/ assets/scripts/site.coffee, lazy for now.

Every time you change the filesystem you have to refresh the indexes with rake refresh because, flat files.

p.s.

Built with all the love by the Bike Index.

About

Open source bicycle comparison

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published