Skip to content

Commit 706528f

Browse files
Merge pull request #132 from Shopify/kos/update_discounts_tutorial_app
Update discounts tutorial app to use Express library
2 parents 4098d6c + a4fcb89 commit 706528f

18 files changed

+178
-1876
lines changed

sample-apps/discounts-tutorial/README.md

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@ The Node app template comes with the following out-of-the-box functionality:
2323
This template combines a number of third party open-source tools:
2424

2525
- [Express](https://expressjs.com/) builds the backend.
26-
- [Vitest](https://vitest.dev/) tests the express backend.
2726
- [Vite](https://vitejs.dev/) builds the [React](https://reactjs.org/) frontend.
2827
- [React Router](https://reactrouter.com/) is used for routing. We wrap this with file-based routing.
29-
- [React Query](https://react-query.tanstack.com/) queries the GraphQL Admin API.
28+
- [React Query](https://react-query.tanstack.com/) queries the Admin API.
3029

3130
The following Shopify tools complement these third-party tools to ease app development:
3231

3332
- [Shopify API library](https://github.com/Shopify/shopify-api-node) adds OAuth to the Express backend. This lets users install the app and grant scope permissions.
34-
- [App Bridge React](https://shopify.dev/tools/app-bridge/react-components) adds authentication to API requests in the frontend and renders components outside of the App’s iFrame.
33+
- [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.
3534
- [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.
36-
- [Custom hooks](https://github.com/Shopify/shopify-frontend-template-react/tree/main/hooks) make authenticated requests to the GraphQL Admin API.
35+
- [Custom hooks](https://github.com/Shopify/shopify-frontend-template-react/tree/main/hooks) make authenticated requests to the Admin API.
3736
- [File-based routing](https://github.com/Shopify/shopify-frontend-template-react/blob/main/Routes.jsx) makes creating new pages easier.
3837

3938
## Getting started
@@ -94,50 +93,6 @@ pnpm run dev
9493

9594
Open the URL generated in your console. Once you grant permission to the app, you can start development.
9695

97-
### Testing backend code
98-
99-
Unit tests exist for the backend. First, build the [frontend](#build) and then run them using your preferred package manager:
100-
101-
Using yarn:
102-
103-
```shell
104-
cd web && yarn test
105-
```
106-
107-
Using npm:
108-
109-
```shell
110-
cd web && npm run test
111-
```
112-
113-
Using pnpm:
114-
115-
```shell
116-
cd web && pnpm run test
117-
```
118-
119-
### Testing frontend code
120-
121-
Unit tests exist for the frontend. Run these using your preferred package manager:
122-
123-
Using yarn:
124-
125-
```shell
126-
cd web/frontend/ && yarn test
127-
```
128-
129-
Using npm:
130-
131-
```shell
132-
cd web/frontend/ && npm run test
133-
```
134-
135-
Using pnpm:
136-
137-
```shell
138-
cd web/frontend/ && pnpm run test
139-
```
140-
14196
## Deployment
14297

14398
### Application Storage
@@ -153,7 +108,7 @@ The database that works best for you depends on the data your app needs and how
153108
| Redis | Key-value | [Digital Ocean](https://www.digitalocean.com/try/managed-databases-redis), [Amazon MemoryDB](https://aws.amazon.com/memorydb/) |
154109
| MongoDB | NoSQL / Document | [Digital Ocean](https://www.digitalocean.com/try/managed-databases-mongodb), [MongoDB Atlas](https://www.mongodb.com/atlas/database) |
155110

156-
To 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).
111+
To 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/blob/main/docs/usage/session-storage.md).
157112

158113
### Build
159114

@@ -181,10 +136,9 @@ You do not need to build the backend.
181136

182137
## Hosting
183138

184-
The following pages document the basic steps to host and deploy your application to a few popular cloud providers:
139+
When you're ready to set up your app in production, you can follow [our deployment documentation](https://shopify.dev/apps/deployment/web) to host your app on a cloud provider like [Heroku](https://www.heroku.com/) or [Fly.io](https://fly.io/).
185140

186-
- [fly.io](/web/docs/fly-io.md)
187-
- [Heroku](/web/docs/heroku.md)
141+
When you reach the step for [setting up environment variables](https://shopify.dev/apps/deployment/web#set-env-vars), you also need to set the variable `NODE_ENV=production`.
188142

189143
## Known issues
190144

sample-apps/discounts-tutorial/web/__tests__/serve.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)