Getting Started - Laravel
1. Clone the Repository
Clone the ShopiFast repository:
git clone https://github.com/shopifast/laravel-app.git
cd shopifast
2. Install Dependencies
Install PHP and Node.js dependencies:
composer install
npm install
3. Start Docker Containers (Optional)
Launch the necessary Docker containers for PostgreSQL:
docker compose up -d
4. Set Up Environment Variables
Copy the example environment file and configure it:
cp .env.example .env
Generate application key:
php artisan key:generate
Open the .env
file and update the database variables:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=shopifast
DB_USERNAME=default
DB_PASSWORD=secret
5. Set Up Database
Run migrations and seed the database:
php artisan migrate
php artisan db:seed
6. Create a Shopify App
There are two ways to create a Shopify app:
-
Using the Partners Dashboard: If you prefer to create your app through the dashboard, follow this guide.
-
Using the Shopify CLI (Recommended): To create your app via the CLI, follow these steps:
shopify app config link
When prompted, select Yes, create it as a new app
and enter a name for your app.
7. Start the Development Server
Launch both Laravel and Vite development servers:
# Terminal 1: Start Laravel server
php artisan serve
# Terminal 2: Start Vite server for frontend
npm run dev
8. Select Development Store
When prompted, select your development store where you want to install and test the app. If you don't have a dev store, follow this guide to create a development store.
9. Expose the App to the Internet
To preview your app on a dev store, it must be accessible online. You have two options:
-
Let Shopify handle it (recommended): Shopify uses Cloudflare Argo Tunnel. A new URL is generated each time you run the app. When prompted, select
(y) Yes, automatically update
to let Shopify handle app exposure. -
Use your own tunneling service (e.g., Ngrok): To use your own tunnel, select
(n) No, never
. Then, update the URLs in theshopify.app.toml
file with your tunnel URLs.
If using Shopify's method, skip the step of updating URLs.
Conclusion
Congratulations! You've successfully set up the ShopiFast Laravel boilerplate. Your Shopify app is now running locally and connected to your development store.