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/SharetribeREADME
Sharetribe Go
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
- Installation
- Payments
- Custom Landing Page
- Versioning
- Changes
- Upgrade
- Contribute
- Release
- Translation
- Bug tracker
- Documentation
- License
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:
- 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. - Download a MySQL installer from here
- If you are on a Mac, use homebrew:
- 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
-
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 -
Install the required gems by running the following command in the project root directory:
bundle installNote:
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 '3.16.14.13' -- --with-system-v8 gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315 bundle install -
Install node modules:
npm install && ( cd client && npm install ) -
Create a
database.ymlfile by copying the example database configuration:cp config/database.example.yml config/database.yml -
Add your database configuration details to
config/database.yml. You will probably only need to fill in the password for the database(s). -
Create a
config.ymlfile by copying the example configuration file:cp config/config.example.yml config/config.yml -
Create and initialize the database:
bundle exec rake db:create db:schema:load -
Run Sphinx index:
bundle exec rake ts:indexNote: If your MySQL server is configured for SSL, update the
config/thinking_sphinx.ymlfile and uncomment themysql_ssl_calines. Configure correct SSL certificate chain for connection to your database over SSL. -
Start the Sphinx daemon:
bundle exec rake ts:start -
Start the development server:
foreman start -f Procfile.static -
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:
-
Install Mailcatcher:
gem install mailcatcher -
Start it:
mailcatcher -
Add the following lines to
config/config.yml:development: mail_delivery_method: smtp smtp_email_address: "localhost" smtp_email_port: 1025 -
Open
http://localhost:1080in 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.
-
Navigate to the root directory of the sharetribe project
-
Initialize your test database:
bundle exec rake test:prepareThis needs to be rerun whenever you make changes to your database schema.
-
If Zeus isn't running, start it:
zeus start -
To run unit tests, open another terminal and run:
zeus rspec spec -
To run acceptance tests, open another terminal and run:
zeus cucumberNote 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:
-
React component static build
foreman start -f Procfile.static -
React component & hot loading styleguide (http://localhost:9001/)
foreman start -f Procfile.hot -
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 serverand React builds with Foreman in a separate terminal. That way yourbinding.prycalls open nicely in the same window with the Rails process. -
React component static build, React client only
foreman start -f Procfile.client-static -
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.
-
Set
secret_key_baseGenerate secret key
rake secretAdd the following lines to
config/config.yml:production: secret_key_base: # add here the generated key

