Skip to content

Getting Started with PrestaShop Next.Js Storefront

Let's get started with the Next.js / React.js storefront integrated with PrestaShop platform.

Custom Integration

If you want to integrate the storefront into other platforms and E-Commerce API, you can check the Custom Integration section.

Requirements

  • NPM/Yarn/pnpm installed
  • Node.js version 18.17 and higher

Starting a new project

This section is intended for those who want to set up the project for production or development. If you just want to see a quick demo check this section.

You already have a PrestaShop website

  1. First you need to expose PrestaShop REST API endpoints. Download and install PrestaShop REST API just like any other PrestaShop module. (no additional configurations needed)
  2. Clone the React storefront repository:
git clone git@github.com:binshops/react-storefront.git
  1. Change the API endpoint by opening the .env file and modifying the base URL::
js
NEXT_PUBLIC_API_BASE_URL='https://rest.binshops.com/rest'
  1. CD to the cloned directory and install dependencies:
bash
npm install
# or
yarn install
  1. Then, run the project:
bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Handling CORS

Be sure that you have used the REST API module for storefront, because it handles CORS. If you see this error in your console, it's normal, read this section to know more why we get this.

You want to set it up from scratch

First, you need to install the PrestaShop open-source PHP e-commerce platform. You have two options for installing the stack:

Need more help?

If you need more help you can read the following articles that shows how you can set up a fresh PrestaShop installation:

INFO

If you just want to see a demo and experience how smooth the storefront is, you can set the demo up on your local machine.

Demo the project

Demo quickly the project locally by following these steps:

  1. Clone the React storefront repository:
git clone git@github.com:binshops/react-storefront.git
  1. CD to the cloned directory and install dependencies:
bash
npm install
# or
yarn install
  1. CD to the cloned directory and run:
bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
  1. Now you can reach the demo at localhost:8000. The storefront has been configured to use the demo API to populate the data.

Binshops | Best In Shops - Technical Documentation