The Rails app with appropriate tools for quick starting developing shopify app.
How to install?
- Clone the repo.
cd shopify-app-starter-kit
git remote set-url origin new_git_repo_url
bundle install && bundle exec rake db:migrate
- Rename the app module in the
config/application.rb
file - Install ngrok
- Create a new app in your shopify partner account. Use ngrok url as shopify app url.
- Copy
.env
file into.env.production
. - Add
.env
to your.gitignore
file. It's in the repo now for your informing about the structure. - Add
SHOPIFY_API_KEY
andSHOPIFY_SECRET
to.env
and.env.production
files. - Change
REDIS_QUEUE_URI
in the.env
and.env.production
files if it's necessary - Change an application name in the
config/settings.yml
file. - Change an application host name in the
config/settings/*.yml
files. - Add necessary shopify scopes to the
config/settings.yml
file (e.g.read_products, read_orders
) - Add necessary shopify webhooks to the
config/settings.yml
file. - Add necessary workers to the
app/jobs/
directory (e.g. if you addorders/create
webhook, you should createorders_create_job.rb
worker) - For UI and CSS styles read about Polaris or Uptown CSS
Monitoring
There are several monitoring tools: New Relic, Sentry and Mixpanel.
New Relic
Change NEW_RELIC_LICENSE_KEY
to your new relic license key in the .env
and .env.production
files.
Sentry
Change SENTRY_DNS
to your sentry dns url in the .env
and .env.production
files.
Mixpanel
Change MIXPANEL_TOKEN
to your mixpanel token in the .env
and .env.production
files.
You can send an event in this way:
TrackerWorker.perform_async(
shop_domain: "shop_domain",
action: "some action"
options: {some: "option"}
)