-
Clone the repository:
git clone https://github.com/diorcula/medusa-plugin.git cd medusa-plugin
-
Build and run using Docker Compose:
docker-compose up -d
-
Set up the database and run migrations:
docker-compose exec medusa medusa migrations run
-
Create a test admin user:
docker-compose exec medusa node create-admin-user.js
-
Run tests:
docker-compose exec medusa npm test
If you prefer not to use Docker, you can set up the environment manually by following these steps:
-
Install dependencies:
npm install
-
Set up the database:
# For PostgreSQL docker run --name medusa-db -e POSTGRES_PASSWORD=password -d -p 5432:5432 postgres
-
Create a
.env
file:DATABASE_URL=postgres://postgres:password@localhost:5432/medusa
-
Run migrations:
medusa migrations run
-
Create a test admin user:
node create-admin-user.js
-
Run tests:
npm test
When publishing the plugin, you do not need to include the Docker configuration files in the package. Just ensure they are available in the repository, and provide clear instructions in the README.