This repository is a monorepo built with Turborepo. Here's the list of all the apps and packages in it (each app has its own README):
apps/storefront: Next.js e-commerce storefront starter packapps/saleor-app-checkout: a Next.js Saleor app with a dashboard for managing settings and theme, backend for Checkout, and the Checkout Storefront – ready to be extended/modified
packages/ui-kit: UI kit for Storefront and Checkoutpackages/eslint-config-checkout:eslintconfigurationpackages/tsconfig:tsconfig.jsons used throughout the monorepopackages/checkout-storefront: Checkout storefront componentpackages/checkout-common: Common types and utilspackages/env-vars: Importing env vars across packages
This monorepo uses pnpm as a package manager, so you will have to install it beforehand. To install it, run:
npm install -g pnpmTo install dependencies, run:
pnpm iTo start all the dev servers, run:
pnpm devThe command will boot up 4 applications running on different ports..
You can also start a specific app by running:
pnpm dev --filter=saleor-app-checkoutFor development instructions, please go to apps/saleor-app-checkout/README.md.
For development instructions, please go to packages/checkout-storefront/README.md.
To build all apps and packages, run the following command:
pnpm run build
You can also build a specific app or package by running this command:
pnpm run build --filter=saleor-app-checkoutIn this example, we'll only build apps/saleor-app-checkout
After completing the development, these commands are suitable to start the storefront and saleor-app-checkout applications in a production-like environment:
pnpm build
pnpm startAlternatively, you can start a specific application by running either of these commands:
pnpm start:saleor-app-checkoutpnpm start:storefrontEither way, the applications will start on different ports.
- apps/react-storefront: http://localhost:3000
- apps/saleor-app-checkout: http://localhost:3001
- packages/checkout-storefront: http://localhost:3002
- packages/ui-kit storybook: http://localhost:6006
To generate GraphQL code based on the latest schema from Saleor instance defined in SALEOR_API_URL env variable, run this command:
pnpm run generate
You need to run this command after each change in the *.graphql files or when you update your Saleor instance.
Before committing the code, git pre-hooks will check staged changes for following the code styles. If you would like to format the code by yourself, run the command:
pnpm lintInstructions how to configure the application (e.g. change the GraphQL API URL) can be found here.
Change environment variables inside .env file:
-
SALEOR_API_URL— GraphQL endpoint of your SaleorExample:
https://my-env.eu.saleor.cloud/graphql/
There are more environment variables available in each app. Go to their README's to learn more.
The repository contains ready-to-use VS Code debugger configuration (.vscode/launch.json).
Start server in debug mode
pnpm debugAdd breakpoints, and start debugging session in your editor.
GraphQL extension for VSCode adds syntax highlighting, validation, and language features like go to definition, hover information, and autocompletion for GraphQL projects. This extension also works with queries annotated with gql tag.
VS Marketplace link