/sub-packages/zpreorder/CLAUDE.md
CLAUDE.md at /sub-packages/zpreorder/CLAUDE.md
Path: sub-packages/zpreorder/CLAUDE.md
zpreorder — Preorder Admin Panel
Vite + React app for managing notify subscriptions and reservations. Connects to Netlify Functions API.
Start
# Mock mode (default — no network dependencies)
pnpm zpreorder:dev # from project root (port 9876)
cd sub-packages/zpreorder && pnpm dev # from this directory
# Dev with API (3 environments, from project root)
pnpm zpreorder:dev:full # local Netlify Functions (port 9999, offline blobs)
pnpm zpreorder:dev:preview # pointing to preview deploy API
pnpm zpreorder:dev:prod # pointing to production API
Architecture
- API client:
src/utils/api-client.js— all API calls with Bearer token auth - Auth: Uses
VITE_API_TOKENenv var forPREORDER_API_TOKENauthentication - Base URL:
VITE_API_BASE_URL— points to production or preview Netlify site - Routing: React Router with pages for Dashboard, Notify, Reservations, Send, Templates
- Styling: Tailwind CSS with project design tokens (
zd-*colors, semantic spacing)
Pages
| Route | Component | Purpose |
|---|---|---|
/ | dashboard.jsx | Stats overview |
/notify | notify-list.jsx | Manage notify subscriptions |
/reservations | reservation-list.jsx | Manage reservations |
/send-notification | send-notification.jsx | Batch email sending |
/email-templates | email-templates.jsx | Edit auto-reply templates |
Environment Variables
.env: OnlyVITE_PREORDER_API_TOKEN(auth token). Do NOT putVITE_API_BASE_URLhere.VITE_API_BASE_URL: Set by npm scripts (dev:remote-prod/dev:remote-prev), NOT.env.
Testing
pnpm test # Vitest unit tests
pnpm test:e2e # Playwright E2E tests