...
Requirement Gathering:
Plugin Dashboard Repo - Local Dev Setup & Research.
Develop overview of system, define system purpose.
Shopify Dashboard & Research.
Develop overview of Shopify system.
Document Shopify requirements.
Planning & Design:
The plugin is broken down into components, namely:App install
Install requires registration as an app provider.
Authentication process and Token exchange.
The app registers within Shopify and Customer shop.
Privilege establishment
Persists to DB.
App uninstall
Authentication process and Token exchange.
The app un-registers within Shopify and Customer shop.
Deletes from DB.
App Configuration
Configuration settings. App requires configuring.
Options are provided to be either an eKomi client or Netcomm or both.eKomi Client settings:
ShopId
Shop Interface Password
Netcomm Client settings:
NetcommId
App configuration will be persisted in the DB.
CRUD functionality.
Implementation:
Local Dev Setup.
Setup environment to develop - environment specifics needed for the repo to work.
Learn Plugin Dashboard system.
Read Plugin documentation.
Read Plugin code as I’m supposed to model off them.
Shopify Setup
Learn what Shopify requires and how to do development with them.
Shopify PHP - https://github.com/Shopify/shopify-api-php
https://shopify.dev/docs/apps/launch/app-requirements-checklist
https://shopify.dev/docs/api/app-bridge
So based upon our tech stack it seems like we actually just use the PHP library / dependancy to intergrate the app with Shopify.Shopify app authentication and authorization.
https://shopify.dev/docs/apps/build/authentication-authorization
https://shopify.dev/docs/apps/build/authentication-authorization/set-embedded-app-authorization?extension=javascript
Authentication is the process of verifying the identity of the user or the app. To keep transactions on Shopify’s platform safe and secure, all apps connecting with Shopify APIs must authenticate when making API requests.Authorization is the process of giving permissions to apps. When an app user installs a Shopify app they authorize the app, enabling the app to acquire an access token. For example, an app might be authorized to access orders and product data in a store.
Create a route for starting the OAuth method such as/login
. In this route, theShopify\Auth\OAuth::begin
method will be used. Thebegin
method returns a URL that will be used for redirecting the user to the Shopify Authentication screen.To complete the OAuth process, your app needs to validate the callback request made by Shopify after the merchant authorizes your app to access their store data.To do that, you can call the
Shopify\Auth\OAuth::callback
method in the endpoint defined in theredirectPath
argument of the begin method.Shopify - Ngrok.
In the Shopify ecosystem, embedded apps run in an iframe in a production environment. In order to test the functionality of your app within that context in development, you’re going to want to tunnel what you have running locally to an accessible URL.
Plugin Development:
DB Schema
Code Block TABLE `netcomm_configuration` : `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, `shop_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `access_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `app_uninstall_web_hook_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `order_fulfilled_web_hook_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `widget_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `widget_language` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `terms_and_conditions` tinyint(1) NOT NULL DEFAULT '1', `instruction` tinyint(1) NOT NULL, `shop_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `shop_interface_password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `netcomm_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `store_data` longtext COLLATE utf8_unicode_ci, `enabled` tinyint(1) NOT NULL DEFAULT 'false', `created` datetime NOT NULL, `updated` datetime NOT NULL, `member_of_netcomm` tinyint(1) NOT NULL DEFAULT 'false', `member_of_ekomi` tinyint(1) NOT NULL DEFAULT 'false', PRIMARY KEY (`id`), UNIQUE KEY `UNIQ_89D23822678D9590` (`shop_url`), UNIQUE KEY `UNIQ_89D238224D16C4DD` (`shop_id`), UNIQUE KEY `UNIQ_89D23822B6A2DD68` (`access_token`), UNIQUE KEY `UNIQ_89D23822A76ED395` (`user_id`), CONSTRAINT `FK_89D23822A76ED395` FOREIGN KEY (`user_id`) REFERENCES `fos_user` (`id`)
Install - Process definition:
Install requires registration as an app provider.
Authentication process and Token exchange.
The app registers within Shopify and Customer shop.
Privilege establishment.
Persists to DB.
Uninstall
Authentication process and Token exchange.
The app un-registers within Shopify and Customer shop.
Deletes from DB.
Link to Uninstall process flow.
Configuration CRUD
Configuration settings. App requires configuring.
Options are provided to be either an eKomi client or Netcomm or both.eKomi Client settings:
ShopId
Shop Interface Password
Netcomm Client settings:
NetcommId
App configuration will be persisted in the DB.
CRUD functionality.
Link to Configuration process flow.
Refactor / Testing Phase.
Identify issues and refactor
Documentation / Commenting.
Document Shopify requirements for apps.
Explain where app meets requirements.
Comment functions and classes.
...