Spree Commerce is an open-source, API-first eCommerce platform designed for enterprises and fast-growing businesses that require native support for complex commerce models such as B2B wholesale, multi-vendor marketplaces, and multi-tenant SaaS platforms. It eliminates vendor lock-in by letting you self-host, customize every layer, and integrate with existing systems like ERP, CRM, and payment gateways. Built on Ruby on Rails with a modern headless architecture, Spree supports both traditional storefronts and headless integrations with Next.js, React, or mobile apps.
The platform is deployed via Docker and Node.js-based tooling (npx create-spree-app), with enterprise-grade security features, a robust admin dashboard built with Tailwind CSS, and a modular architecture that allows businesses to start simple and scale into multi-region, multi-store, or multi-vendor operations without switching platforms. Its ecosystem includes native integrations with Stripe, Adyen, Klaviyo, Google Analytics 4, and SAML/OIDC SSO.
What You Get
- Stripe-like API & SDK - A fast, secure, and well-documented REST API with official SDKs for seamless integration into mobile apps, headless storefronts, and third-party systems.
- Admin Dashboard with Tailwind CSS & Tables DSL - A modern, customizable admin interface with role-based permissions, staff management, and a declarative Tables DSL for building custom data views without code.
- Flexible Pricing Engine - Native support for regional pricing, customer-specific price lists, volume tiers, wholesale discounts, and time-based promotions without plugins.
- Multi-vendor Marketplace Module - Automated vendor onboarding (via Shopify, WooCommerce, CSV), split payments, vendor dashboards, commission tracking, and Stripe Connect payout integration.
- Multi-tenant eCommerce Capabilities - Host hundreds of independent stores with shared backend operations, centralized billing, and tenant-specific storefronts, dashboards, and branding for white-label SaaS or franchise networks.
- B2B eCommerce Features - Buyer organizations with role-based access, purchase approval workflows, net payment terms, gated storefronts, and ERP/procurement system integrations.
- Global by Default - Built-in multi-currency, multi-language, and region-specific tax rules with automatic localization — no plugins required for international expansion.
- Webhooks 2.0 with Admin UI - Configure and manage webhooks directly from the admin panel to trigger external systems on order, product, or customer events.
- Digital Product Fulfillment - Automated delivery of software, licenses, or downloads with access management and license key generation upon purchase.
- CSV Import/Export for Products - Bulk import and export product data with variants, metafields, and images using standard CSV formats for easy catalog management.
Common Use Cases
- Running a B2B wholesale portal - A manufacturer uses Spree to create gated storefronts for resellers with custom pricing, purchase approvals, and net-30 payment terms integrated with their ERP.
- Launching a multi-vendor marketplace - A platform operator onboards vendors from Shopify and WooCommerce, manages commissions via Stripe Connect, and controls quality through centralized order and inventory sync.
- Operating a multi-tenant SaaS commerce platform - A white-label provider hosts 500+ independent stores for franchises or resellers, each with their own branding, inventory, and dashboards — all managed from a central admin.
- Scaling a multi-brand retail business - A company runs three distinct consumer brands from one Spree backend with shared customers, inventory, and analytics, reducing operational overhead by 60%.
Under The Hood
Architecture
- Monolithic Rails-based core with well-defined bounded contexts through dedicated modules for core, API, admin, and email functionality
- Service objects and serializers enforce single responsibility by decoupling business logic from controllers and view rendering
- Dependency injection via Rails containers and initializers enables plugin extensibility without tight coupling
- Multi-repo monorepo structure using pnpm workspaces to synchronize Ruby and TypeScript components with shared type generation
- Event-driven patterns with subscribers allow asynchronous workflows and plugin-based extensions without modifying core controllers
- Automated TypeScript/Zod schema generation from Ruby serializers ensures frontend-backend type consistency through pre-commit hooks
Tech Stack
- Ruby on Rails 7.x as the foundational e-commerce engine, leveraging ActiveRecord, Action Cable, and API modules
- PostgreSQL and Redis as primary data stores, with Meilisearch powering advanced product search
- Monorepo orchestration via pnpm and Turbo to coordinate builds across Ruby and TypeScript packages
- TypeScript-based frontend SDKs and admin interfaces built with Vitest, MSW, and TSX for type-safe development and testing
- Docker Compose with health checks ensures consistent local and CI environments across all services
- Lefthook and Codecov enforce automated type generation and test coverage standards
Code Quality
- Comprehensive test coverage spanning models, controllers, services, and serializers with robust state verification
- Modular test structures organized by domain and context, using RSpec and Vitest for clear separation of concerns
- Domain-specific exceptions and state rollback mechanisms ensure reliable error handling and data integrity
- Consistent naming conventions across Ruby and TypeScript improve readability and reduce cognitive load
- Strong type safety in TypeScript complemented by ActiveRecord validations and counter caches for data reliability
- Automated linting, test cleanup, and factory-based test data generation maintain test hygiene and predictability
What Makes It Unique
- Deeply integrated multi-tenant API architecture with versioned endpoints that preserve backward compatibility without legacy code
- Plugin-first admin interface allowing UI extensions at the view layer without monkey-patching
- Native multi-currency and multi-language tax calculations embedded in the core model layer
- Dynamic pricing engine supporting tiered, time-based, and customer-segmented rules without external dependencies
- Configurable order workflow engine with state machine hooks enabling non-developers to define custom fulfillment pipelines
- Headless commerce adapter that auto-generates GraphQL schemas from domain models, eliminating manual API documentation