packages/dashboard-starter/README.md
The host app for the Spree React Dashboard — the admin for your Spree store. @spree/dashboard is the actual app shell (routes, chrome, resource pages); this project is your customization point: plugins, your own pages, theming, and deployment config.
Monorepo note. The canonical source of this template lives at
packages/dashboard-starterin spree/spree, where its Spree dependencies resolve via the pnpm workspace and@spree/dashboard-plugin-exampleis installed as a devDependency — booting it here doubles as the end-to-end test for the plugin pipeline. At build time,@spree/cliandcreate-spree-appembed a standalone rendering of it (workspace deps rewritten to the published versions — seescripts/sync-dashboard-starter.mjs), which is whatspree add dashboardand the create-spree-app dashboard prompt scaffold from.
pnpm install
cp .env.example .env.local # optional — VITE_API_PROXY_TARGET if your API isn't on :3000
pnpm dev # http://localhost:5173
The dev server proxies /api to your Rails backend so the SPA stays same-origin — don't set VITE_SPREE_API_URL in dev (it switches the SDK to absolute cross-origin URLs, which breaks on CORS and the auth cookie).
Sign in with an admin account — authentication is interactive (JWT + refresh cookie). No API keys belong in .env.local: every VITE_-prefixed value is compiled into the client bundle.
pnpm add @acme/reviews-plugin
# restart the dev server
That's the whole install. spreeDashboardPlugin() (see vite.config.ts) discovers any dependency carrying the spree.dashboard.plugin marker, activates it through the virtual:spree-dashboard-plugins module imported in src/main.tsx, and wires its Tailwind classes.
src/plugins.ts is yours — register nav entries, routes, slot widgets, and table columns with defineDashboardPlugin from @spree/dashboard-core. Same API the distributed plugins use; see the customization quickstart.
pnpm build # static assets in dist/
Deploy dist/ to any static host. Set VITE_SPREE_API_URL to your production API at build time, and configure the API's CORS/cookie settings for the dashboard origin.