• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    JavaScript
  • Created over 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Saleor documentation.

Saleor Documentation

What's In This Document

Get Started in 5 Minutes

  1. Make sure you are using Node in version 12+:
node --version
  1. Install project dependencies:
npm install
  1. Run your dev server:
npm start

Production Build

  1. Build project:
npm run build
  1. Testing build local:
npm run serve

Editing Content

Directory Structure

  • /docs Current Canary developer documentation.
  • /docs/api-reference Automatically generated API reference.
  • /docs/api-storefront Automatically generated Storefront API reference.
  • /docusaurus.config.js Docusaurus configuration file.
  • /docusaurus2-graphql-doc-generator GraphQL API Reference plugin code.
  • /sidebars.js Sidebar menu structure.
  • /static Styling and other static files.
  • /versioned_docs & /versioned_sidebars Tagged versions of documentation matching the latest Saleor release.

Formatting

Code formatting

Code and response examples should be inside code blocks with proper language:

```graphql
query {
  id
  name
}
```
```json
{
  "errorCode": 400
}
```

Lining pages

Use full path to the file to avoid linking to wrong page.

  • :white_check_mark: Example of good link: [Attributes](/docs/developer/attributes.mdx)
  • :stop_sign: Avoid: [Attributes](/attributes)

Using custom React components

All documentation files use extension:

  • .mdx - Developer documentation
  • .md - Dashboard documentation

If your page uses custom react components, you are required to use .mdx file extension. Import statement is also required:

## <!-- /docs/developer/export/export-overview.mdx file -->

## title: Exporting Products

import Foo from "@site/components/Foo";

...

<Foo />

For charts we are using Mermaid package.

Editing an existing docs page

Edit docs by navigating to docs/ and editing the corresponding document:

docs/doc-to-be-edited.md

---
id: page-needs-edit
title: This Doc Needs To Be Edited
---

Edit me...

For more information about docs, click here

Adding Content

Adding a new docs page to an existing sidebar

  1. Create the doc as a new markdown file in /docs, example docs/newly-created-doc.md:
---
id: newly-created-doc
title: This Doc Needs To Be Edited
---

My new content here..
  1. Refer to that doc's ID in an existing sidebar in sidebar.js:
// Add newly-created-doc to the Getting Started category of docs
{
  "docs": {
    "Getting Started": [
      "quick-start",
      "newly-created-doc" // new doc here
    ],
    ...
  },
  ...
}

For more information about adding new docs, click here

Adding items to your site's top navigation bar

  1. Add links to docs, custom pages or external links by editing the headerLinks field of siteConfig.js:
{
  headerLinks: [
    ...
    /* you can add docs */
    {
      type: "doc",
      docId: "dashboard/before-you-start",
      label: "Dashboard Manual",
      position: "left",
    },
    /* you can add custom pages */
    { page: 'help', label: 'Help' },
    /* you can add external links */
    { href: 'https://github.com/facebook/Docusaurus', label: 'GitHub' },
    ...
  ],
  ...
}

For more information about the navigation bar, click here

Adding custom pages

  1. Docusaurus uses React components to build pages. The components are saved as .js files in ./pages/en:
  2. If you want your page to show up in your navigation header, you will need to update siteConfig.js to add to the headerLinks element:
{
  headerLinks: [
    ...
    { page: 'my-new-custom-page', label: 'My New Custom Page' },
    ...
  ],
  ...
}

For more information about custom pages, click here.

Versioning

The latest Saleor version is labeled as 3.x. It provides documentation for users based on the latest stable release of Saleor.

The current in-progress version is labeled as Canary and is built based on the documents in the docs folder. The "Canary" version represents the bleeding-edge development work, where the latest enhancements, bug fixes, and experimental features are being actively worked on and tested.

The canary version serves as a preview of what's to come, enabling developers and early adopters to explore upcoming features and contribute to the platform's advancement.

Updating versions

The changes made to the main docs folder will be available in the Canary version. The changes made to the versioned_docs/version-3.x folder will be available in the 3.x version (current).

Updating stable version

Apply changes in both docs and versioned_docs/version-3.x folders.

Introducing features for the upcoming Saleor version

Apply changes in docs folders.

