Hi @rushikesh93
This is Glass It , a price tracking solution that can help boost profit margins. I will try to provide help for some of your questions:
-
from where do I get that Updated URL, so I can install that custom app in Partner Account?
-
what’s the actual use of NGROK here?
The URL should be a domain name you registered when you’re ready to deploy to production, and it should be the entry point you setup for Shopify to interact with the server that is hosting your Shopify app. When you run ‘npm run dev’, this command uses ngrok to create a tunnel to your local computer which is considered the development environment. When you run the ‘npm run dev’ command in your Shopify PHP template project, the command also takes care of automatically creating and filling in temporary URLs that point to your app (the dev environment) in your Partner Account.
The first thing that happens when you click “Install App” is Shopify makes a request to your App URL. Shopify expects your app (pointed to by the URL) to respond a certain way, depending on various scenarios. The Shopify PHP template has built in route handlers already defined which you can see in the routes/web.php file that handle the request for different scenarios. Here are a few of the scenarios:
a) this is the first time making a request to your App’s URL, a.k.a installing your app
b) if your app has already been installed and is embedded, it must properly handle being embedded within an iframe in Shopify Admin. That means if accessed directly with your App URL in a browser, it should be re-directing to Shopify Admin since it’s embedded.
c) if your app is installed + embedded, but merchant is not logged in when they open your app, then your app (the URL) must respond letting the user know to complete the required OAuth flow
See the getting started guide for more information related to the PHP template, which handles all the above scenarios already:
https://shopify.dev/apps/auth/oauth/getting-started
When you finish developing and testing your app, you are ready to deploy the app to production. Deploying to production won’t be done using the command ‘npm run dev’ since this creates a tunnel to your local development environment. It is important to note, the ngrok tunnel and ‘npm run dev’ command take care of resolving front-end and back-end requests from the React/PHP template being served to the web. When you upload your app files to your hosting server, the hosting server will also need to resolve front-end and back-end requests made to your Shopify App.
The Shopify deployment guide recommends Fly.io or Heroku hosting providers who can make going live easier:
https://shopify.dev/apps/deployment/web
Apache Web Server or nGinx can also be used, however these hosting solutions require configuring the server to handle front-end/back-end requests properly.
Hope that helps!