Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

1.3 KB
Raw Blame
import { createSellerApiClient, createSellerRouter, SellerDashboard } from '@spree/seller-dashboard'
import { createRoot } from 'react-dom/client'
import './styles.css'
// Generated by @spree/seller-dashboard/vite on every dev start and build.
// Commit it — its diff on upgrades shows exactly which pages changed.
// Activate installed seller-panel plugins — synthesized by the Vite plugin
// from your package.json deps. `pnpm add <plugin>` + dev-server restart is
// the whole install; this line never changes.
import 'virtual:spree-dashboard-plugins'
// Your own customisations (nav entries, slot widgets, table columns).
import './plugins'
import { routeTree } from './routeTree.gen'

// Build the Seller API client and register it with the shared framework
// before anything renders: the providers read it on mount.
createSellerApiClient({ baseUrl: import.meta.env.VITE_SPREE_API_URL || '' })

// basepath mirrors Vite's `base` so sub-path mounts route correctly.
const router = createSellerRouter(routeTree, { basepath: import.meta.env.BASE_URL })

// Registers the router program-wide so <Link> and navigation are type-checked
// against the real route tree.
declare module '@tanstack/react-router' {
  interface Register {
    router: typeof router
  }
}

createRoot(document.getElementById('root')!).render(<SellerDashboard router={router} />)