This Shopify app will help customers to not losing their sells for stock management. After zero stock this app will automatically add those button so that customer can take actions.
This template combines a number of third party open source tools:
- Laravel builds and tests the backend.
- Vite builds the React frontend.
- React Router is used for routing. We wrap this with file-based routing.
- React Query queries the Admin API.
- You must create a Shopify partner account if you don’t have one.
- You must create a store for testing if you don't have one, either a development store or a Shopify Plus sandbox store.
- You must have PHP installed.
- You must have Composer installed.
- You must have Node.js installed.
This template runs on Shopify CLI 3.0, which is a node package that can be included in projects. You can install it using your preferred Node.js package manager:
Using yarn:
yarn create @shopify/app --template php
Using npx:
npm init @shopify/app@latest -- --template php
Using pnpm:
pnpm create @shopify/app@latest --template php
This will clone the template and install the CLI in that project.
Once the Shopify CLI clones the repo, you will be able to run commands on your app. However, the CLI will not manage your PHP dependencies automatically, so you will need to go through some steps to be able to run your app. These are the typical steps needed to set up a Laravel app once it's cloned:
-
Start off by switching to the
web
folder:cd web
-
Install your composer dependencies:
composer install
-
Create the
.env
file:cp .env.example .env
-
Bootstrap the default SQLite database and add it to your
.env
file:touch storage/db.sqlite
NOTE: Once you create the database file, make sure to update your
DB_DATABASE
variable in.env
since Laravel requires a full path to the file. -
Generate an
APP_KEY
for your app:php artisan key:generate
-
Create the necessary Shopify tables in your database:
php artisan migrate
And your Laravel app is ready to run! You can now switch back to your app's root folder to continue:
cd ..
The Shopify CLI connects to an app in your Partners dashboard. It provides environment variables, runs commands in parallel, and updates application URLs for easier development.
You can develop locally using your preferred Node.js package manager. Run one of the following commands from the root of your app:
Using yarn:
yarn dev
Using npm:
npm run dev
Using pnpm:
pnpm run dev
Open the URL generated in your console. Once you grant permission to the app, you can start development.