Skip to main content

Jaya Tools app

Jaya Tools will be used for multiple functions on the CINQ and LIKELY stores.

Sync Master System

Sync Master system gets files from FTP server, creates new products, updates a MS SQL server after creation, and send an email with links to the newly created products. Note, inventory is no included in the creation and the products are set to draft.

To Run Locally

Clone the project to your local computer
Run npm install on the rooter folder
Run cd web and npm install
Copy env file from Passportal and put into web folder. Run npm run dev Connect to existing app (Jaya Tools) and use textconnects-ui-checkout as the dev store.

Action this app performs

Daily run using a worker (single store) Manual run using a button on the UI (single store) Manual run on all stores using a button on the UI (multiple stores)

Logic for Daily Worker and Manual Run

Call runSync() for store in res.locals.shopify.session when running manually or :shop param when calling the endpoint to set up the worker (see Setup Daily Worker)

Connect to Jaya's FTP server. Open the folder for the current store and get the files inside. Each row of the file is a variant. The file is read and rows are combined to form products by linking identical handles. After they are linked, products are created on Shopify. After successful creation, we then email the address that is set for the store and upload the product data into the jaya_inventory table on TextConnects' MS SQL server. Each row that is inserted into the table is a single variant that was created for all of the products. Then, we move the original FTP file from the folder to the ATS_Proc folder and rename it by prepending the brand name: ATS_Proc \ ${brand}_${filename}. Finally, we log the run into style_master_sync_run_log table in the jaya database on Digital Ocean

IMPORTANT: the folder name to open is an env variable in the app on Digital Ocean: CINQ_FOLDER="OB_STYLES_CINQ" and the email address to send the email to is an env variable on Digital Ocean: CINQ_NOTIFICAION_EMAIL="[email protected]"

Logic for Manual Run on All Stores

We use the same logic as above, calling runSync() for both stores individually.

Deploy on Store

The app is currently deployed on Digital Ocean and configured on Shopify.

Install app on Store

App needs to be installed on CINQ and LIKELY

Setup Daily Worker

In Postman, send a GET request to https://app-jaya-tool-io9vl.ondigitalocean.app/sync/auto/{{ domain }} Replace {{ domain }} with shop's myshopify domain. Example:

https://app-jaya-tool-io9vl.ondigitalocean.app/sync/auto/textconnects-ui-checkout.myshopify.com

Troubleshooting

  • Check the style_master_sync_run_log table in the jaya database on Digital Ocean. It has a record of each run.

  • Change the DEBUG env variable to 1 on Digital Ocean to see console logs in the runtime logs