Monorepo use cases
A FastStore monorepo can support different storefront modules, such as Product Discovery Experience, Checkout, and Sales App, depending on the merchant's needs.
This guide outlines common repository structures for these scenarios and provides example
faststore.json configurations for each one. These examples can help to organize your monorepo based on your implementation requirements.The following sections cover:
- Single account with multiple modules: A single VTEX account using more than one storefront module.
- Multiple brands or stores sharing code: Multiple accounts or subaccounts using the same monorepo while sharing common code.
- Multiple brands or stores with multiple modules: A monorepo where each account or subaccount can use multiple storefront modules with its own configuration.
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
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
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β