This directory holds the code for the Product Builder Tutorial.
You can either:
- install and use it as a Medusa application;
- or copy its source files into an existing Medusa application.
- Clone the repository and change to the
product-builderdirectory:
git clone https://github.com/medusajs/examples.git
cd examples/product-builder2. 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 install5. Setup and seed the database:
npx medusa db:setup
yarn seed # or npm run seed6. Start the Medusa application:
yarn dev # or npm run devYou can manage the builder configurations of a product in the Medusa Admin by going to the product's details page.
Refer to the More Resources for OpenAPI Specs of custom API routes.
If you have an existing Medusa application, copy the following directories and files into your project:
src/adminsrc/api/adminsrc/api/storesrc/api/middlewares.tssrc/linkssrc/modules/product-buildersrc/workflows
Then, add the Product Builder Module to medusa-config.ts:
module.exports = defineConfig({
// ...
modules: [
{
resolve: "./src/modules/product-builder",
}
],
})After that, run migrations to create the necessary tables:
npx medusa db:migrateFinally, start the Medusa application:
yarn dev # or npm run devYou can manage the builder configurations of a product in the Medusa Admin by going to the product's details page.
- Medusa Documentatin
- OpenAPI Spec file: Can be imported into tools like Postman to view and send requests to this project's API routes.