Releasing Canary to 3.x

With the use of GitHub Action

update-stable-version GitHub Action workflow checks on a daily basis the saleor/saleor repository's latest release in search for the attached schema.graphql file. Such an attachment suggests the need to update the 3.x docs and if found it creates a PR updating 3.x based on canary.

Manually

  1. Remove versions.json file or just "3.x" inside
  2. Run UPDATE_SALEOR=true npx docusaurus docs:version 3.x
  3. Commit changes and issue a PR

Updating the API Reference & Storefront Reference

Files in /docs/api-reference and /docs/api-storefront are generated by @graphql-markdown/docusaurus package. Introduction pages are automatically copied from /template/api-reference.mdx and /template/storefromt/api-reference.mdx files.

Updating

To update the API reference:

  1. Put schema.graphql locally into the root of the saleor-docs repository
  2. Run npm run update-api-reference

The script behind the scenes does several steps:

  1. The api-reference is generated in .tmp folder.
  2. The api-storefront is generated in .tmp folder. This step also includes the generation of storefront schema. Storefront schema is a subset of the Saleor schema with filtered-out elements that require permissions.
  3. The highlighting script does additional improvements in the generated docs. It makes the Saleor version and required permissions more visible.
  4. The current references from docs folder are being removed and generated references in .tmp folder are moved to the docs.
  5. The code examples are being injected. The code examples from the examples folder are being put into corresponding files in the references folder.

Search

Saleor Docs are using Algolia DocSearch for the website search.

Crawl interval

DocSearch crawls the website once a week on Friday and aggregates all the content in an Algolia index. This content is then queried directly from the front-end using the Algolia API.

Ranking strategy

The website's search results are meticulously ranked to enhance user relevance and experience. A custom ranking function, known as pageRank, is employed for this purpose. The ranking strategy prioritizes various content categories as follows:

  1. metaPageRank: This takes precedence and is determined by a custom meta attribute, providing a top-tier ranking for specific content.

  2. Documentation Pages: General documentation pages are next in line for ranking, excluding those generated based on schema API reference and API storefront.

  3. API Reference Pages: These pages are ranked differently based on the type of operation they represent.

function pageRank(url) {
  if (metaPageRank) {
    return metaPageRank;
  }
  if (!/\/api-reference\/|\/api-storefront\//.test(url.pathname)) {
    // not part of API reference
    return "40";
  }
  if (/\/mutations\//.test(url.pathname)) {
    // mutation
    return "30";
  }
  if (/\/queries\//.test(url.pathname)) {
    // query
    return "20";
  }
  return "10";
}

Manual Ranking Control

For even finer control over search result rankings, you can manually influence the ranking of specified pages by adding a custom meta attribute - rank - to the page. The rank meta is configured to have the highest priority in Algolia.

To assign a custom rank to a particular page, use the following code snippet:

<head>
  <meta name="rank" content="50" />
</head>

Debugging

In dev mode, Docusaurus serves a debug page with a list of all available routes and config at http://localhost:3000/\_\_docusaurus/debug.

Full Docusaurus Documentation

Full documentation can be found on the website.

More Repositories

1

saleor

Saleor Core: the high performance, composable, headless commerce API.
Python
20,676
star
2

storefront

Saleor Storefront built with React 18, Next.js 14, App Router, TypeScript, GraphQL, and Tailwind CSS.
TypeScript
983
star
3

saleor-dashboard

A GraphQL-powered, single-page dashboard application for Saleor.
TypeScript
832
star
4

saleor-storefront

A GraphQL-powered, NextJs-based, PWA storefront for Saleor. IMPORTANT: This project is [DEPRECATED] in favor of saleor/react-storefront soon to become our default demo and storefront starter pack.
TypeScript
768
star
5

saleor-platform

All Saleor services started from a single repository with docker-compose.
640
star
6

saleor-sdk

Deprecated! See the announcement below. JavaScript/TypeScript SDK for building e-commerce experiences and checkouts with Saleor API.
TypeScript
129
star
7

apps

A central space for Saleor Apps, integrations, and the App Store 🚀
TypeScript
105
star
8

macaw-ui

MacawUI: an official UI design kit for Saleor
TypeScript
100
star
9

cli

