Operations
This page covers build commands, deployment, environment configuration, and infrastructure. For local development setup, see Quickstart.
Build & Deploy Commands
Node version enforcement:
.nvmrcpins to22.20.0.package.jsonenginesrequires>= 22.15.- The Cloudflare Workers Vite plugin imports
module.registerHooks(Node ≥ 22.15 only). Older Node versions fail to loadvite.config.tswithdoes not provide an export named 'registerHooks'. vite.config.tsdynamically imports the Cloudflare plugin and skips it underprocess.env.VITEST, sonpm testandnpm run typecheckwork on any Node version.
Vite Configuration
Source: vite.config.ts
- Plugins (non-test):
@vitejs/plugin-react,@cloudflare/vite-plugin,vite-plugin-pwa. - Plugins (test): Only
@vitejs/plugin-react— Cloudflare and PWA plugins are skipped whenprocess.env.VITESTis set. - Path alias:
@/→src/(mirrored intsconfig.json). - PWA: Service worker via Workbox with
autoUpdateregistration, custom manifest, and runtime caching that forcesNetworkOnlyfor/v1/bookpaths (never cache booking API responses). - Vitest config:
globals: true,environment: jsdom, setup file atsrc/test-setup.ts.
Environment Variables
One public variable drives the app:
The value is baked in at build time by Vite mode — never read at runtime. Three environments, each with a committed per-mode file:
For local overrides, create a gitignored .env.local — it overrides the mode-specific file. Do not read import.meta.env directly anywhere except src/lib/config.ts.
Cloudflare Workers Deployment
Source: wrangler.jsonc
The app is deployed as static assets on Cloudflare Workers:
Top-level (production) worker
- Name:
salon-booking-ui - Domain:
booking.auralynkai.com - Route:
{ pattern: "booking.auralynkai.com", custom_domain: true }
UAT environment worker
- Name:
salon-booking-ui-uat - Domain:
booking-uat.auralynkai.com - Route:
{ pattern: "booking-uat.auralynkai.com", custom_domain: true }
Worker settings (applied to both)
Key operational detail: UAT and production are two separate workers, each with its own custom_domain route. Routes are not inherited between envs, so they're redeclared in the env.uat block. Assets, compatibility, and observability settings are inherited from the top level.
TypeScript Configuration
Source: tsconfig.json
- Target: ES2021
- Module: ESNext (bundler resolution)
- JSX:
react-jsx - Strict mode: enabled, with
noUnusedLocalsandnoUnusedParameters - Path alias:
@/*→src/* - No emit (
noEmit: true) — Vite handles compilation
Backend Configuration Hookup
The backend's Booking:SelfService:ManageBaseUrl setting controls the base URL included in email magic links:
Email links follow the format {ManageBaseUrl}/{token} → https://booking.auralynkai.com/manage/eyJ....
Notes for Future Agents
- Adding a new environment: Add a
.env.<mode>file, updatewrangler.jsoncwith a newenv.<mode>block (routes must be redeclared), and add npm scripts for build/deploy. - Node version: The Cloudflare plugin dependency on
module.registerHooksis the sole reason for the Node ≥ 22.15 requirement. If@cloudflare/vite-pluginrelaxes this, the engines constraint can be lowered. - Deployment: Always run
tsc -b && vite build(thebuild/build:uatscripts) before deploying. Wrangler deploy does not run the build step automatically in the current setup. - PWA cache: The service worker is configured to never cache
/v1/bookpaths. If the API path prefix changes, update theruntimeCachingrule invite.config.ts. - SPA routing: The Workers
assets.not_found_handling: "single-page-application"setting ensures client-side routes work. If this ever needs to change (e.g., to serve a custom 404 page), React Router would need a catch-all route instead.