SkillAgentSearch skills...

Sharetribe

Sharetribe Go is Sharetribe's old source-available marketplace software, which was also available as a hosted SaaS product. Sharetribe Go is no longer actively maintained.

Install / Use

/learn @sharetribe/Sharetribe
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Sharetribe Go

CircleCI Code Climate

IMPORTANT: Sharetribe Go is no longer actively maintained.

Sharetribe's new marketplace builder, The New Sharetribe, replaces Sharetribe Go as the easiest, fastest way to build a marketplace. Learn more about what The New Sharetribe means for Sharetribe Go.

Sharetribe Go remains source-available under the Sharetribe Community Public License.

To build and launch a marketplace without writing a single line of code, and extend indefinitely with custom code and scale to any size, head to the SaaS version of The New Sharetribe.

Contents

Technology stack

  • Ruby 3.2.2
  • Ruby on Rails 7.2.2.1
  • MySQL 8.0
  • React + jQuery
  • Node.js 18.16 (for compiling JavaScript assets)
  • "what you see is what you get" Editor Mercury
  • Deploy: Custom Script (not using Mina or Cap3)
  • Server: Heroku
  • Image hosting: Amazon S3
  • Background job: delayed_job
  • Gems:
    • devise | Authentication
    • omniauth-facebook | Third party login: Facebook
    • haml and ERB | HTML templating
    • mysql2 | MySQL library for Ruby
    • paperclip | Image upload management
    • passenger | Web application server
    • react_on_rails | Integration of React + Webpack + Rails
    • factory_bot, capybara, rspec-rails, cucumber-rails, selenium-webdriver | Testing

Installation

Requirements

Before you get started, install the following:

  • Ruby. Version 3.2.2 is currently used and we don't guarantee everything works with other versions. If you need multiple versions of Ruby, RVM or rbenv is recommended.
  • RubyGems
  • Bundler: gem install bundler
  • Node. Version 18.16 is currently used and we don't guarantee everything works with other versions. If you need multiple versions of Node, consider using n, nvm, or nenv.
  • Git
  • A database. Only MySQL 8.0 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. Clone this git repository and check out the latest release:

    git clone git@github.com:sharetribe/sharetribe.git
    cd sharetribe
    git checkout latest
    
  2. Install the required gems by running the following command in the project root directory:

    bundle install
    

    Note: libv8 might 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 '3.16.14.13' -- --with-system-v8
    gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
    
    bundle install
    
  3. Install node modules:

    npm install && ( cd client && npm install )
    
  4. Create a database.yml file by copying the example database configuration:

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

  6. Create a config.yml file by copying the example configuration file:

    cp config/config.example.yml config/config.yml
    
  7. Create and initialize the database:

    bundle exec rake db:create db:schema:load
    
  8. Run Sphinx index:

    bundle exec rake ts:index
    

    Note: If your MySQL server is configured for SSL, update the config/thinking_sphinx.yml file and uncomment the mysql_ssl_ca lines. Configure correct SSL certificate chain for connection to your database over SSL.

  9. Start the Sphinx daemon:

    bundle exec rake ts:start
    
  10. Start the development server:

    foreman start -f Procfile.static
    
  11. 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. http://lvh.me:3000 or http://lvh.me:5000). 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.

Mailcatcher

Use Mailcatcher to receive sent emails locally:

  1. Install Mailcatcher:

    gem install mailcatcher
    
  2. Start it:

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

    development:
      mail_delivery_method: smtp
      smtp_email_address: "localhost"
      smtp_email_port: 1025
    
  4. 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.

Install the following extra dependencies:

  • Chromedriver. Make sure to install a driver version that matches your browser's.

Remember to follow all the steps listed in the Setting up the development environment paragraph before running tests because some tests depend on webpack assets.

  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

Working with React, Webpack and Foreman

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
    
  2. React component & hot loading styleguide (http://localhost:9001/)

    foreman start -f Procfile.hot
    
  3. 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.

  4. React component static build, React client only

    foreman start -f Procfile.client-static
    
  5. React component & hot loading styleguide (http://localhost:9001/), React client only

    foreman start -f Procfile.client-hot
    

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:

    production:
      secret_key_base: # add here the generated key
    
View on GitHub
GitHub Stars2.4k
CategoryDevelopment
Updated9h ago
Forks1.3k

Languages

Ruby

Security Score

85/100

Audited on Mar 28, 2026

No findings