### Clone and Navigate to Example Directory Source: https://github.com/medusajs/examples/blob/main/first-purchase-discount/README.md Clone the Medusa examples repository and change into the first-purchase-discount directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/first-purchase-discount ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/product-rentals/README.md Clone the example repository and navigate to the product-rentals directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/product-rentals ``` -------------------------------- ### Clone and Navigate to Example Directory Source: https://github.com/medusajs/examples/blob/main/custom-item-price/README.md Clone the Medusa examples repository and change into the custom-item-price directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/custom-item-price ``` -------------------------------- ### Clone and Navigate to Digital Product Example Source: https://github.com/medusajs/examples/blob/main/digital-product/README.md Clone the Medusa examples repository and change into the digital-product directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/digital-product ``` -------------------------------- ### GET /store/hello-world Example Source: https://github.com/medusajs/examples/blob/main/bundled-products/src/api/README.md Example of creating a simple GET API route at `/store/hello-world`. ```APIDOC ## GET /store/hello-world ### Description Handles GET requests to the `/store/hello-world` endpoint and returns a JSON message. ### Method GET ### Endpoint /store/hello-world ### Request Example (No request body for this GET request) ### Response #### Success Response (200) - **message** (string) - A greeting message. #### Response Example ```json { "message": "Hello world!" } ``` ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/resend-integration/README.md Clone the example repository and navigate to the resend-integration directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/resend-integration ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/phone-auth/README.md Clone the example repository and change into the phone-auth directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/phone-auth ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/product-feed/README.md Clone the example repository and navigate into the product-feed directory to begin the setup process. ```bash git clone https://github.com/medusajs/examples.git cd examples/product-feed ``` -------------------------------- ### Clone and Navigate to Personalized Products Example Source: https://github.com/medusajs/examples/blob/main/personalized-products/README.md Clone the Medusa examples repository and change into the personalized-products directory to get started. ```bash git clone https://github.com/medusajs/examples.git cd examples/personalized-products ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/invoice-generator/README.md Clone the example repository and change into the invoice-generator directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/invoice-generator ``` -------------------------------- ### Clone and Navigate to Example Directory Source: https://github.com/medusajs/examples/blob/main/migrate-from-magento/README.md Clone the Medusa examples repository and navigate to the migrate-from-magento directory to begin the setup process. ```bash git clone https://github.com/medusajs/examples.git cd examples/migrate-from-magento ``` -------------------------------- ### Install Dependencies and Start Server Source: https://github.com/medusajs/examples/blob/main/returns-storefront/README.md Install project dependencies using yarn or npm, then start the Next.js development server. The storefront will be accessible at http://localhost:8000. ```bash yarn # or npm install ``` ```bash yarn dev # or npm run dev ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/express-checkout-storefront/README.md Clone the example repository and navigate into the express-checkout-storefront directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/express-checkout-storefront ``` -------------------------------- ### GET /store/hello-world Example Source: https://github.com/medusajs/examples/blob/main/first-purchase-discount/src/api/README.md Example of creating a simple GET API route at `/store/hello-world` that returns a JSON message. ```APIDOC ## GET /store/hello-world ### Description Creates a GET API Route at `/store/hello-world` that returns a JSON message. ### Method GET ### Endpoint /store/hello-world ### Request Body None ### Response #### Success Response (200) - **message** (string) - A greeting message. ### Response Example { "message": "Hello world!" } ``` -------------------------------- ### GET API Route Example Source: https://github.com/medusajs/examples/blob/main/abandoned-cart/src/api/README.md Example of creating a simple GET API route at `/store/hello-world`. ```APIDOC ## GET /store/hello-world ### Description Creates a simple GET endpoint that returns a "Hello world!" message. ### Method GET ### Endpoint /store/hello-world ### Response #### Success Response (200) - **message** (string) - A greeting message. ### Response Example { "message": "Hello world!" } ``` -------------------------------- ### Clone Okta Integration Example Source: https://github.com/medusajs/examples/blob/main/okta-integration/README.md Clone the Medusa examples repository and navigate to the okta-integration directory to get started. ```bash git clone https://github.com/medusajs/examples.git cd examples/okta-integration ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/product-builder/README.md Clone the Medusa examples repository and navigate into the product-builder directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/product-builder ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/returns-storefront/README.md Clone the Medusa examples repository and navigate to the returns-storefront directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/returns-storefront ``` -------------------------------- ### Start Meilisearch Instance Source: https://github.com/medusajs/examples/blob/main/meilisearch-integration/README.md Instructions for starting a Meilisearch instance using Docker or local installation. ```bash # Using Docker docker run -it --rm -p 7700:7700 getmeili/meilisearch:latest # Or install locally curl -L https://install.meilisearch.com | sh ./meilisearch ``` -------------------------------- ### Clone and Navigate to Bundled Products Directory Source: https://github.com/medusajs/examples/blob/main/bundled-products/README.md Clone the Medusa examples repository and change into the bundled-products directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/bundled-products ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/restaurant-marketplace/README.md Clone the Medusa examples repository and navigate to the restaurant-marketplace directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/restaurant-marketplace ``` -------------------------------- ### Clone ShipStation Integration Example Source: https://github.com/medusajs/examples/blob/main/shipstation-integration/README.md Clone the repository and navigate to the shipstation-integration directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/shipstation-integration ``` -------------------------------- ### GET with Path Parameter Example Source: https://github.com/medusajs/examples/blob/main/re-order/src/api/README.md Example of creating a GET API route that accepts a `productId` path parameter. ```APIDOC ## GET /api/products/[productId] ### Description Handles GET requests for a specific product, identified by its ID. ### Method GET ### Endpoint /api/products/[productId] ### Parameters #### Path Parameters - **productId** (string) - Required - The ID of the product. ### Response #### Success Response (200) - **message** (string) - A message indicating the requested product ID. ``` -------------------------------- ### Clone and Navigate to Preorder Directory Source: https://github.com/medusajs/examples/blob/main/preorder/README.md Clone the Medusa examples repository and change into the preorder directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/preorder ``` -------------------------------- ### Build All Storefronts Source: https://github.com/medusajs/examples/blob/main/STOREFRONT_UPDATE_GUIDE.md Iterates through specified storefront directories, installs dependencies, and builds each project. This script should be run from the examples root directory. ```bash for dir in sanity-integration order-gift-message returns-storefront stripe-saved-payment ticket-booking; do cd $dir/storefront && yarn build && cd ../.. fi cd payload-integration/storefront && yarn build && cd ../.. ``` -------------------------------- ### Clone and Navigate to Directory Source: https://github.com/medusajs/examples/blob/main/avalara-integration/README.md Clone the Medusa examples repository and change into the avalara-integration directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/avalara-integration ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/localization-contentful/README.md Clone the Medusa examples repository and navigate into the localization-contentful directory to begin the setup process. ```bash git clone https://github.com/medusajs/examples.git cd examples/localization-contentful ``` -------------------------------- ### GET with Multiple Path Parameters Example Source: https://github.com/medusajs/examples/blob/main/re-order/src/api/README.md Example of creating a GET API route that accepts multiple path parameters: `productId` and `variantId`. ```APIDOC ## GET /api/products/[productId]/variants/[variantId] ### Description Handles GET requests for a specific product variant, identified by product and variant IDs. ### Method GET ### Endpoint /api/products/[productId]/variants/[variantId] ### Parameters #### Path Parameters - **productId** (string) - Required - The ID of the product. - **variantId** (string) - Required - The ID of the product variant. ``` -------------------------------- ### Clone and Navigate to Marketplace Directory Source: https://github.com/medusajs/examples/blob/main/marketplace/README.md Clone the Medusa examples repository and change into the marketplace directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/marketplace ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/react-native-expo/README.md Clone the Medusa examples repository and navigate into the react-native-expo directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/react-native-expo ``` -------------------------------- ### Clone and Navigate to Subscription Example Source: https://github.com/medusajs/examples/blob/main/subscription/README.md Clone the Medusa examples repository and navigate to the subscription directory to begin. ```bash git clone https://github.com/medusajs/examples.git cd examples/subscription ``` -------------------------------- ### Clone and Navigate to Re-Order Directory Source: https://github.com/medusajs/examples/blob/main/re-order/README.md Clone the Medusa examples repository and change into the re-order directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/re-order ``` -------------------------------- ### Clone and Navigate to Slack Integration Directory Source: https://github.com/medusajs/examples/blob/main/slack-integration/README.md Clone the Medusa examples repository and change into the slack-integration directory to begin the setup process. ```bash git clone https://github.com/medusajs/examples.git cd examples/slack-integration ``` -------------------------------- ### Build and Run Project Locally Source: https://github.com/medusajs/examples/blob/main/STOREFRONT_UPDATE_GUIDE.md After applying updates and installing dependencies, build the project and start the development server to verify changes. ```bash cd /storefront yarn build yarn dev ``` -------------------------------- ### Clone and Navigate to Customer Tiers Example Source: https://github.com/medusajs/examples/blob/main/customer-tiers/README.md Clone the Medusa examples repository and change the directory to the customer-tiers example. This is the first step for setting up the example as a standalone application. ```bash git clone https://github.com/medusajs/examples.git cd examples/customer-tiers ``` -------------------------------- ### Clone and Navigate to Algolia Integration Directory Source: https://github.com/medusajs/examples/blob/main/algolia-integration/README.md Clone the Medusa examples repository and change into the algolia-integration directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/algolia-integration ``` -------------------------------- ### Clone Loyalty Points Example Repository Source: https://github.com/medusajs/examples/blob/main/loyalty-points/README.md Clone the example repository and navigate to the loyalty-points directory to begin. ```bash git clone https://github.com/medusajs/examples.git cd examples/loyalty-points ``` -------------------------------- ### Copy Example .env File Source: https://github.com/medusajs/examples/blob/main/sanity-integration/storefront/e2e/README.md Copies the example environment file to be configured for local testing. ```bash cat e2e/.env.example >> .env ``` -------------------------------- ### Clone and Navigate to Memcached Caching Directory Source: https://github.com/medusajs/examples/blob/main/memcached-caching/README.md Clone the Medusa examples repository and change into the memcached-caching directory to begin the setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/memcached-caching ``` -------------------------------- ### Clone and Navigate to Category Images Directory Source: https://github.com/medusajs/examples/blob/main/category-images/README.md Clone the Medusa examples repository and change the directory to the category-images example. This is the first step for setting up the example. ```bash git clone https://github.com/medusajs/examples.git cd examples/category-images ``` -------------------------------- ### Clone and Navigate to Mailchimp Integration Directory Source: https://github.com/medusajs/examples/blob/main/mailchimp-integration/README.md Clone the Medusa examples repository and navigate into the mailchimp-integration directory to begin setup. ```bash git clone https://github.com/medusajs/examples.git cd examples/mailchimp-integration ``` -------------------------------- ### Install Dependencies Source: https://github.com/medusajs/examples/blob/main/meilisearch-integration/README.md Run this command to install the necessary dependencies for the Meilisearch integration. ```bash yarn install ``` -------------------------------- ### Start Medusa Server Source: https://github.com/medusajs/examples/blob/main/meilisearch-integration/README.md Command to start the Medusa development server. ```bash yarn dev ``` -------------------------------- ### Start Medusa Application Source: https://github.com/medusajs/examples/blob/main/abandoned-cart/README.md Start the Medusa application in development mode. ```bash yarn dev # or npm run dev ``` -------------------------------- ### Install Dependencies Source: https://github.com/medusajs/examples/blob/main/order-gift-message/storefront/README.md Install all project dependencies using Yarn. ```shell yarn ``` -------------------------------- ### Start Strapi Application Source: https://github.com/medusajs/examples/blob/main/strapi-integration/README.md Start the Strapi application to access the admin panel and begin data synchronization. ```bash yarn dev # or npm dev ``` -------------------------------- ### Clone Medusa Example Repository Source: https://github.com/medusajs/examples/blob/main/order-gift-message/README.md Clone the Medusa examples repository and navigate to the order-gift-message/medusa directory to set up the Medusa application. ```bash git clone https://github.com/medusajs/examples.git cd examples/order-gift-message/medusa ``` -------------------------------- ### Clone Medusa Examples Repository Source: https://github.com/medusajs/examples/blob/main/sentry-integration/README.md Clone the Medusa examples repository and navigate to the sentry-integration directory to begin. ```bash git clone https://github.com/medusajs/examples.git cd examples/sentry-integration ``` -------------------------------- ### Clone Medusa PayPal Integration Example Source: https://github.com/medusajs/examples/blob/main/paypal-integration/README.md Clone the Medusa examples repository and navigate to the PayPal integration directory. ```bash git clone https://github.com/medusajs/examples.git cd examples/paypal-integration ``` -------------------------------- ### Install Dependencies Source: https://github.com/medusajs/examples/blob/main/phone-auth/README.md Install the required 'twilio' and 'jsonwebtoken' packages for phone authentication and JWT handling. Include development types for TypeScript. ```bash yarn add twilio jsonwebtoken # or npm install twilio jsonwebtoken yarn add @types/jsonwebtoken -D # or npm install @types/jsonwebtoken --save-dev ``` -------------------------------- ### Install Avatax Package Source: https://github.com/medusajs/examples/blob/main/avalara-integration/README.md Install the avatax package, which is required for Avalara integration. The guide was implemented with avatax@^25.9.0. ```bash yarn add avatax # or npm install avatax ``` -------------------------------- ### Install Algolia Search Package Source: https://github.com/medusajs/examples/blob/main/algolia-integration/README.md Install the `algoliasearch` package, which is required for the Algolia integration. This guide was implemented with `algoliasearch@^5.21.0`. ```bash yarn add algoliasearch # or npm install algoliasearch ``` -------------------------------- ### Setup and Seed Database Source: https://github.com/medusajs/examples/blob/main/abandoned-cart/README.md Set up the database and seed it with initial data. ```bash npx medusa db:setup yarn seed # or npm run seed ``` -------------------------------- ### Create a Basic GET API Route Source: https://github.com/medusajs/examples/blob/main/abandoned-cart/src/api/README.md Define a simple GET endpoint at `/store/hello-world`. This serves as a basic example for creating custom API routes. ```typescript import type { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"; export async function GET(req: MedusaRequest, res: MedusaResponse) { res.json({ message: "Hello world!", }); } ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/abandoned-cart/README.md Clone the Medusa examples repository and navigate to the product-review directory to begin. ```bash git clone https://github.com/medusajs/examples.git cd examples/product-review ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/segment-integration/README.md Clone the example repository and navigate into the segment-integration directory. ```bash git clone https://github.com/medusajs/examples.git cd examples/segment-integration ``` -------------------------------- ### Install Dependencies and Seed Database Source: https://github.com/medusajs/examples/blob/main/agentic-commerce/README.md Install project dependencies and set up the database with initial data. Use 'yarn' or 'npm' as preferred. ```bash yarn # or npm install npx medusa db:setup yarn seed # or npm run seed ``` -------------------------------- ### API Route with Path Parameter Source: https://github.com/medusajs/examples/blob/main/order-gift-message/medusa/src/api/README.md Example of creating a GET API route that accepts a `productId` path parameter. ```APIDOC ## GET /api/products/[productId] ### Description Handles a GET request to an endpoint with a dynamic `productId` and returns a message including the product ID. ### Method GET ### Endpoint /api/products/:productId ### Parameters #### Path Parameters - **productId** (string) - Required - The ID of the product. ### Request Example (No request body for GET) ### Response #### Success Response (200) - **message** (string) - A message indicating the requested product ID. #### Response Example { "message": "You're looking for product {productId}" } ``` -------------------------------- ### Clone Repository and Navigate Directory Source: https://github.com/medusajs/examples/blob/main/agentic-commerce/README.md Use these commands to clone the example repository and enter the agentic-commerce directory. ```bash git clone https://github.com/medusajs/examples.git cd examples/agentic-commerce ``` -------------------------------- ### Start Next.js Storefront Source: https://github.com/medusajs/examples/blob/main/payload-integration/README.md Run the Next.js Starter Storefront in development mode, ensuring the Medusa application is already running. ```bash yarn dev # or npm dev ``` -------------------------------- ### Install Medusa App Source: https://github.com/medusajs/examples/blob/main/order-gift-message/storefront/README.md Use this command to quickly set up a Medusa server locally. ```shell npx create-medusa-app@latest ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/quotes-management/README.md Clone the Medusa examples repository and navigate to the quote-management directory. ```bash git clone https://github.com/medusajs/examples.git cd examples/quote-management ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/medusajs/examples/blob/main/restock-notification/README.md Clone the Medusa examples repository and navigate to the restock-notification directory. ```bash git clone https://github.com/medusajs/examples.git cd examples/restock-notification ``` -------------------------------- ### Set up Environment Variables Source: https://github.com/medusajs/examples/blob/main/order-gift-message/storefront/README.md Navigate to your project directory and rename the template environment file to `.env.local` to configure your local environment. ```shell cd nextjs-starter-medusa/ mv .env.template .env.local ``` -------------------------------- ### Install Memjs Package Source: https://github.com/medusajs/examples/blob/main/memcached-caching/README.md Install the 'memjs' package, which is required for the Memcached provider. ```bash yarn add memjs # or npm install memjs ``` -------------------------------- ### Install Dependencies Source: https://github.com/medusajs/examples/blob/main/abandoned-cart/README.md Install project dependencies using either Yarn or npm. ```bash yarn # or npm install ```