Menu
Guides
API Reference

Guides

Monorepo use cases

Explore common FastStore monorepo layouts and example faststore.json setups for single accounts, multiple stores, and shared code.

4 min read

A FastStore monorepo can support different storefront modules, such as Product Discovery Experience, Buyer Portal Checkout, and VTEX Sales App, to meet the merchant's needs. You don't need to include the Product Discovery Experience (discovery) module if FastStore isn't your storefront.

This guide outlines common repository structures for these scenarios and provides example faststore.json configurations for each one. These examples can help organize your monorepo based on your implementation requirements.

The following sections cover:

Single account with multiple modules

In this scenario, one VTEX account uses multiple storefront modules, each with its own directory within the monorepo.

Basic directory structure


_10
📂 Account monorepo
_10
_10
├── 📂 packages
_10
│ ├── 📂 discovery
_10
│ ├── 📂 checkout
_10
│ └── 📂 sales-app
_10
├── 📄 faststore.json
_10
├── 📄 package.json
_10

faststore.json configuration example

faststore.json

_19
{
_19
"$schema": "https://unpkg.com/@vtex/fsp-config/faststore.schema.json",
_19
"stores": {
_19
"account1": {
_19
"discovery": {
_19
"path": "packages/store1",
_19
"port": 3001
_19
},
_19
"checkout": {
_19
"path": "package/checkout",
_19
"port": 3002
_19
},
_19
"sales-app": {
_19
"path": "package/sales-app",
_19
"port": 3003
_19
}
_19
}
_19
}
_19
}

Buyer Portal Checkout and Sales App without Product Discovery

In this scenario, the account uses a FastStore monorepo for Buyer Portal Checkout and/or Sales App, but FastStore isn't the storefront. Omit the discovery key and declare only the modules you use.

After the monorepo is configured, set up the modules you included: Setting up Buyer Portal Checkout and Setting up Sales App extensions.

Basic directory structure


_10
📂 Account monorepo
_10
_10
├── 📂 packages
_10
│ ├── 📂 checkout
_10
│ └── 📂 sales-app
_10
├── 📄 faststore.json
_10
├── 📄 package.json
_10

faststore.json configuration example

faststore.json

_15
{
_15
"$schema": "https://unpkg.com/@vtex/fsp-config/faststore.schema.json",
_15
"stores": {
_15
"account1": {
_15
"checkout": {
_15
"path": "packages/checkout",
_15
"port": 3001
_15
},
_15
"sales-app": {
_15
"path": "packages/sales-app",
_15
"port": 3002
_15
}
_15
}
_15
}
_15
}

Multiple brands or stores sharing code

In this scenario, a merchant has multiple brands or stores, each mapped to a different account or subaccount, yet all share the same FastStore monorepo.

With separate repositories, sharing code between brands or stores usually depends on publishing npm packages or copying files between projects. In a FastStore monorepo, each brand or store has its own directory within a single repository, and shared code lives in dedicated folders that can be imported wherever needed. This setup avoids duplicating code across repositories and makes it easier to maintain consistent implementations across storefronts.

Basic directory structure


_10
📂 Account monorepo
_10
_10
├── 📂 packages
_10
│ ├── 📂 store1
_10
│ └── 📂 store2
_10
├── 📄 faststore.json
_10
├── 📄 package.json
_10

faststore.json configuration example

faststore.json

_17
{
_17
"$schema": "https://unpkg.com/@vtex/fsp-config/faststore.schema.json",
_17
"stores": {
_17
"account1": {
_17
"discovery": {
_17
"path": "packages/store1",
_17
"port": 3001
_17
}
_17
}
_17
"account2": {
_17
"discovery": {
_17
"path": "packages/store2",
_17
"port": 3002
_17
},
_17
}
_17
}
_17
}

Multiple brands or stores with multiple modules

In this scenario, a merchant has multiple brands or stores, and each of them can use more than one storefront module. All brands or stores share the same FastStore monorepo, but each has its own directory and module configuration.

Basic directory structure


_12
📂 Account monorepo
_12
_12
├── 📂 packages
_12
│ └── 📂 store1
_12
│ ├── 📂 discovery
_12
│ └── 📂 checkout
_12
│ └── 📂 store2
_12
│ ├── 📂 discovery
_12
│ └── 📂 checkout
_12
├── 📄 faststore.json
_12
├── 📄 package.json
_12

faststore.json configuration example

faststore.json

_25
{
_25
"$schema": "https://unpkg.com/@vtex/fsp-config/faststore.schema.json",
_25
"stores": {
_25
"account1": {
_25
"discovery": {
_25
"path": "packages/store1",
_25
"port": 3001
_25
},
_25
"checkout": {
_25
"path": "packages/checkout",
_25
"port": 3002
_25
}
_25
},
_25
"account2": {
_25
"discovery": {
_25
"path": "package/store2",
_25
"port": 3001
_25
},
_25
"checkout": {
_25
"path": "package/checkout",
_25
"port": 3002
_25
}
_25
}
_25
}
_25
}