├── .eslintrc.js
├── .gitignore
├── CHANGELOG.md
├── LICENCE.md
├── README.md
├── TODO
├── app.js
├── config
├── development.js
├── index.js
└── production.js
├── docs
├── .gitignore
├── Gemfile
├── _config.yml
├── _data
│ └── common.yml
├── _documentation
│ ├── about.md
│ ├── application-scope.md
│ ├── configuration.md
│ ├── getting-started-configuration.md
│ ├── getting-started.md
│ ├── helper-functions.md
│ ├── mongo.md
│ ├── ngrok.md
│ ├── routes.md
│ ├── running.md
│ ├── shopify-partner-dashboard.md
│ ├── utils.md
│ └── views.md
├── _includes
│ ├── article.html
│ ├── aside.html
│ ├── footer.html
│ ├── head.html
│ ├── header.html
│ ├── icon.html
│ └── main.html
├── _layouts
│ └── home.html
├── _sass
│ ├── _additions.scss
│ ├── _form.scss
│ ├── _grid.scss
│ ├── _header.scss
│ ├── _helpers.scss
│ ├── _icons.scss
│ ├── _popups.scss
│ ├── _syntax.scss
│ └── _typography.scss
├── about.md
├── assets
│ ├── bg-layer-1.png
│ ├── bg-layer-1.svg
│ ├── bg-layer-2.png
│ ├── bg-layer-2.svg
│ ├── favicon.png
│ ├── js
│ │ ├── focus.js
│ │ ├── scroll-spy.js
│ │ └── smooth-scroll.js
│ ├── main.scss
│ ├── ngrok-init.png
│ └── partner-dash-settings.png
└── index.md
├── helpers
└── index.js
├── middleware
└── index.js
├── models
├── Counter.js
├── Shop.js
└── index.js
├── package-lock.json
├── package.json
├── public
└── stylesheets
│ └── style.css
├── routes
├── api.js
├── index.js
├── install.js
├── proxy.js
└── webhook.js
├── start.js
├── utils
├── cleardbs.js
├── index.js
└── seeddbs.js
└── views
├── app
└── app.hbs
├── error.hbs
├── index.hbs
└── layout.hbs
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "extends": "airbnb-base",
3 | "plugins": [
4 | "import"
5 | ]
6 | };
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | .env
3 | .DS_Store
4 | yarn.lock
5 | .idea/
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | Shopify Node App V0.2
2 | =
3 |
4 | 10/07/2017
5 | --
6 | - Moved from ./bin/www to ./start.js for start system.
7 | - Models now need to be referenced in start.js to be initialised.
8 | - Can call models using mongoose.model('ModelName') instead of requiring them in each file. individually.
9 | - General bug fixes
--------------------------------------------------------------------------------
/LICENCE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Elkfox
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ⚠️ IMPORTANT NOTICE
2 |
3 | This project is no longer supported. We recommend quickly generating the structure of your Shopify App projects using the [Shopify App CLI](https://shopify.github.io/shopify-app-cli/) instead.
4 |
5 | ------------------------
6 |
7 | ## Shopify Node App
8 |
9 | Shopify Node App - A Shopify App framework built on Node Express and Mongo
10 |
11 | #### View the [Documentation](https://elkfox.github.io/shopify-node-app/) for more
12 |
--------------------------------------------------------------------------------
/TODO:
--------------------------------------------------------------------------------
1 | Implement promises
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const path = require('path');
3 | const favicon = require('serve-favicon');
4 | const logger = require('morgan');
5 | const cookieParser = require('cookie-parser');
6 | const bodyParser = require('body-parser');
7 | const session = require('express-session');
8 | const mongoose = require('mongoose');
9 | const MongoStore = require('connect-mongo')(session);
10 |
11 | // Routes
12 | const index = require('./routes/index');
13 | const install = require('./routes/install');
14 | const webhook = require('./routes/webhook');
15 | const proxy = require('./routes/proxy');
16 | const api = require('./routes/api');
17 | require('dotenv').config();
18 |
19 | const app = express();
20 |
21 | // view engine setup
22 | app.set('views', path.join(__dirname, 'views'));
23 | app.set('view engine', 'hbs');
24 | app.use(bodyParser.json({
25 | type:'application/json',
26 | limit: '50mb',
27 | verify: function(req, res, buf) {
28 | if (req.url.startsWith('/webhook')){
29 | req.rawbody = buf;
30 | }
31 | }
32 | })
33 | );
34 | // uncomment after placing your favicon in /public
35 | // app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
36 | app.use(logger('dev'));
37 | app.use(bodyParser.urlencoded({ extended: false }));
38 | app.use(cookieParser());
39 | app.use(express.static(path.join(__dirname, 'public')));
40 | app.set('trust proxy', 1);
41 | app.use(session({
42 | name: 'ShopifyNodeApp',
43 | secret: process.env.SESSION_SECRET || 'coocoocachoo',
44 | cookie: { secure: true, maxAge: (24 * 60 * 60 * 1000) },
45 | saveUninitialized: true,
46 | resave: false,
47 | store: new MongoStore({ mongooseConnection: mongoose.connection }),
48 | }));
49 |
50 | app.use(express.static(path.join(__dirname, 'public')));
51 | // Routes
52 | app.use('/', index);
53 | app.use('/install', install);
54 | app.use('/webhook', webhook);
55 | app.use('/proxy', proxy);
56 | app.use('/api', api);
57 |
58 | // catch 404 and forward to error handler
59 | app.use((req, res, next) => {
60 | const err = new Error('Not Found');
61 | err.status = 404;
62 | next(err);
63 | });
64 |
65 | // error handler
66 | app.use((err, req, res) => {
67 | // set locals, only providing error in development
68 | res.locals.message = err.message;
69 | res.locals.error = req.app.get('env') === 'development' ? err : {};
70 |
71 | // render the error page
72 | res.status(err.status || 500);
73 | res.render('error');
74 | });
75 |
76 | module.exports = app;
77 |
--------------------------------------------------------------------------------
/config/development.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | APP_URI: 'https://e1e16fdc.ngrok.io',
3 | };
4 |
--------------------------------------------------------------------------------
/config/index.js:
--------------------------------------------------------------------------------
1 | const env = process.env.NODE_ENV;
2 | const production = require('./production');
3 | const development = require('./development');
4 |
5 | // You should put any global variables in here.
6 | const config = {
7 | SHOPIFY_API_KEY: process.env.SHOPIFY_API_KEY || '',
8 | SHOPIFY_SHARED_SECRET: process.env.SHOPIFY_SHARED_SECRET || '',
9 | APP_NAME: 'Customer',
10 | APP_STORE_NAME: 'Customer',
11 | APP_SCOPE: 'read_products,write_products,read_customers,write_customers',
12 | DATABASE_NAME: 'shopify_node_app',
13 | };
14 |
15 | if (env !== 'PRODUCTION') {
16 | module.exports = Object.assign({}, config, development);
17 | } else {
18 | module.exports = Object.assign({}, config, production);
19 | }
20 |
--------------------------------------------------------------------------------
/config/production.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | APP_URI: '',
3 | };
4 |
--------------------------------------------------------------------------------
/docs/.gitignore:
--------------------------------------------------------------------------------
1 | _site
2 | .sass-cache
3 | .jekyll-metadata
4 | Gemfile.lock
5 |
--------------------------------------------------------------------------------
/docs/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 | ruby RUBY_VERSION
3 |
4 | # Hello! This is where you manage which Jekyll version is used to run.
5 | # When you want to use a different version, change it below, save the
6 | # file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
7 | #
8 | # bundle exec jekyll serve
9 | #
10 | # This will help ensure the proper Jekyll version is running.
11 | # Happy Jekylling!
12 |
13 | gem "jekyll", "3.4.1"
14 |
15 | # This is the default theme for new Jekyll sites. You may change this to anything you like.
16 | gem "minima", "~> 2.0"
17 |
18 | # If you want to use GitHub Pages, remove the "gem "jekyll"" above and
19 | # uncomment the line below. To upgrade, run `bundle update github-pages`.
20 | # gem "github-pages", group: :jekyll_plugins
21 |
22 | # If you have any plugins, put them here!
23 | group :jekyll_plugins do
24 | gem "jekyll-feed", "~> 0.6"
25 | end
26 |
27 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
28 | gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
29 |
--------------------------------------------------------------------------------
/docs/_config.yml:
--------------------------------------------------------------------------------
1 | # Meta =======================================================================
2 | title: Shopify Node App - A Shopify App framework built on Node Express and Mongo
3 | description: A Shopify App framework built on Node Express and Mongo. Includes Embedded app SDK and full tutorial.
4 | # Site =======================================================================
5 | name: Shopify Node App
6 | subtitle: A thousand hour headstart in building a Shopify Node App
7 | github_url: https://github.com/Elkfox/Shopify-Node-App
8 | download_url: https://github.com/Elkfox/Shopify-Node-App/archive/master.zip
9 | # demo_url: https://concrete-theme.myshopify.com
10 | # Navigation =================================================================
11 | nav:
12 | - title: About
13 | url: '#about'
14 | - title: 'Getting Started'
15 | url: '#getting-started'
16 | childlinks:
17 | - title: Mongo Setup
18 | url: '#mongo-setup'
19 | - title: Ngrok
20 | url: '#ngrok'
21 | - title: Shopify Partner Dashboard
22 | url: '#shopify-partner-dashboard'
23 | - title: Configuration
24 | url: '#getting-started-configuration'
25 | - title: 'Configuration'
26 | url: '#configuration'
27 | - title: 'Running'
28 | url: '#running'
29 | - title: 'Utils'
30 | url: '#utils'
31 | - title: 'Views'
32 | url: '#views'
33 | - title: 'Routes'
34 | url: '#routes'
35 | - title: 'Applcation Scope'
36 | url: '#application-scope'
37 | - title: 'Helper Functions'
38 | url: '#helper-functions'
39 |
40 | # Collections ================================================================
41 | collections:
42 | documentation:
43 | title: Documentation
44 | # Build settings =============================================================
45 | markdown: kramdown
46 | theme: minima
47 | gems:
48 | - jekyll-feed
49 | exclude:
50 | - Gemfile
51 | - Gemfile.lock
52 |
--------------------------------------------------------------------------------
/docs/_data/common.yml:
--------------------------------------------------------------------------------
1 | icon: Icon
2 |
--------------------------------------------------------------------------------
/docs/_documentation/about.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "About"
3 | handle: "about"
4 | category: "about"
5 | ---
6 |
7 | Dummy Public App for Shopify built with Node Includes Embedded App SDK [Elkfox](https://www.elkfox.com).
8 |
9 | ### Requirements
10 |
11 | - node.js >= 6.11.0
12 | - mongodb >= 3.2.9
13 | - npm >= 5.0.0
14 |
--------------------------------------------------------------------------------
/docs/_documentation/application-scope.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Application Scope"
3 | handle: "application-scope"
4 | category: "application-scope"
5 | ---
6 |
7 | When you develop an app you must tell Shopify and the store owner what parts of the store you want to access and modify.
8 |
9 | To declare application scope you can edit the APP_SCOPE variable in `config/index.js` by listing your scopes seperated by commas.
10 |
11 | ### Available scopes
12 | These are the available scopes for your application
13 |
14 | Scope | Description
15 | -------|-------------
16 | read_content, write_content | Access to Article, Blog, Comment, Page, and Redirect.
17 | read_themes, write_themes | Access to Asset and Theme.
18 | read_products, write_products | Access to Product, product variant, Product Image, Collect, Custom Collection, and Smart Collection.
19 | read_customers, write_customers | Access to Customer and Saved Search.
20 | read_orders, write_orders | Access to Order, Transaction and Fulfillment.
21 | read_draft_orders, write_draft_orders | Access to Draft Order.
22 | read_script_tags, write_script_tags | Access to Script Tag.
23 | read_fulfillments, write_fulfillments | Access to Fulfillment Service.
24 | read_shipping, write_shipping | Access to Carrier Service.
25 | read_analytics | Access to Analytics API.
26 | read_users, write_users | Access to User **SHOPIFY PLUS**.
27 | read_checkouts, write_checkouts | Access to Checkouts.
28 |
--------------------------------------------------------------------------------
/docs/_documentation/configuration.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Configuration"
3 | handle: "configuration"
4 | category: "configuration"
5 | ---
6 |
7 | Inside the `config/` directory there are three files
8 | - development.js - Development only configuration variables
9 | - index.js - Global configuration variables
10 | - production.js - Production only configuration variables
11 |
12 | This is where you'll place any configuration variables you'll need or any references you'll need to environment variables later on.
13 | When the app is initalised it checks where `process.env.NODE_ENV` is set to production or not and will load the relevant configurations.
14 |
15 | Default configuration located in `config/index.js` variables are:
16 | - SHOPIFY\_API\_KEY - Your apps API Key. Generated when you set up the app and required to run and install the app
17 | - SHOPIFY\_SHARED\_SECRET - Your apps secret key. Generated when you set up the app and required to run and install the app.
18 | - APP_NAME - The name of your app. Can be left blank if you'd prefer to hardcode it in.
19 | - APP_SCOPE - The parts of the Shopify API your app will want access to. See [below](#scopes) for a list of possible scopes. This is required to install the app. You must have at least one scope permission.
20 |
--------------------------------------------------------------------------------
/docs/_documentation/getting-started-configuration.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Configuration"
3 | handle: "getting-started-configuration"
4 | category: "getting-started-configuration"
5 | ---
6 |
7 | If you haven't done so already fork and clone [the repository](https://github.com/Elkfox/shopify-node-app)
8 |
9 | And install all the required Node packages
10 |
11 | {% highlight bash %}
12 | npm install
13 | {% endhighlight %}
14 |
15 |
16 | In the config directory we store the variables for the different environments. Production refers to the live environment and development is the local. index.js is the global variables with the current environment.
17 |
18 | Go into config/development.js and change the APP_URI to the your ngrok forwarding address. In my case it's https://32c49948.ngrok.io
19 |
20 | Now ensure that you have .env in your .gitignore because we will be storing sensitive information in this file such as our API secret. if it isn't add it now.
21 |
22 | Now create a new file in your app root called .env
23 | and add the API credentials we created earlier in the Shopify Partner Dashboard. It should look like this:
24 |
25 | {% highlight conf %}
26 | SHOPIFY_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
27 | SHOPIFY_SHARED_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
28 | {% endhighlight %}
29 |
30 | If you want to use port other than 7777 you can add that now too.
31 |
32 | {% highlight conf %}
33 | PORT=3000
34 | {% endhighlight %}
35 |
36 | Okay now lets get our app running!
37 |
38 | {% highlight bash %}
39 | npm start
40 | {% endhighlight %}
41 |
42 | You should now be able to install your app if you visit the installation url.
43 |
44 | My Shopify store url is `hello-world.myshopify.com`
45 | and my ngrok forwarding address is `https://32c49948.ngrok.io/``
46 | therefore my installation url is
47 | `https://32c49948.ngrok.io/?shop=hello-world`
48 |
49 | Congratulations 🙌
50 |
--------------------------------------------------------------------------------
/docs/_documentation/getting-started.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Getting Started"
3 | handle: "getting-started"
4 | category: "getting-started"
5 | ---
6 |
7 | ### Introduction
8 | This Getting Started section has been written in a tutorial format so that it can be understood by everyone of all skill levels.
9 | That being said a prior knowledge of the terminal and javascript will be required. If you have any questions at all don't hesitate to raise an issue on Github.
10 |
11 | This tutorial makes the assumption that you are using a unix based operating system (Mac/Linux).
12 |
--------------------------------------------------------------------------------
/docs/_documentation/helper-functions.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Helper Functions"
3 | handle: "helper-functions"
4 | category: "helper-functions"
5 | ---
6 |
7 | There are a number of helper functions available in `helpers/index.js` these make tasks that might need to be repeated multiple times simple and quick to save time.
8 |
9 | | Function | Arguments | Returns | Description |
10 | | -------- | --------- | ------- | ----------- |
11 | | openWebhook | shop(Shop) | Accepts a Shop object from mongoose and returns a new ShopifyAPI session. |
12 | | buildWebhook | topic (String) address(String, default: APP_URI/webhook) shop(ShopifyAPI) callback(err, data, headers) | callback \|\| Boolean | Creates a new webhook on the Shop you're currently working on. Once complete it fires the callback passed to it. |
13 | | generateNonce | length(Int, default: 8) | String |Generates a random string of characters to represent a nonce that meets Shopify's requirements for app installation |
14 | | verifyHmac | data (String) hmac (String) | Boolean |Generates a hash from the passed data and compares it to the hash sent by Shopify. Returns true or false |
15 | | verifyOAuth | query (Object) | Boolean | Takes a request query and checks to see if it's a request from Shopify. Returns true or false |
16 |
--------------------------------------------------------------------------------
/docs/_documentation/mongo.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Mongo Setup"
3 | handle: "mongo-setup"
4 | category: "mongo-setup"
5 | ---
6 |
7 | First lets start by opening your terminal and checking to see if we have an installation of by typing in
8 |
9 | {% highlight bash %}
10 | mongod
11 | {% endhighlight %}
12 |
13 | If you do not have Mongo installed the command will not be found. If you do you can go ahead to the Ngrok section.
14 |
15 | Getting started with Mongo is simple click [here to find the instructions for your operating system](https://docs.mongodb.com/manual/administration/install-community/)
16 |
17 | #### Quick guide to install Mongo for Mac users
18 | I recommend using Brew to get started quickly.
19 |
20 | First update Brew.
21 |
22 | {% highlight bash %}
23 | brew update
24 | {% endhighlight %}
25 |
26 | Then install MongoDB
27 | {% highlight bash %}
28 | brew install mongodb
29 | {% endhighlight %}
30 |
31 | Then create the directory where your database will be stored.
32 | {% highlight bash %}
33 | mkdir -p /data/db
34 | {% endhighlight %}
35 |
36 | ##### Important
37 | Before running mongod for the first time, ensure that the user account running mongod has read and write permissions for the data directory. It is not advised to run mongod as root user i.e don't use sudo, setup the permissions correctly using the following command.
38 |
39 | {% highlight bash %}
40 | sudo chown -R `id -un` /data/db
41 | {% endhighlight %}
42 |
43 | Now you should be able to run the Mongo Daemon.
44 |
45 | {% highlight bash %}
46 | mongod
47 | {% endhighlight %}
48 |
--------------------------------------------------------------------------------
/docs/_documentation/ngrok.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Ngrok"
3 | handle: "ngrok"
4 | category: "ngrok"
5 | ---
6 |
7 | Your app will be receiving requests from Shopify, but you want to be able to develop your app locally. This is where Ngrok comes in. Ngrok is a tunneling service which will allow you to safely expose your local app to the internet so that it can now communicate with Shopify.
8 |
9 | Download Ngrok
10 |
11 | Assuming you downloaded it to your downloads folder unzip ngrok
12 |
13 | {% highlight bash %}
14 | unzip Downloads/ngrok.zip
15 | {% endhighlight %}
16 |
17 | {% highlight bash %}
18 | cd Downloads
19 | unzip ./ngrok.zip
20 | {% endhighlight %}
21 |
22 | Then run ngrok on port 7777
23 |
24 | {% highlight bash %}
25 | ngrok http 7777
26 | {% endhighlight %}
27 |
28 | If all went well you will see a response like this
29 |
30 |
31 | but the localhost port will be 7777 instead.
32 |
33 | In this case the Ngrok forwarding address is: https://32c49948.ngrok.io
34 |
35 | This is the url that will be used for reference in the rest of this tutorial. If the app were running you could now visit this url in your browser to view the app.
36 |
37 | ##### Note
38 | Your ngrok forwarding address changes every time that you restart ngrok (unless you have a paid plan). To avoid OAuth failures, update your app settings in the Partner Dashboard whenever you restart ngrok.
39 |
--------------------------------------------------------------------------------
/docs/_documentation/routes.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Routes"
3 | handle: "routes"
4 | category: "routes"
5 | ---
6 |
7 | Routes can be found in the `routes/` folder in the root directory of the app.
8 |
9 | | File | Route | Description |
10 | | ---- | ----- | ----------- |
11 | | `index.js` | `/` | Any non-app related endpoints should go here (General website endpoints such as /about, /contact, etc). |
12 | | `install.js` | `/install/` | Where you should place any methods relevant to the installation of you app. This is also where you should set up any 'post install' methods such as setting up webhooks or adding files to themes.|
13 | | `webhooks.js` | `/webhooks/` | Where you should place any requests to webhooks. This includes a middleware that checks to see if a webhook has made a legitemate request from Shopify.|
14 | | `api.js` | `/api/` | Where you should place any api endpoints you wish to use for your app if you plan on having front end components.|
15 | | `proxy.js` | `/proxy/` | Where you should place any proxy related routes. This is handy if you set up an app proxy when setting up your app. This will serve any files sent from it as liquid which allows Shopify to pass liquid objects to the files and allows you to use liquid inside your templates. |
16 |
--------------------------------------------------------------------------------
/docs/_documentation/running.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Running"
3 | handle: "running"
4 | category: "running"
5 | ---
6 |
7 | ### Debug mode
8 | To start the app in debug mode simply run `npm run debug`. This will start the app on port 3000 with debugging turned on.
9 | You can access the app by visiting `localhost:3000`
10 |
11 | Also available is `npm run debugwatch` which will start nodemon and allow you live-restart your server whenever you make changes.
12 |
13 | ### Production mode
14 | You can start the app in production mode by running `npm start` or `npm watch`.
15 |
16 | **Note**: You must set the environment variable `PORT` to whatever port you wish to run your production server on. (80, 8000, 8080, etc) If this is not defined app will run on port 3000 like in development mode.
17 |
--------------------------------------------------------------------------------
/docs/_documentation/shopify-partner-dashboard.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Shopify Partner Dashboard"
3 | handle: "shopify-partner-dashboard"
4 | category: "shopify-partner-dashboard"
5 | ---
6 |
7 | Create a new app in your [Partner Dashboard](https://partners.shopify.com/login) using the forwarding address that ngrok creates for you.
8 |
9 | Go to the App info tab and add https://32c49948.ngrok.io/install/callback to the Whitelisted redirection URL(s) **be sure to use the HTTPS url**.
10 |
11 | Add any other relevant whitelisted urls such as https://32c49948.ngrok.io/proxy if you wish to use an app proxy.
12 |
13 |
14 |
15 | **As noted above, unless you have a paid ngrok plan you will need to change this each to you start ngrok to the new url.**
16 |
17 | Below you will see the App credentials section, take note of your API key and and API secret key. You'll use these as environment variables in your app.
18 |
--------------------------------------------------------------------------------
/docs/_documentation/utils.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Utils"
3 | handle: "utils"
4 | category: "utils"
5 | ---
6 | There are two util commands available:
7 |
8 | `npm run cleardbs` - Which runs `./utils/cleardbs.js` and removes any entries in the databases you specify. By default it's set up to remove entries from `Shop` and `Counter`.
9 |
10 | `npm run seeddbs` - Seeds databases using your settings inside `./utils/seeddbs.js`. Currently the only database it seeds is Counter.
11 |
--------------------------------------------------------------------------------
/docs/_documentation/views.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Views"
3 | handle: "views"
4 | category: "views"
5 | ---
6 |
7 | Node Shopify App uses handlebars as it's template engine.
8 |
9 | Views are located in the `views/` folder and while some use a shared `layout.hbs` file you are under no obligation to use this file and your `.hbs` files can contain it's own html head and body. At the moment views are split into their current folders. The embedded app markup is located inside `apps/app.hbs`. Anything located in the root `views/` folder is for general use while `index.hbs` is what a non-shop should see if they visit `https://`
10 |
--------------------------------------------------------------------------------
/docs/_includes/article.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | {% for link in site.nav %}
4 | {% assign link_handle = link.url | remove: '#' %}
5 | {% for article in site.documentation %}
6 | {% if article.handle == link_handle %}
7 |
8 |
{{ article.title }}
9 | {{ article.content }}
10 | {% if link.childlinks %}
11 | {% for childlink in link.childlinks %}
12 | {% assign childlink_handle = childlink.url | remove: '#' %}
13 | {% for article in site.documentation %}
14 | {% if article.handle == childlink_handle %}
15 |