💉 Medusa on steroid, take your medusa project to the next level with some badass features 🚀
Fully customisable medusa, create custom fields in any entity, implement your own feature or extend existing one in a minutes, make your own architecture or choose the modular architecture provided.
Build a store, marketplace, media store and anything you want to do you can do it.
Enjoy the full power of Medusa with extra badass features 🚀
- Getting started 🚀
- CLI
medex
- Features 🧐
- Documentation
- Resources
- Discussions
- Like my work? 💓
- Contribute
Depending on your situation, pick the right getting started section.
Run the following command in your terminal (The last version is {{ pkg.version }})
npm install medusa-extender
To benefit from all the features that the extender offers you, the usage of typescript is recommended.
Then let's create the tsconfig.json
configuration
npm i -D typescript
echo '{
"compilerOptions": {
"module": "CommonJS",
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"target": "es2017",
"sourceMap": true,
"skipLibCheck": true,
"allowJs": true,
"outDir": "dist",
"rootDir": ".",
"esModuleInterop": true
},
"include": ["src", "medusa-config.js"],
"exclude": ["dist", "node_modules", "**/*.spec.ts"]
}' > tsconfig.json
update the scripts in your package.json
{
"scripts": {
"build": "rm -rf dist && tsc",
"start": "npm run build && node dist/src/main.js"
}
}
add a main file in the src
directory
// src/main.ts
import express = require('express');
import { Medusa } from 'medusa-extender';
import { resolve } from 'path';
async function bootstrap() {
const expressInstance = express();
const rootDir = resolve(__dirname) + '/../';
await new Medusa(rootDir, expressInstance).load([]);
expressInstance.listen(9000, () => {
console.info('Server successfully started on port 9000');
});
}
bootstrap();
And finally update the develop.sh
script with the following
#!/bin/bash
#Run migrations to ensure the database is updated
medusa migrations run
#Start development environment
npm run start
You can directly clone the starters/server
to get started quickly.
Follow the next command to be ready in minutes
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 not up and running 🚀
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
Here is a list of the features that you can find in that package
- Create or extend an entity
- Create or extend a repository
- Create or extend a service
- Create middleware before or after medusa authentication strategy
- Create new migrations
- Create new router handler
- Extend validators from medusa to includes custom fields
- Emit entity subscribers events
- Listen to entity subscribers and handle them wherever you want
All those features provide you a way to
- Create and manage a market place
- Create a media store to sell nft - video - images - keys - etc.
- And basically create whatever you want on top of
@medusajs
Share your code
- Build shareable modules/plugins to use across your project or to share with the community
CLI
- Generate new components
- Migrate your data
Using this package also allow you to manage your architecture as you want. you will not be limited by any constraint as long as the component are decorated and the modules are referenced into the main file to be loaded, everything is fine. 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
.
├── ...
├── 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
└── ...
If you are interesting to participate in any discussions you can follow that links
Here are some resources that are using the medusa-extender, more of them will come in time 🚀.
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 and Here is the link to the Marketplace tutorial plugin
Here is the first tutorial using the medusa-extender package, Open source ecommerce platform for multi-vendor marketplaces
This project needs a ⭐ from you. Don't forget to leave a star ⭐. If you found the package helpful consider supporting me with a coffee
Contributions are welcome! You can look at the contribution guidelines