# Spree Commerce — Open-Source Headless E-Commerce for Ruby > A mature open-source headless e-commerce platform built with Ruby on Rails, offering REST API, TypeScript SDK, and a Next.js storefront for cross-border and marketplace commerce. ## Install Save in your project root: # Spree Commerce — Open-Source Headless E-Commerce for Ruby ## Quick Use ```bash gem install spree rails new my_store cd my_store bundle add spree bin/rails g spree:install bin/rails server ``` ## Introduction Spree Commerce is one of the longest-running open-source e-commerce frameworks, first released in 2008. Built on Ruby on Rails, it has evolved into a headless-first platform with a REST API, TypeScript SDK, and a pre-built Next.js storefront for modern deployments. ## What Spree Does - Provides a complete headless commerce backend with product management, orders, and payments - Ships a Next.js-based storefront that connects via the REST API - Supports multi-store, multi-currency, and multi-language from a single instance - Handles B2B, B2C, marketplace, and cross-border commerce scenarios - Offers an extensible architecture via Rails engines and Spree extensions ## Architecture Overview Spree is a set of Ruby gems mounted into a Rails application. The backend exposes a versioned REST API consumed by any frontend. The data layer uses ActiveRecord with PostgreSQL or MySQL. The storefront is a standalone Next.js app communicating through the TypeScript SDK. Background jobs run via Sidekiq for order processing and notifications. ## Self-Hosting & Configuration - Requires Ruby 3.2+, Rails 7+, Node.js 18+, and PostgreSQL - Install via Bundler and the Spree generator - Configure database, payment gateways, and shipping in the admin panel - Docker Compose files available in the official repo - Use Sidekiq and Redis for background job processing ## Key Features - Headless-first with a full REST API and TypeScript SDK - Multi-vendor marketplace support via extensions - Built-in support for digital products, subscriptions, and gift cards - Customizable checkout flow and tax calculation engine - Over 15 years of community-developed extensions ## Comparison with Similar Tools - **Bagisto** — Laravel-based; more monolithic, better for PHP teams - **Medusa** — Node.js headless; newer, smaller extension ecosystem - **Saleor** — Python/GraphQL; stronger GraphQL API, less mature marketplace support - **WooCommerce** — WordPress-based; larger ecosystem but tightly coupled to WordPress - **Solidus** — Ruby fork of older Spree; more conservative release cadence ## FAQ **Q: Is Spree free for commercial use?** A: Yes. Spree is licensed under the BSD 3-Clause license. **Q: Can I use Spree as a headless backend only?** A: Yes. The API-first design means any frontend framework can consume the REST endpoints. **Q: How active is the community?** A: Spree has been in active development since 2008 with regular releases and a marketplace of extensions. **Q: Does Spree support multi-vendor marketplaces?** A: Yes, through the official multi-vendor extension that adds seller dashboards and commission management. ## Sources - https://github.com/spree/spree - https://spreecommerce.org --- Source: https://tokrepo.com/en/workflows/5c065bd5-4236-11f1-9bc6-00163e2b0d79 Author: AI Open Source