mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-07 16:19:01 +00:00
1.9 KiB
1.9 KiB
AGENTS.md
Cursor Cloud specific instructions
This repo is the React 19 / Vite SPA for SHOC (Sea Haven Industries), a facility
maintenance / work-order & vendor-dispatch platform. It talks to the .NET 8 Web API in
the shoc-backend repo. Standard scripts live in package.json / README.md.
Node version
package.json engines require Node >=22.22.1. On Cloud Agent VMs, prefer nvm and
put that binary ahead of /exec-daemon/node (often an older 22.14.x):
export PATH="$HOME/.nvm/versions/node/v22.22.2/bin:$PATH"
Running (dev)
- Install deps with
npm install(committedpackage-lock.json), thennpm run dev(Vite onhttp://localhost:3000). UseBROWSER=none npm run dev -- --host 0.0.0.0 --port 3000in headless VMs. - In dev,
.env.developmentsetsVITE_API_URL=/apiandVITE_API_TARGET=http://localhost:5141. Vite proxies/api→ that target, so the backend Web API must be running on:5141(seeshoc-backendAGENTS.md) for auth and data to work. - Log in with the backend-seeded dev admin using Cursor Cloud secrets
TEST_LOGIN_USERNAMEandTEST_LOGIN_PASSWORD. Do not commit plaintext credentials.
Lint / test / build
- Lint:
npm run lint(eslint . --max-warnings=0). - Unit tests:
npm test(vitest run). - E2E:
npm run test:e2e(Playwright; needs app + usually API). - Build:
npm run build(tsc -b && vite build). Day-to-day work usesnpm run dev, not the production build.
Known pre-existing app / backend bugs (NOT environment problems)
- Several list/detail pages can error when the backend joins the drifted
Locationstable or missingEventstable (seeshoc-backendAGENTS.md). Prefer hello-world paths that avoid those joins (login + Employee create/list). - Contact / other forms may still have product bugs; do not treat those as setup failures.