Command-line interface allowing interaction with Saleor Cloud environments.
TypeScript
69
star
10

saleor-app-template

Your boilerplate for new Saleor Apps. Batteries included.
TypeScript
62
star
11

app-sdk

SDK for building great Saleor Apps
TypeScript
46
star
12

saleor.io-learn

The Saleor Tutorial content. Learn how to create production-grade Saleor storefronts with React and Next.js. https://saleor.io/learn
39
star
13

saleor-app-payment-adyen

TypeScript
36
star
14

saleor-app-slack

TypeScript
29
star
15

saleor-next-starter

TypeScript
27
star
16

saleor-checkout

Migrated into a monorepo: https://github.com/saleor/react-storefront | The first fully open source and production-ready checkout experience.
TypeScript
22
star
17

saleor-app-klaviyo

TypeScript
20
star
18

auth-sdk

TypeScript
19
star
19

examples

Examples showing how to use the Saleor API.
15
star
20

saleor-app-payment-klarna

TypeScript
15
star
21

saleor-graphql-playground

TypeScript
12
star
22

saleor-app-payment-stripe

TypeScript
12
star
23

app-bridge

An official library for handling all communication between Saleor Dashboard and Saleor Apps.
TypeScript
12
star
24

create-saleor-app

TypeScript
10
star
25

app-examples

Common examples and patterns writing great Saleor apps
10
star
26

example-flutter

Saleor Example: Flutter Mobile App (Dart)
Dart
9
star
27

example-react-native-typescript

Saleor Example: React Native App in TypeScript using Expo
TypeScript
9
star
28

saleor-stellate

Stellate support for Saleor Commerce
TypeScript
9
star
29

saleor-email-templates

Example e-mail templates for Saleor
HTML
9
star
30

dummy-payment-app

Bare-bones app for testing Saleor's Transactions API
TypeScript
8
star
31

example-nextjs-app-router-starter

Saleor Example: Next.js 13 App Router Starter
TypeScript
8
star
32

requests-hardened

A library that overrides the default behaviors of the requests library, and adds new security features.
Python
8
star
33

saleor-app-search

TypeScript
6
star
34

tutorial-walkthrough

TypeScript
6
star
35

saleor-app-cms

TypeScript
6
star
36

example-nextjs-stripe

TypeScript
6
star
37

saleor-plugin-avatax-excise

Python
6
star
38

example-react-cra-typescript

Saleor Example: React App in TypeScript using Create React App (CRA)
TypeScript
5
star
39

saleor-avatax

TypeScript
5
star
40

saleor-app-invoices

Saleor integration for invoices generation
TypeScript
5
star
41

saleor-taxjar

TypeScript
5
star
42

saleor-admin-email-templates

Saleor admin email MJML templates: Reset password, export data, staff order
HTML
4
star
43

graphiql-plugin-collection

TypeScript
4
star
44

devtools-integration-tests

This is a hub for integration and e2e tests for CLI
TypeScript
4
star
45

saleor-app-data-importer

TypeScript
3
star
46

.github

3
star
47

example-react-nextjs-apollo-typescript

Saleor Example: React App in TypeScript with Apollo GraphQL using Next.js
TypeScript
3
star
48

json-schema-compiler

TypeScript
3
star
49

saleor-app-payment-template

Template Saleor payments apps are built from
TypeScript
3
star
50

saleor-app-emails-and-messages

TypeScript
2
star
51

saleor-app-klaviyo-old

TypeScript
2
star
52

digitalocean-1click

Shell
2
star
53

saleor-og

TypeScript
2
star
54

saleor-app-algolia

TypeScript
1
star
55

saleor-app-abandoned-checkouts

Example app built for documentation purposes
TypeScript
1
star
56

app-debug-bar

TypeScript
1
star
57

eslint-plugin-saleor-app

ESLint plugin with rules for Saleor Apps
TypeScript
1
star
58

marketplace-content

Marketplace content
1
star
59

example-auth-nextjs-pages-router

Saleor Example: Auth SDK with Next.js (Pages Router) in TypeScript
TypeScript
1
star
60

shellcheck-gha

Extracts and checks shell scripts in Github Workflows for potential issues using ShellCheck.
Python
1
star