GitXplorerGitXplorer
m

product-module-demo

public
29 stars
13 forks
3 issues

Commits

List of commits on branch main.
Verified
bedc2c673a818051b374dadb39a4c8856dce31dd

Update seed-data.js

VVariableVic committed a year ago
Verified
f2745d4627d6404ddb0debfb6396e8f55639b33e

Update README.md

VVariableVic committed a year ago
Verified
782a617ee5b8282355606b61ffbabd600b90f4bf

Update README.md

VVariableVic committed a year ago
Unverified
05e7d0dd2eb5a8f0e144c8ea675447c988ca468f

feat: code snippet links to gh

VVariableVic committed a year ago
Verified
09cb05c9ca566e0b84849a38fc7156d94487805f

Merge pull request #20 from medusajs/fix/notification-overlay-blocking-clicks

VVariableVic committed a year ago
Unverified
8729647d2202c597c045ec9f9a7a6e17752623c2

proposed fix

ppKorsholm committed a year ago

README

The README file for this repository.

Medusa logo

Medusa Product Module demo

Follow @medusajs

Medusa Product Module demo in Next.js functions

This demo showcases our Product Module running in a serverless Next.js function. In the demo, we're using the Product Module to personalize the storefront in real time based on the user location and behavior.

What are Medusa Modules?

Modules are packages with self-contained commerce logic, promoting separation of concerns, maintainability, and reusability. Modules increase Medusa's extensibility, allowing for customization of core commerce logic and composition with other tools. This flexibility allows for greater choice in the tech stack used in conjunction with Medusa.

Prerequisites

The Product Module must connect to a PostgreSQL database. You can refer to this guide to learn how to install PostgreSQL locally. Alternatively, you can use free PostgreSQL database hosting, such as Vercel Postgres. If you have an existing Medusa database, you can use it as well.

Get started

To run the demo locally, follow these steps:

Step 1. Clone this repo and install the dependencies.

In the project root, run:

npm install

or

yarn

Step 2: Add Database Configurations

Create a .env file and add the following environment variable:

POSTGRES_URL=<DATABASE_URL>

Where <DATABASE_URL> is your database connection URL of the format postgres://[user][:password]@[host][:port]/[dbname]. You can learn more about the connection URL format in this guide.

Step 3: Run Database Migrations and seed the Database

npm run product:migrations:run
# optionally
npm run product:seed

or

yarn product:migrations:run
# optionally
yarn product:seed

Step 4: Run the app locally

Run the app with npm run dev or yarn dev.