Feature · Commerce

Ecommerce

Stripe catalog and checkout, plan and metered feature gating, and multi-level referrals.

PHPNode / TypeScriptReact
7 packages3 languages2 MCP bridges
Plans and feature gatingLive · seeded, no Stripe

Building the catalog…

Switch plans, then spend AI credits or try a PDF export: every verdict comes from fancy-features, resolved through the plan's product features in fancy-catalog.

Referrals: downline, statement, rankLive · seeded

Referral network

One member list, two shapes: who enrolled whom, or where each member was placed. Pick a member to read their statement.

Your statement

gold
gold→ diamond
7 / 10 team members · 3 to diamond
LevelRecipientTierAmountStatus
3Gus bought Team (60 pts)gold22.5 ptspending
2Fin bought Studio (120 pts)gold90 ptspending
1Di bought Starter (40 pts)gold60 ptspaid
2Cy bought Starter (80 pts)gold60 ptspaid
1Ada bought Team (100 pts)gold150 ptspaid
Total (paid)270 pts

Plan: levels pay 100%, 50%, 25%; tier multipliers bronze ×1, silver ×1.25, gold ×1.5; compression on. fancy-mlm computes each reward and hands it to your RewardSink, which decides what it becomes (points here).

Flip the tree between sponsor and placement, and select a member to see their rewards and rank progress.

What it does

Three package pairs, one contract each side: the same models and semantics in PHP and in Node.

Plans are products with recurring prices

laravel-catalog and fancy-catalog model products, prices and product features the same way, with flat, per-seat, tiered, usage and one-time pricing models. There is no separate Plan model.

Stripe sync and hosted checkout

Products and prices sync to Stripe, re-creating a price when it changes because Stripe prices are immutable. Checkout creates Stripe Checkout sessions for subscriptions and one-time payments.

Entitlement is not quota

canAccess answers whether a feature is granted; canConsume answers whether the next unit fits. A spent quota stays entitled. The write that cannot be raced is tryIncrement in laravel-fms and tryConsume in fancy-features.

Metered overage, recorded

A plan can allow billable overage past its included quantity, as a ceiling, and null means none. In fancy-features it is permitted only when a usage store or an onOverage listener can record it, so it fails closed. Invoicing stays with your app.

Plans feed gating

createCatalogFeatureSource turns a subscription's product features into grants for fancy-features. The two packages share a contract and have no runtime dependency on each other.

Referrals in three tree shapes

fancy-mlm runs unilevel, binary and matrix trees with per-level decay, tier multipliers and compression. PHP and Node load the same plan JSON and compute identical rewards; fancy-mlm-ui draws the tree, the statement and rank progress.

How it fits

Human+ bridge

An agent drives this surface over MCP, through the same state a person sees, never the DOM.

  • import { registerCatalogBridge } from "@particle-academy/agent-integrations/bridges/catalog";tools: catalog_*
  • import { registerFeaturesBridge } from "@particle-academy/agent-integrations/bridges/features";tools: features_*

Install

  1. particle-academy/laravel-catalogPHP
    composer require particle-academy/laravel-catalog
  2. @particle-academy/fancy-catalogNode / TypeScript
    npm install @particle-academy/fancy-catalog
  3. particle-academy/laravel-fmsPHP
    composer require particle-academy/laravel-fms
  4. @particle-academy/fancy-featuresNode / TypeScript
    npm install @particle-academy/fancy-features
  5. particle-academy/fancy-mlmPHP
    composer require particle-academy/fancy-mlm
  6. @particle-academy/fancy-mlmNode / TypeScript
    npm install @particle-academy/fancy-mlm
  7. fancy-mlm-uiReact
    npm install @particle-academy/fancy-mlm-ui

The packages

particle-academy/laravel-catalogPHP

Stripe catalog (Products + Prices) via a facade API. Used by the sandbox for the demo storefront.

@particle-academy/fancy-catalogNode / TypeScript

Node/TS port of laravel-catalog — headless Stripe catalog (products / prices / plans + checkout), adapter-based with an injected Stripe client. Composes with @particle-academy/fancy-features for entitlements via its ./features bridge. No UI.

particle-academy/laravel-fmsPHP

Feature Management System — gate features, access and metered quotas in ANY Laravel app. Gate / policy / config / registry strategies. Standalone: laravel-catalog depends on FMS, never the reverse.

@particle-academy/fancy-featuresNode / TypeScript

Node/TS port of laravel-fms — headless, framework-agnostic gating of features, access and metered quotas for any app: gate / registry / config / group strategies. Owns the FeatureSource contract that @particle-academy/fancy-catalog plugs INTO. No UI.

particle-academy/fancy-mlmPHP

Framework-agnostic multi-level referral / network-marketing engine — configurable unilevel / binary / matrix downlines, level decay + tier multipliers, dynamic compression. Pure-PHP core with an optional Laravel bridge + fun-lab / catalog / fms integration. Headless; pairs with @particle-academy/fancy-mlm-ui.

@particle-academy/fancy-mlmNode / TypeScript

Node/TS mirror of particle-academy/fancy-mlm — the same CompensationPlan JSON + unilevel / binary / matrix trees yield identical rewards, isomorphic (browser or Node). Headless; no UI.

fancy-mlm-uiReact

React surfaces for the fancy-mlm referral engine — a controlled DownlineTree (unilevel / binary / matrix), a CommissionStatement ledger, and RankProgress toward the next tier. Pairs with particle-academy/fancy-mlm (PHP) or @particle-academy/fancy-mlm (Node).

Build the store on data you own

Start from the catalog, gate with features, and add referrals when you need them. Each package installs on its own.