Tip
Questions or issues? Check our discord channel for help.
- Next.js 14: File-based routing, React 18, Fast Refresh, Image Optimization and more.
- App Router: Uses React Server Components, Data Cache, and async components.
- TypeScript: Strongly typed codebase and GraphQL payloads with strict mode.
- GraphQL best practices: Uses GraphQL Codegen and
TypedDocumentString
to reduce boilerplate and bundle size. - Customizable CSS: TailwindCSS can be extended or replaced with an alternative CSS solution.
- Tooling included: Comes with ESLint, Prettier, Husky, Lint Staged, and Codegen preconfigured.
Global:
- Channel switcher and Geo detection (coming soon)
- Dynamic menu
- Hamburger menu
- SEO data
Checkout:
- Single page checkout (including login)
- Portable to other frameworks (doesn't use Next.js components)
- Adyen integration
- Stripe integration
- Customer address book
- Vouchers and Gift Cards
Product catalog:
- Categories
- Variant selection
- Product attributes
- Image optimization
My account:
- Order history (coming soon)
- Order completion
- Order details
To quickly get started with the backend, use a free developer account at Saleor Cloud.
Alternatively you can run Saleor locally using docker.
Install or update to the latest version of the Saleor CLI by running the following command:
npm i -g @saleor/cli@latest
Clone storefront, install dependencies, and connect with the provided Saleor instance hostname
saleor storefront create --url https://{SALEOR_HOSTNAME}/graphql/
Clone repository:
git clone https://github.com/saleor/storefront.git
Copy environment variables from .env.example
to .env
:
cp .env.example .env
Edit .env
and set NEXT_PUBLIC_SALEOR_API_URL
to your Saleor GraphQL endpoint URL, e.g., https://example.saleor.cloud/graphql/
.
Then, install pnpm
and run the following command to install all dependencies in the repo:
pnpm i
Currently, Saleor Storefront supports payments via the Saleor Adyen App. To install and configure the payment app go to the "Apps" section in the Saleor Dashboard (App Store is only available in Saleor Cloud).
WARNING: To configure the Adyen App, you must have an account with Adyen.
NOTE: Saleor Stripe App integration is a work in progress.
To start the development server, run the following:
pnpm dev
The app is now running at http://localhost:3000
.
NOTE: Saleor Storefront is a Next.js app. In case you are not familiar with Next.js, we recommend you to read the Next.js documentation (make sure you've selected "Using App Router" in the sidebar).
After altering or creating new GraphQL queries in gql
folder, you need to run the following command to generate types and javascript queries:
pnpm run generate
Visit http://{your-host}/api/draft
to enable cookies that disable caching to preview catalog and content changes instantly. Learn more about the Draft Mode in Next.js docs.