Make sure to install the dependencies:
# npm
npm install
# pnpm
pnpm install
# yarn
yarn install
# bun
bun install
Start the development server on http://localhost:3000
:
# npm
npm run dev
# pnpm
pnpm run dev
# yarn
yarn dev
# bun
bun run dev
Create .env
file and set variable VITE_BFF_URL
, you can find an example inside .env.example
Please refer to [Postman Collection](/postman/CAMP Storefront.postman_collection.json) to get examples of requests and responses
VITE_BFF_URL=http://localhost:3003/api/v1
Current version supports following enpoints.
Should return a list of categories. Please see mock_data/categories.json
to find example of the response
Should return a list of products in the category. Supports pagination. Please find example in mock_data/products.json
Returns a single product with variations. Please find example in mock_data/product.json
Should create a new guest cart and return it
SHould return a guest cart by id
This request supports various payloads depending on the action, one of:
- AddLineItem
- ChangeLineItemQuantity
- RemoveLineItem
- SetShippingAddress
Creates an order from the cart
The red blocks helps you to identify blocks where api is not implemented yet
The template is trying to request data from your BFF api, and if the request is not successful, it falls back to mocked data and identifies the area with red color to indicate that this part is not implemented yet.
Good luck! And please contact [email protected] or [email protected] if you need help.