Ecommerce
Stripe catalog and checkout, plan and metered feature gating, and multi-level referrals.
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.
One member list, two shapes: who enrolled whom, or where each member was placed. Pick a member to read their statement.
Your statement
gold| Level | Recipient | Tier | Amount | Status |
|---|---|---|---|---|
| 3 | Gus bought Team (60 pts) | gold | 22.5 pts | pending |
| 2 | Fin bought Studio (120 pts) | gold | 90 pts | pending |
| 1 | Di bought Starter (40 pts) | gold | 60 pts | paid |
| 2 | Cy bought Starter (80 pts) | gold | 60 pts | paid |
| 1 | Ada bought Team (100 pts) | gold | 150 pts | paid |
| 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
composer require particle-academy/laravel-catalognpm install @particle-academy/fancy-catalogcomposer require particle-academy/laravel-fmsnpm install @particle-academy/fancy-featurescomposer require particle-academy/fancy-mlmnpm install @particle-academy/fancy-mlmnpm install @particle-academy/fancy-mlm-ui
The packages
Stripe catalog (Products + Prices) via a facade API. Used by the sandbox for the demo storefront.
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.
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.
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.
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.
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.
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.
