Skip to content
Open source marketplace platform
Ruby HTML JavaScript CSS Cucumber Shell
Latest commit b941aa0 Jun 27, 2016 @rap1ds rap1ds committed on GitHub Merge pull request #2170 from sharetribe/categories
Landing page categories
Failed to load latest commit information.
app Fix Rubocop Jun 27, 2016
autotest The basic structure for rspec Jul 5, 2010
bin Update Rails 4 binaries Dec 29, 2015
client Make all Top bar stories use common props base and Storify Jun 23, 2016
config wti pull Jun 27, 2016
db Migrate communities to have Google Maps API key Jun 27, 2016
docs Improve naming Jun 6, 2016
features Replace root_paths with search_path Jun 21, 2016
lib Perform ssl redirect in middleware Jun 21, 2016
log Add log dir to repository as new Thinking-sphinx requires it Jan 24, 2014
public Remove Grunt Apr 11, 2016
script Integrate the export task to Procfile Jun 6, 2016
spec Migrate communities to have Google Maps API key Jun 27, 2016
test Fix community_id in test data May 2, 2016
travis Fix Rubocop Jun 27, 2016
vendor/assets remove placeholder jquery plugin. Mar 17, 2016
.dockerignore Dockerfile Dec 3, 2014
.gitignore Assets are copied to public/webpack folder Jun 8, 2016
.nvmrc Use Node.js 6.1 May 10, 2016
.pryrc Remove awesome_rails_console, add awesome_print for nicer debugging o… May 3, 2016
.rspec Remove spork remove drb Dec 20, 2013
.rubocop.yml Minor cleaning to clp + rubocop to ruby 2.3 Jun 16, 2016
.rubocop_todo.yml Increase max ABC size for rubocop Apr 27, 2016
.slugignore Add log dir to repository as new Thinking-sphinx requires it Jan 24, 2014
.travis.yml Rename lint suite May 20, 2016
.wti Update WTI and language files Sep 13, 2012 Update changelog Jun 2, 2016 Update [skip ci] Mar 9, 2016
Capfile Deploy now starts sphinx. Scripts not very optimized yet though... Aug 18, 2010
Dockerfile Update Ruby to 2.1.8 Feb 19, 2016
Gemfile Add ColorUtils Jun 17, 2016
Gemfile.lock Add ColorUtils Jun 17, 2016
Guardfile Remove livereload Apr 11, 2016 Clarify copy Aug 19, 2015 Emphasize steps to reproduce Mar 1, 2016
LICENSE Update license copyright years Jul 30, 2014
Procfile Add queues to the default worker Mar 15, 2016
Procfile.client-hot wait_for_routes -> export_routes_js Jun 6, 2016
Procfile.client-static wait_for_routes -> export_routes_js Jun 6, 2016 wait_for_routes -> export_routes_js Jun 6, 2016
Procfile.spec wait_for_routes -> export_routes_js Jun 6, 2016
Procfile.static Integrate the export task to Procfile Jun 6, 2016 Change startup order to prevent errors caused by missing assets. May 18, 2016 Community forum link to Announcements category May 4, 2016
Rakefile A new badge status is saved to the database using delayed job when a … Oct 26, 2010 Remove links to the developer flowdock chat May 3, 2016 Release 5.7.1 May 12, 2016
VERSION Release 5.7.1 May 12, 2016
Vagrantfile Improve Docker/Fig setup Dec 22, 2014 Revert "Disable deflater" Sep 30, 2014
custom_plan.rb Update custom_plan according to the example Feb 4, 2016
fig.yml Add zeus service to fig Dec 22, 2014
package.json Use Node.js 6.1 May 10, 2016
zeus.json Try zeus Dec 19, 2013


Build Status Dependency Status Code Climate

Sharetribe is an open source platform to create your own peer-to-peer marketplace.

Would you like to set up your marketplace in one minute without touching code? Head to




Before you get started, the following needs to be installed:

  • Ruby. Version 2.3.1 is currently used and we don't guarantee everything works with other versions. If you need multiple versions of Ruby, RVM is recommended.
  • RubyGems
  • Bundler: gem install bundler
  • Node. Version 6.1 is currently used and we don't guarantee everything works with other versions. If you need multiple versions of Node, consider using n or nvm.
  • Git
  • A database. Only MySQL has been tested, so we give no guarantees that other databases (e.g. PostgreSQL) work. You can install MySQL Community Server two ways:
    1. If you are on a Mac, use homebrew: brew install mysql (highly recommended). Also consider installing the MySQL Preference Pane to control MySQL startup and shutdown. It is packaged with the MySQL downloadable installer, but can be easily installed as a stand-alone.
    2. Download a MySQL installer from here
  • Sphinx. Version 2.1.4 has been used successfully, but newer versions should work as well. Make sure to enable MySQL support. If you're using OS X and have Homebrew installed, install it with brew install sphinx --with-mysql
  • Imagemagick. If you're using OS X and have Homebrew installed, install it with brew install imagemagick

