Medusa Commerce Platform

repository·develop·Indexed 12 days ago

https://github.com/medusajs/medusa

An open-source commerce framework for building customized commerce applications. It features a modular architecture and provides a suite of tools including create-medusa-app for setup, @medusajs/http-types-generator for Zod-based TypeScript type generation, medusa-oas-cli for OpenAPI Specification extraction, and a design system comprising @medusajs/ui and @medusajs/icons.

Tokens
1.1M
Snippets
3.1K
Records
4.2K
Agent score
98%

What's inside Medusa

  1. What is Medusa?

    develop

    Medusa is a commerce platform featuring a built-in framework for customization. It allows developers to build custom commerce applications (such as B2B/DTC stores, marketplaces, distributor platforms, PoS systems, or service businesses) without reinventing core commerce logic.

    Key aspects:

    • Core Modules: The core commerce modules are open-source and available via npm.
    • Architecture: Medusa is built around modular commerce primitives. For deep dives, refer to the Architecture Overview and Commerce Modules documentation.
    • Licensing: Medusa uses an open-core model. The core is under the MIT License, while specific Enterprise Edition features (such as RBAC-based materials) require a commercial agreement.
  2. Overview of the Customer Module

    develop

    The Customer Module is a core Medusa module designed to manage entities capable of making purchases within a store. It provides the foundational logic for handling customer identities and organization.

    Key capabilities include:

    • Contact Detail Management: Storing and managing customer contact information.
    • Customer Grouping: Organizing customers into logical groups for segmentation and targeted operations.
  3. Overview of Draft Order features

    develop

    The Draft Order plugin allows admin users to create and manage orders on behalf of customers, which is ideal for customer support or offline sales.

    Key capabilities include:

    • Creating draft orders via the Medusa Admin dashboard.
    • Managing items within a draft order (adding, updating, or removing items).
    • Adding shipping methods to the draft order.
    • Associating customers with specific draft orders.
    • Converting draft orders into regular orders to complete the purchase process.
  4. Overview of the Auth Module features

    develop

    The Auth Module is a standalone Commerce Module in Medusa that provides out-of-the-box authentication capabilities. Key features include:

    • Basic User Authentication: Email and password credentials.
    • Third-Party and Social Authentication: Integration with services like Google and GitHub.
    • Custom Actor Types: Ability to create and authenticate custom user types (e.g., managers) and guard routes based on them.
    • Email Verification: Requirement for new registrations.
    • Multi-Factor Authentication (MFA): Support for TOTP, backup recovery codes, and configurable disable policies.
    • Custom Authentication Providers: Interface to integrate your own third-party services.
  5. Overview of Medusa Cloud features

    develop

    Medusa Cloud provides a managed environment for Medusa applications with the following key capabilities:

    • Hosting: Zero-configuration hosting for Backend, Admin, and Storefront.
    • Deployment: Direct deployments from GitHub with automatic triggers on pushes to the main branch. Includes zero-downtime deployments and instant preview environments for every pull request.
    • Managed Resources: Automatically managed Postgres database, Redis server, and S3 bucket.
    • Performance & Communication: Includes Medusa Cache for API performance and Medusa Emails for transactional emails (e.g., order confirmations) with zero configuration.
    • Scalability & Reliability: Automatic autoscaling to meet traffic demands and zero-downtime rollouts.
    • Observability: Access to runtime and build logs for debugging.
    • AI-Powered Tools:
      • Cloud CLI: Manage resources and debug using AI agents like Claude Code.
      • Fix with AI: Automated troubleshooting for build and deployment issues.
      • Docs MCP Server: Access documentation via an MCP server in your IDE or AI tools.
  6. Overview of Loyalty Features in Medusa Admin

    develop

    Medusa Admin provides tools to manage three core loyalty components that allow you to offer flexible payment options and enhance customer experience:

    • Gift Cards: Unique codes issued directly to customers. Each card holds a balance that can be applied at checkout.
    • Gift Card Products: Storefront products that, when purchased, automatically generate a gift card for the customer.
    • Store Credits: Balance accounts linked to specific customer profiles. You can manually credit these accounts, and customers can apply the balance during checkout.
  7. Overview of the Settings Module

    develop

    The Settings Module in Medusa is designed to manage user preferences and system-wide configurations. It allows for the persistence of UI-related settings and arbitrary user data.

    Key capabilities include:

    • View Configurations: Managing table view settings such as column visibility, column order, and column widths.
    • User Preferences: Storing arbitrary key-value pairs representing specific user preferences.
    • System Defaults: Enabling admin users to define default configurations that apply to all users across the system.
  8. What is Medusa?

    develop

    Medusa is an AI-native commerce platform designed with a Framework to build custom commerce features. It consists of three primary components:

    1. Commerce Modules: A suite of core functionalities including inventory tracking, cart total calculations, payment acceptance, and order management.
    2. Framework: A system for building agentic flows and custom business logic. This allows you to introduce custom API endpoints, data models, workflows, automations, and third-party integrations.
    3. Admin Dashboard: A customizable dashboard for merchants to manage and operate their stores.

    Medusa is built for high customization, providing native support for AI agents to automate operations and customer interactions without the need for maintainability-limiting workarounds.

  9. Implement Product Feed for Meta and Google

    develop

    This tutorial provides a guide for creating an automated product feed in Medusa. This feed can be used to sync your product catalog with social media and advertising platforms like Meta (Instagram/Facebook) and Google.

    Learning Objectives

    • Set up a Medusa application with a Next.js storefront.
    • Create a Medusa Workflow to build a product feed XML.
    • Expose an API route to serve the generated XML feed.
    • Integrate the API route with Meta and Google platforms.

    Resources

  10. Integrate Sentry for Performance and Error Monitoring

    develop

    Medusa supports integration with Sentry to provide real-time tracking of errors and performance monitoring. This integration allows you to trace several key components of your application:

    • HTTP requests
    • Workflows
    • Query usages
    • Database operations

    By setting up Sentry instrumentation, you can monitor how your customizations perform and identify errors within your workflows and database interactions effectively.