Getting started - Postgres

1. Clone the Repository

Clone the ShopiFast repository:

git clone https://github.com/adibmed/shopifast.git
cd shopifast

2. Install Dependencies

Install the dependencies using Yarn or favorite package manager:

yarn install

3. Start Docker Containers (Optional)

Launch the necessary Docker containers to spin up the a Postgres DB.

docker compose up -d

4. Set Up Environment Variables

Copy the example environment file and configure it:

cp .env.example .env

Open the .env file and update the variables as needed.

DATABASE_URL="postgres://default:secret@localhost:5432/shopifast?schema=public"

5. Run Database Migrations

Apply the database migrations (inside backend folder):

# inside the backend folder
yarn db:migrate
# OR: from the root folder (app)
# yarn workspace backend db:migrate

6. Run Database Migrations

Seed the database with plans (required for install creation) and coupons (for development):

cd web/backend
yarn db:seed:dev

7. Create a Shopify App

There are two ways to create a Shopify app:

  1. Using the Partners Dashboard: If you prefer to create your app through the dashboard, follow this guide.

  2. Using the Shopify CLI (Recommended): To create your app via the CLI, follow these steps:

  • Run the following command:
shopify app config link
  • When prompted, select Yes, create it as a new app and enter a name for your app.

8. Start the Development Server

Launch the development server:

yarn dev

9. 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 guid to create development store.

10. 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 the shopify.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 boilerplate. Your Shopify app is now running locally and connected to your development store.