Follow these steps to set up the boilerplate for your Shopify app (embedded and non-embedded).
First, clone the repository to your local machine:
- Database Type: MySQL
- Configure your .env
file with your database credentials:
Next, install the PHP dependencies using Composer:
After that, install the JavaScript dependencies with NPM:
Set up your database by running the migrations:
By default, this project uses a database queue connection. If you're using Cloudways, you should change the queue connection to Redis:
.env
file:config/queue.php
file, ensure your settings look like this:Add your Shopify app credentials to the .env
file:
For embedded apps, add the following session settings to your .env
file to preserve logged-in
user details:
To set up the routes for your application:
routes/embedded_example_web.php
to
routes/web.php
.
routes/non_embedded_example_web.php
to
routes/web.php
.
In your Shopify app configuration:
true
for embedded apps and false
for
non-embedded apps.In your React components, if your app is embedded, make sure to import the necessary hook from Inertia:
You can then extract the query parameters like this:
Use the extracted query with every route you call in your app. For example:
Note: For non-embedded apps, there is no need for this integration.
To start the development server, run:
Then, in a separate terminal, run:
You can access your application at: