In this video we will show you how to start
up an app with the shopify_gem in five mins. This assumes that you have already authorized
with your Heroku account and have a base familiarity with rails 5.1.4 and ruby 2.4.1 To start we going to create our new rails project in our terminal by typing “rails new shopify_app“ Next we will move into our app’s directory Check this into version control with git From here we’ll create our heroku app server with “heroku create“ This creates and initializes a Heroku app that we can push our code to. Make note of the heroku app URL we’re provided, by pasting it somewhere you will find it when needed From here we move into our partner dashboard and click create app in the app section Add the app name and add the URL that was provided by heroku earlier Then click create app Go to app info tab to update whitelisted redirection url to add /auth/shopify/callback to our Heroku url and save changes The shopify_app creates a route by default at the URL we just whitelisted on which itwill exchange our oauth code for permanent access token. Shopify checks to ensure that this url matches that which is provided by the app in its initial oauth request. Move to the extensions tab to confirm that
our app is an embedded app If the embedded app feature is not enabled,
click enable An embedded app pulls your app interface into an iframe within the admin to create a more seamless experience for the merchant. Move back into terminal and open your project with our preferred text editor and open your gem file Move the sqlite3 gem into our development test group Create a new group called production and add pg gem Add the gem shopify_app above our rails gem Run bundle install Run rails generate shopify_app Provide our app credentials which we can get
in the partner dashboard under the app info tab This adds the functionality needed to run an app that interfaces with Shopify Now check our changes into version control Deploy our app to heroku with
“git push heroku master“ Before we can access our app successfully
we have to run with our rails generate function “Heroku rails run db:migrate“ From there we can visit the app url that we grabbed earlier and add our shop url and install app We can already see that the app by default grabs some shop data via the api For more info with what you can do with the Shopify gem visit the repo at github.com/Shopify/shopify_app New to Shopify app development? Click the link below to create a free account! Thanks for watching!