{"id":2240,"date":"2016-08-05T16:51:37","date_gmt":"2016-08-05T22:51:37","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=2240"},"modified":"2016-08-07T15:06:15","modified_gmt":"2016-08-07T21:06:15","slug":"getting-started-with-sharetribe-development-vagrant-style","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/2240","title":{"rendered":"Getting started with sharetribe development&#8211;vagrant style"},"content":{"rendered":"<p>I have recently spent a fair bit of time working with <a href=\"https:\/\/github.com\/sharetribe\/sharetribe\">Sharetribe, an open source, MIT licensed marketplace platform<\/a> that also powers a <a href=\"https:\/\/www.sharetribe.com\/\">hosted solution<\/a>.<\/p>\n<p>First, let me say that the software is the least significant piece of a marketplace (like AirBnB). \u00a0The least significant!  (Check out <a href=\"https:\/\/www.sharetribe.com\/academy\/guide\/\">the Sharetribe Academy<\/a> for some great content about the other steps.) \u00a0<\/p>\n<p>But it is still a necessary component. \u00a0If you can get by with the hosted solution to prove out your idea, I suggest you do so&#8211;$100\/month is a lot cheaper than hours of software development.  There may come a time when you want to customize the sharetribe interface beyond what javascript injection can do. \u00a0If this is the case, you need a developer. \u00a0And that developer needs an environment. \u00a0That&#8217;s what this post is really about.<\/p>\n<p>The sharetribe github readme explains the installation process pretty well, but I find it tedious, so I created a\u00a0quick start vagrant VM. This VM has a sharetribe installation ready to go. \u00a0I use vagrant 1.6.3 and Virtualbox 5&#8211;google around for instructions on how to get those up and running. The guest VM is Ubuntu 14.04. This VM uses rvm to manage ruby versions, but I couldn&#8217;t be bothered with nvm.  It will install sharetribe 5.8.0 and all needed components.<\/p>\n<p>Assuming you have vagrant and virtual box installed, download the <a href=\"\/sharetribe\/Vagrantfile\">Vagrant file<\/a> and put it in the directory where you want to work.  Edit it and change any options you&#8217;d like.  The options I changed were the port forwarding (I set it to <code>3003<\/code>), networking options, and the amount of memory used (I allocate 4GB).<\/p>\n<p>Then run <code>vagrant box add http:\/\/www.mooreds.com\/sharetribe\/sharetribe-base-mooreds.box --name sharetribe-base-mooreds<\/code> to download the file.  It&#8217;s downloading a large file from my (small) server, so expect it to take a while (hours).<\/p>\n<p>Then run <code>vagrant init<\/code>.  <\/p>\n<p>When you can login (password is <code>vagrant<\/code> if you use <a href='https:\/\/twitter.com\/mooreds\/status\/530770895204139008'>vagrant putty<\/a> or you can use <code>vagrant ssh<\/code>) you can go to the sharetribe directory and do the following:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/sharetribe\/sharetribe\">fork the sharetribe repo<\/a><\/li>\n<li><a href=\"https:\/\/help.github.com\/articles\/changing-a-remote-s-url\/\">update your git remote<\/a> so that your <code>origin<\/code> is your forked repo (and not mine, because you won&#8217;t get write access to mine) <\/li>\n<li>create a branch in your repo off of the 5.8.0 tag.  There&#8217;s one startup script I tweaked a bit, but you can just ignore those changes.<\/li>\n<li>update your mysql password: <code>SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');<\/code><\/li>\n<li>start mailcatcher listening to all interfaces: <code>mailcatcher --ip=0.0.0.0<\/code><\/li>\n<li>start the rails\/react server: <code>foreman start -f Procfile.static<\/code><\/li>\n<li>visit lvh.me:3003 and start your server<\/li>\n<li>set up your local super user and first marketplace<\/li>\n<li>edit the url you are redirected to to have the correct external port on it (from the vagrant settings): from http:\/\/testdev.lvh.me:3000\/?auth=baEOj7kFrsw to http:\/\/testdev.lvh.me:3003\/?auth=baEOj7kFrsw for example<\/li>\n<\/ul>\n<p>This is running sharetribe 5.8.0, and I&#8217;m sure there will be follow on releases. Here&#8217;s <a href=\"https:\/\/help.github.com\/articles\/syncing-a-fork\/\">how to sync the releases coming from the sharetribe team with your current repo<\/a>.  I&#8217;ve taken the liberty of creating an <code>upstream<\/code> branch for you.<\/p>\n<p>This doesn&#8217;t cover deploying the code anywhere&#8211;I&#8217;d recommend <a href=\"https:\/\/gist.github.com\/svallory\/d08e9baa88e18d691605\">this gist<\/a>.  Make sure you read the comments!  Or I can install a vanilla version of sharetribe to heroku for a flat fee&#8211;contact me for details.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have recently spent a fair bit of time working with Sharetribe, an open source, MIT licensed marketplace platform that also powers a hosted solution. First, let me say that [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77,78,33],"tags":[],"class_list":["post-2240","post","type-post","status-publish","format-standard","hentry","category-rails","category-sharetribe","category-useful-tools"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/2240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2240"}],"version-history":[{"count":10,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/2240\/revisions"}],"predecessor-version":[{"id":2253,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/2240\/revisions\/2253"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}