{"id":20400356,"url":"https://github.com/fschutt/shopify-learning","last_synced_at":"2025-10-26T12:37:22.889Z","repository":{"id":90270368,"uuid":"515189380","full_name":"fschutt/shopify-learning","owner":"fschutt","description":"Shopify test example","archived":false,"fork":false,"pushed_at":"2022-07-18T13:10:29.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T21:11:38.580Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fschutt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-18T13:10:13.000Z","updated_at":"2022-07-18T13:10:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"d850abc9-9436-4072-8493-9e33848ed5c2","html_url":"https://github.com/fschutt/shopify-learning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fschutt%2Fshopify-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fschutt%2Fshopify-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fschutt%2Fshopify-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fschutt%2Fshopify-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fschutt","download_url":"https://codeload.github.com/fschutt/shopify-learning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241948080,"owners_count":20047325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T04:39:53.039Z","updated_at":"2025-10-26T12:37:22.831Z","avatar_url":"https://github.com/fschutt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shopify App Template - Node\n\nThis is a template for building a [Shopify app](https://shopify.dev/apps/getting-started) using Node and React. It contains the basics for building a Shopify app.\n\nRather than cloning this repo, you can use your preferred package manager and the Shopify CLI with [these steps](#installing-the-template).\n\n## Benefits\n\nShopify apps are built on a variety of Shopify tools to create a great merchant experience. The [create an app](https://shopify.dev/apps/getting-started/create) tutorial in our developer documentation will guide you through creating a Shopify app using this template.\n\nThe Node app template comes with the following out-of-the-box functionality:\n\n- OAuth: Installing the app and granting permissions\n- GraphQL Admin API: Querying or mutating Shopify admin data\n- REST Admin API: Resource classes to interact with the API\n- Shopify-specific tooling:\n  - AppBridge\n  - Polaris\n  - Webhooks\n\n## Tech Stack\n\nThis template combines a number of third party open-source tools:\n\n- [Express](https://expressjs.com/) builds the backend.\n- [Vitest](https://vitest.dev/) tests the express backend.\n- [Vite](https://vitejs.dev/) builds the [React](https://reactjs.org/) frontend.\n- [React Router](https://reactrouter.com/) is used for routing. We wrap this with file-based routing.\n- [React Query](https://react-query.tanstack.com/) queries the Admin API.\n\nThe following Shopify tools complement these third-party tools to ease app development:\n\n- [Shopify API library](https://github.com/Shopify/shopify-node-api) adds OAuth to the Express backend. This lets users install the app and grant scope permissions.\n- [App Bridge React](https://shopify.dev/apps/tools/app-bridge/getting-started/using-react) adds authentication to API requests in the frontend and renders components outside of the App’s iFrame.\n- [Polaris React](https://polaris.shopify.com/) is a powerful design system and component library that helps developers build high quality, consistent experiences for Shopify merchants.\n- [Custom hooks](https://github.com/Shopify/shopify-frontend-template-react/tree/main/hooks) make authenticated requests to the Admin API.\n- [File-based routing](https://github.com/Shopify/shopify-frontend-template-react/blob/main/Routes.jsx) makes creating new pages easier.\n\n## Getting started\n\n### Requirements\n\n1. You must [download and install Node.js](https://nodejs.org/en/download/) if you don't already have it.\n1. You must [create a Shopify partner account](https://partners.shopify.com/signup) if you don’t have one.\n1. You must [create a development store](https://help.shopify.com/en/partners/dashboard/development-stores#create-a-development-store) if you don’t have one.\n\n### Installing the template\n\nThis template can be installed using your preferred package manager:\n\nUsing yarn:\n\n```shell\nyarn create @shopify/app\n```\n\nUsing npx:\n\n```shell\nnpm init @shopify/app@latest\n```\n\nUsing pnpm:\n\n```shell\npnpm create @shopify/app@latest\n```\n\nThis will clone the template and install the required dependencies.\n\n#### Local Development\n\n[The Shopify CLI](https://shopify.dev/apps/tools/cli) connects to an app in your Partners dashboard. It provides environment variables, runs commands in parallel, and updates application URLs for easier development.\n\nYou can develop locally using your preferred package manager. Run one of the following commands from the root of your app.\n\nUsing yarn:\n\n```shell\nyarn dev\n```\n\nUsing npm:\n\n```shell\nnpm run dev\n```\n\nUsing pnpm:\n\n```shell\npnpm run dev\n```\n\nOpen the URL generated in your console. Once you grant permission to the app, you can start development.\n\n### Testing backend code\n\nUnit tests exist for the backend. First, build the [frontend](#build) and then run them using your preferred package manager:\n\nUsing yarn:\n\n```shell\ncd web \u0026\u0026 yarn test\n```\n\nUsing npm:\n\n```shell\ncd web \u0026\u0026 npm run test\n```\n\nUsing pnpm:\n\n```shell\ncd web \u0026\u0026 pnpm run test\n```\n\n### Testing frontend code\n\nUnit tests exist for the frontend. Run these using your preferred package manager:\n\nUsing yarn:\n\n```shell\ncd web/frontend/ \u0026\u0026 yarn test\n```\n\nUsing npm:\n\n```shell\ncd web/frontend/ \u0026\u0026 npm run test\n```\n\nUsing pnpm:\n\n```shell\ncd web/frontend/ \u0026\u0026 pnpm run test\n```\n\n## Deployment\n\n### Application Storage\n\nThis template uses [SQLite](https://www.sqlite.org/index.html) to store session data. The database is a file called `database.sqlite` which is automatically created in the root. This use of SQLite works in production if your app runs as a single instance.\n\nThe database that works best for you depends on the data your app needs and how it is queried. You can run your database of choice on a server yourself or host it with a SaaS company. Here’s a short list of databases providers that provide a free tier to get started:\n\n| Database   | Type             | Hosters                                                                                                                                                                                                                               |\n| ---------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| MySQL      | SQL              | [Digital Ocean](https://www.digitalocean.com/try/managed-databases-mysql), [Planet Scale](https://planetscale.com/), [Amazon Aurora](https://aws.amazon.com/rds/aurora/), [Google Cloud SQL](https://cloud.google.com/sql/docs/mysql) |\n| PostgreSQL | SQL              | [Digital Ocean](https://www.digitalocean.com/try/managed-databases-postgresql), [Amazon Aurora](https://aws.amazon.com/rds/aurora/), [Google Cloud SQL](https://cloud.google.com/sql/docs/postgres)                                   |\n| Redis      | Key-value        | [Digital Ocean](https://www.digitalocean.com/try/managed-databases-redis), [Amazon MemoryDB](https://aws.amazon.com/memorydb/)                                                                                                        |\n| MongoDB    | NoSQL / Document | [Digital Ocean](https://www.digitalocean.com/try/managed-databases-mongodb), [MongoDB Atlas](https://www.mongodb.com/atlas/database)                                                                                                  |\n\nTo use one of these, you need to change your session storage configuration. To help, here’s a list of [SessionStorage adapters](https://github.com/Shopify/shopify-api-node/tree/main/src/auth/session/storage).\n\n### Build\n\nThe frontend is a single page app. It requires the `SHOPIFY_API_KEY`, which you can find on the page for your app in your partners dashboard. Paste your app’s key in the command for the package manager of your choice:\n\nUsing yarn:\n\n```shell\ncd web/frontend/ \u0026\u0026 SHOPIFY_API_KEY=REPLACE_ME yarn build\n```\n\nUsing npm:\n\n```shell\ncd web/frontend/ \u0026\u0026 SHOPIFY_API_KEY=REPLACE_ME npm run build\n```\n\nUsing pnpm:\n\n```shell\ncd web/frontend/ \u0026\u0026 SHOPIFY_API_KEY=REPLACE_ME pnpm run build\n```\n\nYou do not need to build the backend.\n\n## Hosting\n\nThe following pages document the basic steps to host and deploy your application to a few popular cloud providers:\n\n- [fly.io](/web/docs/fly-io.md)\n- [Heroku](/web/docs/heroku.md)\n\n## Known issues\n\n### Hot module replacement and Firefox\n\nWhen running the app with the CLI in development mode on Firefox, you might see your app constantly reloading when you access it.\nThat happens because of the way HMR websocket requests work, and the way the CLI is set up to tunnel requests through ngrok.\n\nUntil we find a permanent solution that enables HMR on Firefox, this template accepts the `SHOPIFY_VITE_HMR_USE_POLLING` env var to replace HMR with polling.\nWhile not as responsive as HMR, the frontend will still refresh itself every few seconds with your changes.\n\nYou can export this variable from your shell profile, or set it when running the `dev` command, e.g.:\n\n```shell\n# Using yarn\nSHOPIFY_VITE_HMR_USE_POLLING=1 yarn dev\n# or using npm\nSHOPIFY_VITE_HMR_USE_POLLING=1 npm run dev\n# or using pnpm\nSHOPIFY_VITE_HMR_USE_POLLING=1 pnpm dev\n```\n\n### I can't get past the ngrok \"Visit site\" page\n\nWhen you’re previewing your app or extension, you might see an ngrok interstitial page with a warning:\n\n```\nYou are about to visit \u003cid\u003e.ngrok.io: Visit Site\n```\n\nIf you click the `Visit Site` button, but continue to see this page, then you should run dev using an alternate tunnel URL that you run using tunneling software.\nWe've validated that [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/trycloudflare/) works with this template.\n\nTo do that, you can [install the `cloudflared` CLI tool](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/), and run:\n\n```shell\n# Note that you can also use a different port\ncloudflared tunnel --url http://localhost:3000\n```\n\nIn a different terminal window, navigate to your app's root and call:\n\n```shell\n# Using yarn\nyarn dev --tunnel-url https://tunnel-url:3000\n# or using npm\nnpm run dev --tunnel-url https://tunnel-url:3000\n# or using pnpm\npnpm dev --tunnel-url https://tunnel-url:3000\n```\n\n## Developer resources\n\n- [Introduction to Shopify apps](https://shopify.dev/apps/getting-started)\n- [App authentication](https://shopify.dev/apps/auth)\n- [Shopify CLI](https://shopify.dev/apps/tools/cli)\n- [Shopify API Library documentation](https://github.com/Shopify/shopify-api-node/tree/main/docs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffschutt%2Fshopify-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffschutt%2Fshopify-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffschutt%2Fshopify-learning/lists"}