Skip to content

Latest commit

 

History

History
82 lines (56 loc) · 1.89 KB

File metadata and controls

82 lines (56 loc) · 1.89 KB

Medusa v2 Example: Product Reviews

This directory holds the code for the Product Review Guide.

You can either:

Prerequisites

Installation

  1. Clone the repository and change to the product-review directory:
git clone https://github.com/medusajs/examples.git
cd examples/product-review

2. Rename the .env.template file to .env.

3. If necessary, change the PostgreSQL username, password, and host in the DATABASE_URL environment variable.

4. Install dependencies:

yarn # or npm install

5. Setup and seed the database:

npx medusa db:setup
yarn seed # or npm run seed

6. Start the Medusa application:

yarn dev # or npm run dev

You'll find a "Reviews" page in the Medusa Admin.

Copy into Existing Medusa Application

If you have an existing Medusa application, copy the following directories and files into your project:

  • src/admin
  • src/api
  • src/links
  • src/modules/product-review
  • src/workflows

Then, add the Product Review Module to medusa-config.ts:

module.exports = defineConfig({
  // ...
  modules: [
    {
      resolve: "./src/modules/product-review",
    }
  ],
})

Finally, run migrations:

npx medusa db:migrate

More Resources