Real-time dynamic pricing for Medusa — gold, silver, and any volatile-price asset.
→ Use this template on GitHub to create your own repository pre-wired with the Fluctum dynamic pricing plugin.
- Medusa backend (
backend/) — pre-configured with@u11d/medusa-dynamic-pricing - Next.js 16 storefront (
storefront/) — live SSE price bar, dynamic cart, price-locked checkout - Docker Compose — PostgreSQL 17 + Redis 8 for local development
- Turbo monorepo (pnpm workspaces) with
dev/build/lint/testtasks
Prices update every few seconds from a live spot-price feed (goldapi.io or the built-in random provider for dev). They are displayed in real time via SSE and locked at checkout entry to protect both customer and merchant.
- Node.js v24+
- pnpm v11+ (
corepack enableto get the version pinned inpackage.jsonautomatically) - Docker & Docker Compose
Click Use this template on GitHub, or clone directly:
git clone https://github.com/u11d-com/fluctum_starter.git my-store
cd my-storeInstall workspace dependencies:
pnpm installcp backend/.env.template backend/.envFor the storefront:
cp storefront/.env.template storefront/.envdocker compose up -dPostgreSQL will be available on port 5432 (database: fluctum) and Redis on port 6379.
pnpm run backend:migratepnpm run backend:create-adminpnpm run backend:dev| Service | URL |
|---|---|
| Backend API | http://localhost:9000 |
| Admin panel | http://localhost:9000/app |
Log into the admin panel and confirm it loads correctly, then copy the Publishable API key (http://localhost:9000/app → Settings → API Keys) into storefront/.env:
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=pk_...
In a separate terminal, with the backend still running:
pnpm run storefront:dev| Service | URL |
|---|---|
| Storefront | http://localhost:8000 |
Once both are confirmed working, you can stop them and use pnpm run dev going forward to start backend + storefront together.
- Push your repository to GitHub
- Go to cloud.medusajs.com and connect your repo
- Deploy — Medusa Cloud handles migrations, scaling, and SSL automatically
The plugin is configured in backend/medusa-config.ts:
import { randomProvider, createGoldApiProvider } from "@u11d/medusa-dynamic-pricing"
{
resolve: "@u11d/medusa-dynamic-pricing",
options: {
materials: ["XAU", "XAG"],
fetchIntervalSeconds: 10,
priceLockDurationSeconds: 600,
provider: process.env.GOLD_API_KEY
? createGoldApiProvider({ apiKey: process.env.GOLD_API_KEY })
: randomProvider,
},
}See the plugin documentation for all options.
| Script | Description |
|---|---|
pnpm run dev |
Start backend + storefront in parallel |
pnpm run backend:dev |
Start only the backend (useful for first-run setup) |
pnpm run storefront:dev |
Start only the storefront |
pnpm run build |
Build all packages |
pnpm run lint |
Lint all packages |
pnpm run test |
Run all tests |
MIT