Mock backend

We use a mock backend to provide the necessary data and handle JWT authentication as well. This mock backend is shared across various apps for consistent data handling. You can find the mock backend server in the following GitHub repository:

The provided code of Berry directly uses a deployed URL. You can verify this by observing the network tab, where you'll see this URL being accessed at multiple points.

Set up the Local backend server

If you intend to avoid a live server and want to use the same locally, follow the guidelines below.

  1. Clone the GitHub repo to your machine:

    git clone https://github.com/phoenixcoded20/mock-data-api-nextjs.git
  2. Install and Run:

    npm install
    npm run dev
  3. This will start the backend locally at port 3010.

  4. Replace the API_URL key in .env at the root location of the Berry package:

    • VITE:

      VITE_APP_API_URL: http://localhost:3010/
    • NEXTJS:

      REACT_APP_API_URL: http://localhost:3010/

Last updated

Was this helpful?