Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/adrien2p/medusa-extender

:syringe: Medusa on steroid, take your medusa project to the next level with some badass features :rocket:
https://github.com/adrien2p/medusa-extender

architecture cli dynamic-module e-commerce ecommerce extension headless javascript medusa medusa-plugin medusa-plugins medusajs monitoring multi-tenancy nodejs open-source prometheus typeorm typescript

Last synced: 26 days ago
JSON representation

:syringe: Medusa on steroid, take your medusa project to the next level with some badass features :rocket:

Lists

README

        


Medusa-extender logo


medusa-extender


Full documentation website


Downloads per month
NPM Version
Contributors
Awesome medusajs
Documentation
Twitter
Discord
Npm download
Activity
Issues
Licence
Contributing
Test pipeline status
Page build deployment status
CodeQL security analysis status
Codacy code quality
Product hunt
sponsor


Medusa on steroid, take your medusa project to the next level with some badass features :rocket:
The extender provides an out-of-the-box application architecture which allows developers and teams to create highly testable, scalable, loosely coupled, and easily maintainable applications.
In also increase medusa extensibility and customisation for special use cases. It comes with handy
decorators approach to increase the DX and full typings support for easier development. It is a complement to medusa but not a replacement :rocket:



> **[Warning](https://www.google.com)**: This repository is deprecated since medusa >1.8, as extensions can now be made using only Medusa Core. See [this guide](https://medusajs.com/blog/extending-medusa-usecase-marketplace/) for more info.


[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/cloudy.png)](#table-of-contents)

## Table of Contents

* [Introduction](#introduction)
* [Getting started :rocket:](#getting-started-rocket)
* [Existing medusa project](#existing-medusa-project)
* [From server starter](#from-server-starter)
* [Application Architecture](#application-architecture)
* [CLI `medex`](#cli-medex)
* [Commands references](https://adrien2p.github.io/medusa-extender/#/?id=commands-references)
* [Command `generate` reference](https://adrien2p.github.io/medusa-extender/#/?id=command-generate-reference)
* [Usage](https://adrien2p.github.io/medusa-extender/#/?id=usage)
* [Options](https://adrien2p.github.io/medusa-extender/#/?id=options)
* [Examples](https://adrien2p.github.io/medusa-extender/#/?id=examples)
* [Command `migrate` reference](https://adrien2p.github.io/medusa-extender/#/?id=command-migrate-reference)
* [Usage](https://adrien2p.github.io/medusa-extender/#/?id=usage-1)
* [Options](https://adrien2p.github.io/medusa-extender/#/?id=options-1)
* [Full code API :mag:](https://adrien2p.github.io/medusa-extender/#/?id=full-code-api-mag)
* [API documentation :bulb:](https://adrien2p.github.io/medusa-extender/#/?id=api-documentation-bulb)
* [Decorators](https://adrien2p.github.io/medusa-extender/#/?id=decorators)
* [@Entity](https://adrien2p.github.io/medusa-extender/#/?id=entity)
* [@Repository](https://adrien2p.github.io/medusa-extender/#/?id=repository)
* [@Migration](https://adrien2p.github.io/medusa-extender/#/?id=migration)
* [@Service](https://adrien2p.github.io/medusa-extender/#/?id=service)
* [@Middleware](https://adrien2p.github.io/medusa-extender/#/?id=middleware)
* [@Router](https://adrien2p.github.io/medusa-extender/#/?id=router)
* [@Validator](https://adrien2p.github.io/medusa-extender/#/?id=validator)
* [@Subscriber](https://adrien2p.github.io/medusa-extender/#/?id=subscriber)
* [Providers](https://adrien2p.github.io/medusa-extender/#/?id=providers)
* [@PaymentProvider](https://adrien2p.github.io/medusa-extender/#/?id=paymentprovider)
* [@NotificationProvider](https://adrien2p.github.io/medusa-extender/#/?id=notificationprovider)
* [@FulfillmentProvider](https://adrien2p.github.io/medusa-extender/#/?id=fulfillmentprovider)
* [@TaxProvider](https://adrien2p.github.io/medusa-extender/#/?id=taxprovider)
* [@Module](https://adrien2p.github.io/medusa-extender/#/?id=module)
* [@Module (Dynamic module)](https://adrien2p.github.io/medusa-extender/#/?id=module-dynamic-module)
* [@OnMedusaEntityEvent](https://adrien2p.github.io/medusa-extender/#/?id=onmedusaentityevent)
* [Utilities :wrench:](https://adrien2p.github.io/medusa-extender/#/?id=utilities-wrench)
* [attachOrReplaceEntitySubscriber](https://adrien2p.github.io/medusa-extender/#/?id=attachorreplaceentitysubscriber)
* [repositoryMixin (@deprecated)](https://adrien2p.github.io/medusa-extender/#/?id=repositorymixin-deprecated)
* [Omit (@deprecated)](https://adrien2p.github.io/medusa-extender/#/?id=omit-deprecated)
* [Starters](https://adrien2p.github.io/medusa-extender/#/?id=starters)
* [Internal modules (Optional)](https://adrien2p.github.io/medusa-extender/#/?id=internal-modules-optional)
* [Monitoring](https://adrien2p.github.io/medusa-extender/#/?id=monitoring)
* [Multi-tenancy](https://adrien2p.github.io/medusa-extender/#/?id=multi-tenancy)
* [Cli migrate command](https://adrien2p.github.io/medusa-extender/#/?id=cli-migrate-command)
* [Resources](#resources)
* [Marketplace tutorial](#marketplace-tutorial)
* [troubleshooting](https://adrien2p.github.io/medusa-extender/#/?id=troubleshooting)
* [Discussions](#discussions)
* [Like my work? :heartbeat:](#like-my-work-heartbeat)
* [Contribute](#contribute)

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/cloudy.png)](#introduction)

# Introduction

[Medusa](https://github.com/medusajs/medusa) is an open source headless commerce platform that allows you to create your own store in a matter of minutes. Part of what makes Medusa a good choice for your ecommerce store is its extensibility. Now, it is also possible to create multi-vendor marketplaces using Medusa.

:point_right: __And here is why I've done that package for medusa__

> "I've been looking for an e-commerce solution that could provide me with some core features while being fully customisable... After some research, where I found that none of the present solutions could provide what I needed, I chose Medusa as it provided me with many of the needed features while being easy to extend. I ended up loving the community atmosphere, especially the proximity with the team, and have been helping those in the community looking for a similar fully-customisable solution by sharing a part of my private project. This is how the medusa-extender was born." — Adrien de Peretti

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/cloudy.png)](#getting-started-rocket)

# Getting started :rocket:

Depending on your situation, pick the right getting started section.

## Existing medusa project

In that case, you must already have scaffold a new medusa store project. If that's not the case you can [follow the tutorial here](https://docs.medusajs.com/quickstart/quick-start).

Run the following command in your terminal

```bash
npm install medusa-extender
./node_modules/.bin/medex init
```

That's it, you are now ready to run your server :rocket:

Note: The default port is `9000`, if you want to run the server on a custom port update `medusa-config.js` as follows:

```
module.exports = {
/* ... */
serverConfig:{
port:
}
/* ... */
};
```

## From server starter

You can directly clone the `starters/server` to get started quickly.

First, update your `medusa-config.js` accordingly to your needs.

Then, follow the next command to be ready in minutes

```bash
npx degit github:adrien2p/medusa-extender/starters/server#main server
cd server
npm i
npm run build
npm run start
```

That's it, your server is now up and running :rocket:

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/cloudy.png)](#cli-medex)

# CLI `medex`

To install the cli globally instead of using the local one, you can run the
following command

```bash
npm i -g medusa-extender
```

To make things easier for you, the project comes with a CLI that allow
you to generate any component with minimum code implementation and also
to be able to run the migrations and show the list of applied and to be applied migrations.

To see more about the usage and references, [click here to see the documentation](https://adrien2p.github.io/medusa-extender/#/?id=cli-medex)

# Application Architecture

Using this package help you organise your code in a module approach.
That means that you can go for a modular architecture and decoupled
your code depending on your domains.

Here is the proposed folder structure that you can add to your medusa project

```text
.
├── ...
├── src # Here are located all the files that make your application
│ ├── modules # Where you can put all your modules using the medusa-extender
| ├── Module1
| ├── module1.entity.ts
| ├── module1.migration.ts
| ├── module1.service.ts
| ├── module1.repository.ts
| ├── module1.middleware.ts
| ├── module1.module.ts # This is where the above components are referenced
| ├── ...
| ├── Module2
| ├── ...
| ├── Module3
| ├── ...
│ ├── main.ts # this is where the magic happen and your modules will be passed to the load method
└── ...
```

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/cloudy.png)](#discussions)

# Discussions

If you are interesting to participate in any discussions you can follow that [links](https://github.com/adrien2p/medusa-extender/discussions)

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/cloudy.png)](#resources)

# Resources

Here are some resources that are using the medusa-extender, more of them
will come in time :rocket:.

## Marketplace tutorial

Here is a tutorial repository that will be followed by a series of article to guide you
through the process of creating your marketplace using `@medusajs` and the `medusa-extender`.

Here is the link to the [Marketplace tutorial repo](https://github.com/shahednasser/medusa-marketplace-tutorial)
and Here is the link to the [Marketplace tutorial plugin](https://github.com/shahednasser/medusa-marketplace)

Here is the first tutorial using the medusa-extender package, [Open source ecommerce platform for multi-vendor marketplaces](https://dev.to/medusajs/create-an-open-source-commerce-marketplace-part-1-3m5k)

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/cloudy.png)](#like-my-work-heartbeat)

# Like my work? :heartbeat:

This project needs a :star: from you.
If you found the package helpful consider becoming a sponsor [here](https://github.com/sponsors/adrien2p) :rocket:

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/cloudy.png)](#contribute)

# Contribute

Contributions are welcome! You can look at the contribution [guidelines](./CONTRIBUTING.md)