Overview
Strapi
Manage store content and APIs with Strapi
Medusa Strapi Plugin
Setting up your store
- Initialize a Copy to clipboard
medusa
project by using a starter
123yarn create medusa-appORnpx create-medusa-app
- Choose Copy to clipboard
medusa-starter-default
1234? Which Medusa starter would you like to install? …❯ medusa-starter-defaultmedusa-starter-contentfulOther
- Pick any storefront starter
1234Which storefront starter would you like to install? …❯ Gatsby StarterNext.js StarterNone
- Make sure Copy to clipboard
redis
is installed and running
123$ redis-cli127.0.0.1:6379> pingPONG
- Go to backend directory.
1cd <Your project name>/backend
- Make sure your packages version in Copy to clipboard
package.json
match this -
12345678"@medusajs/medusa": "^1.1.49","@medusajs/medusa-cli": "^1.1.22","medusa-fulfillment-manual": "^1.1.26","medusa-interfaces": "^1.1.27","medusa-payment-manual": "^1.0.8","medusa-payment-stripe": "^1.1.30","mongoose": "^5.13.3","typeorm": "^0.2.36"
- Edit Copy to clipboard
medusa-config.js
. Navigate to the end of file and make sure this line is not commented out -
1redis_url: REDIS_URL,
- In the same file, add this object to plugins array -
123456789{resolve: `medusa-plugin-strapi`,options: {strapi_medusa_user: 'medusa_user',strapi_medusa_password: 'medusaPassword1',strapi_url: '127.0.0.1',strapi_port: '1337'}}
- Create and navigate to Copy to clipboard
plugins
directory and pull Copy to clipboardmedusa-plugin-strapi
12cd pluginsgit clone https://github.com/Deathwish98/medusa-plugin-strapi.git
- Install dependencies and build project files
123cd medusa-plugin-strapinpm installnpm run build
- Start medusa server from Copy to clipboard
backend
directory
123cd ../../npm run seednpm run start
Your local Medusa server should now be running on port 9000.
Setting up strapi
This plugin assumes that you are familiar with strapi. If you have not used it before, visit the official docs for more info -
https://strapi.io/documentation/developer-docs/latest/getting-started/quick-start.html
- Create a new strapi project using our template.
12345npx create-strapi-app@3.6.8 strapi-medusa --template https://github.com/Deathwish98/strapi-medusa-template.gitORyarn create strapi-app strapi-medusa --template https://github.com/Deathwish98/strapi-medusa-template.git
- Start strapi server. NOTE: If you are using Copy to clipboard
SQLite
there is a known Copy to clipboardknex.js
bug - It appears after running Copy to clipboardnpm run develop
for the first time . Just run the command again and it should disappear.
12345npm run develop <---- For development purposesORnpm run start
1error KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
Visit docs.medusa-commerce.com for further guides.