Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 1.82 KB

README.md

File metadata and controls

80 lines (55 loc) · 1.82 KB

Medusa v2 Example: Restock Notifications

This directory holds the code for the Restock Notifications Guide.

You can either:

Prerequisites

Installation

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

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

Copy into Existing Medusa Application

If you have an existing Medusa application, copy the content of the following directories:

  1. src/api
  2. src/jobs
  3. src/links
  4. src/modules/restock
  5. src/workflows

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

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

Finally, run the migrations and sync links before starting the Medusa application:

npx medusa db:migrate

More Resources