Setting up the development environment

  1. Get the code. Cloning this git repo is probably easiest way:

    git clone git://
  2. Navigate to the Sharetribe project root directory.

    cd sharetribe
  3. Install the required gems by running the following command in the project root directory:

    bundle install

    Note: libv8might fail to build with Clang 7.3, in that case you can try installing V8 manually:

    brew tap homebrew/versions
    brew install v8-315
    gem install libv8 -v '' -- --with-system-v8
    gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
    bundle install
  4. Install node modules

    npm install
  5. Create a database.yml file by copying the example database configuration:

    cp config/database.example.yml config/database.yml
  6. Add your database configuration details to config/database.yml. You will probably only need to fill in the password for the database(s).

  7. Create a config.yml file by copying the example configution file:

    cp config/config.example.yml config/config.yml
  8. Create the database:

    bundle exec rake db:create
  9. Initialize your database:

    bundle exec rake db:schema:load
  10. Run Sphinx index:

    bundle exec rake ts:index
  11. Start the Sphinx daemon:

    bundle exec rake ts:start
  12. Start the development server: Some components are created with React (see documentation) and they need to be built with Webpack. We have Foreman Procfiles that can be used to run both Rails and Webpack:

    1. React component static build
    foreman start -f Procfile.static
    1. React component & hot loading styleguide (http://localhost:9001/)
    foreman start -f
  13. If you need to debug the Rails parts of Sharetribe with Pry, it's not possible with Foreman due to a known compatibility issue. In this case we recommend running Rails with old-fashioned rails server and React builds with Foreman in a separate terminal. That way your binding.pry calls open nicely in the same window with the Rails process.

    1. React component static build, React client only
    foreman start -f Procfile.client-static
    1. React component & hot loading styleguide (http://localhost:9001/), React client only
    foreman start -f Procfile.client-hot
  14. Invoke the delayed job worker in a new console (open the project root folder):

    bundle exec rake jobs:work

Congratulations! Sharetribe should now be up and running for development purposes. Open a browser and go to the server URL (e.g. Fill in the form to create a new marketplace and admin user. You should be now able to access your marketplace and modify it from the admin area.


Use Mailcatcher to receive sent emails locally:

  1. Install Mailcatcher:

    gem install mailcatcher
  2. Start it:

  3. Add the following lines to config/config.yml:

  mail_delivery_method: smtp
  smtp_email_address: "localhost"
  smtp_email_port: 1025
  1. Open http://localhost:1080 in your browser

Database migrations

To update your local database schema to the newest version, run database migrations with:

  bundle exec rake db:migrate

Running tests

Tests are handled by RSpec for unit tests and Cucumber for acceptance tests.

  1. Navigate to the root directory of the sharetribe project
  2. Initialize your test database:

    bundle exec rake test:prepare

    This needs to be rerun whenever you make changes to your database schema.

  3. If Zeus isn't running, start it:

    zeus start
  4. To run unit tests, open another terminal and run:

    zeus rspec spec
  5. To run acceptance tests, open another terminal and run:

    zeus cucumber

    Note that running acceptance tests is slow and may take a long time to complete.

To automatically run unit tests when code is changed, start Guard:

  bundle exec guard

Setting up Sharetribe for production

Before starting these steps, perform steps 1-5 from above.

  1. Set secret_key_base

    Generate secret key

    rake secret

    Add the following lines to config/config.yml:

      secret_key_base: # add here the generated key

    (You can also set the secret_key_base environment variable, if you don't want to store the secret key in a file)

  2. Create the database:

    bundle exec rake RAILS_ENV=production db:create
  3. Initialize your database:

    bundle exec rake RAILS_ENV=production db:schema:load
  4. Run Sphinx index:

    bundle exec rake RAILS_ENV=production ts:index
  5. Start the Sphinx daemon:

    bundle exec rake RAILS_ENV=production ts:start
  6. Precompile the assets:

    bundle exec rake assets:precompile
  7. Invoke the delayed job worker:

    bundle exec rake RAILS_ENV=production jobs:work
  8. In a new console, open the project root folder and start the server:

    bundle exec rails server -e production

The built-in WEBrick server (which was started in the last step above) should not be used in production due to performance reasons. A dedicated HTTP server such as unicorn is recommended.

It is not recommended to serve static assets from a Rails server in production. Instead, you should use a CDN (Content Delivery Network) service, such as Amazon CloudFront. To serve the assets from the CDN service, you need to change the asset_host configuration in the the config/config.yml file to point your CDN distribution.

For production use we recommend you to upgrade only when new version is released and not to follow the master branch.

Setting your domain

  1. In your database, change the value of the domain column in the communities table to match the hostname of your domain. For example, if the URL for your marketplace is, then the domain is

  2. Change the value of the use_domain column to true (or 1) in the communities table.

Setting up S3

If you want to use S3 to host your images, you need to do a bit more configuration.

  1. Create a IAM role which has full S3 access. Save the AWS access and secret keys.

  2. In the S3 console, create two buckets, one for upload and one for permanent storage. For example your-sharetribe-images and your-sharetribe-images-tmp.

  3. Set the upload bucket (your-sharetribe-images-tmp) to have an expiration (for example, of 14 days) using lifecycle management

  4. Enable CORS on the upload bucket.

  5. Set the following configuration in your sharetribe config.yml: s3_bucket_name: "your-sharetribe-images" s3_upload_bucket_name: "your-sharetribe-images-tmp"

  6. Add your AWS keys to the sharetribe app. The best way to do that is via environment variables, rather than checking them into your config.yml. Set the aws_access_key_id and aws_secret_access_key environment variables to the values for the IAM user.

Here's a sample CORS configuration that allows anyone to post to your bucket. Note that you may want to lock down the origin host more tightly, depending on your needs.

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="">
Troubleshooting S3 Setup
  • if you are having trouble uploading, look at the request using browser devtools and see what error statuses and messages are being sent.
  • double check that your AWS keys are being correctly set.
  • if you can upload images successfully, but the images aren't processed, make sure that the delayed-job worker is running.

Advanced settings

Default configuration settings are stored in config/config.default.yml. If you need to change these, use the config/config.yml file to override the defaults. You can also set configuration values to environment variables.

React components can be created using hot module replacement HMR technique in Styleguide (http://localhost:9001/) path in local development environment. Webpack is used to bundle React components for deployments and hot loading. Related webpack configs can be found from folder sharetribe/client/

Unofficial installation instructions

Use these instructions to set up and deploy Sharetribe for production in different environments. They have been put together by the developer community, and are not officially maintained by the Sharetribe core team. The instructions might be somewhat out of date.

If you have installation instructions that you would like to share, don't hesitate to share them at the Sharetribe community forum.


Sharetribe's open source version supports payments using Braintree Marketplace. To enable payments with Braintree, you need to have a legal business in the United States. You can sign up for Braintree here. Once that's done, create a new row in the payment gateways table with your Braintree merchant_id, master_merchant_id, public_key, private_key and client_side_encryption_key.

PayPal payments are only available on marketplaces hosted at due to special permissions needed from PayPal. We hope to add support for PayPal payments to the open source version of Sharetribe in the future.


Sharetribe follows Semantic Versioning where possible.

Given a version number MAJOR.MINOR.PATCH, increment the:

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backwards-compatible manner, and
  • PATCH version when you make backwards-compatible bug fixes.

See the document How Sharetribe applies Semantic Versioning to read more how Semantic Versioning is applied in practice.


See for detailed list of changes between releases.


See for information about actions needed when upgrading.

For production use we recommend you to upgrade only when new version is released and not to follow the master branch.


Would you like to make Sharetribe better?

See for the steps to contribute.


See for information about how to make a new release.

Technical roadmap

For a better high-level understanding of what the Sharetribe core team is working on currently and what it plans to work on next, read the technical roadmap.


Sharetribe uses WebTranslateIt (WTI) for translations. If you'd like to translate Sharetribe to your language or improve existing translations, please ask for a WTI invitation. To get an invite, send an email to and mention that you would like to become a translator.

All language additions and modifications (except for English) should be done through the WTI tool. We do not accept Pull Requests that add or modify languages (except English).

Known issues

Browse open issues and submit new ones at

Developer documentation

Community forum

The Sharetribe open source community forum is located at

The forum is a great place to ask support and help for example with issues during the installation.

MIT License

Sharetribe is open source under the MIT license. See LICENSE for details.

Something went wrong with that request. Please try again.