This directory holds the code for the Restaurant-Delivery Marketplace recipe example.
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
restaurant-marketplacedirectory:
git clone https://github.com/medusajs/examples.git
cd examples/restaurant-marketplace2. 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 devIf you have an existing Medusa application, copy the content of the following directories:
src/modules/deliveryandsrc/modules/restaurantsrc/linkssrc/workflowssrc/api
Then, add the Restaurant and Delivery Modules to medusa-config.js:
module.exports = defineConfig({
// ...
modules: [
{
resolve: "./modules/restaurant",
},
{
resolve: "./modules/delivery"
},
]
})Finally, run the migrations and sync links before starting the Medusa application:
npx medusa db:migrate- OpenAPI Spec file: Can be imported into tools like Postman to view and send requests to this project's API routes.
- Medusa Documentation