Self-contained CDK app (S3 + CloudFront + OIDC deploy role) deployed via the org reusable cd-cdk.yaml. Frontend served on dev.seahaven.com with the *.seahaven.com cert and a Route 53 apex alias; the SPA calls the dev backend directly at https://api.dev.seahaven.com/api. |
||
|---|---|---|
| .cursor/rules | ||
| .github | ||
| .husky | ||
| config | ||
| docs | ||
| e2e/auth | ||
| infra/cdk | ||
| public | ||
| scripts | ||
| src | ||
| .env | ||
| .env.development | ||
| .env.example | ||
| .env.production | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc | ||
| commitlint.config.js | ||
| eslint.config.js | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| playwright.config.ts | ||
| README.md | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
| vitest.config.ts | ||
SeaHaven Admin
Vite + React SPA for SeaHaven facility management (work orders, vendor portal, uplifts, and related admin features).
Requirements
- Node.js 20+
- npm 10+
Setup
npm ci
cp .env.example .env
Environment variables
| Variable | Description | Default |
|---|---|---|
VITE_API_URL |
Ky API prefix (baked into the production build) | /api |
VITE_API_TARGET |
Dev proxy target for /api (Vite only) |
http://localhost:5141 |
VITE_API_URL is the full API base prefix. Route paths in API_PATHS do not include /api — only this variable supplies it.
- Development: use
VITE_API_URL=/api. The Vite dev server proxies/apitoVITE_API_TARGET. - Production: use an absolute URL that ends with
/api(e.g.https://api.example.com/api). Absolute URLs without/apiwill produce broken API requests.
See .env.example and .env.production for reference values.
Scripts
| Command | Description |
|---|---|
npm run dev |
Start Vite dev server on port 3000 |
npm run build |
Type-check and production build to dist/ |
npm run preview |
Preview production build locally |
npm test |
Run Vitest unit tests |
npm run test:watch |
Run Vitest in watch mode |
npm run lint |
ESLint |
npm run lint:fix |
ESLint with auto-fix |
npm run format |
Prettier write |
npm run format:check |
Prettier check (used in CI) |
Architecture
New code lives under src/domain/, src/app/, and src/api/ following the IrisLoan conventions documented in docs/ARCHITECTURE_PLAN.md.
CI
GitHub Actions workflow (.github/workflows/ci.yml) runs on push and pull requests:
npm run format:checknpm run lintnpm run buildnpm test
Local pre-commit hooks (Husky + lint-staged) run ESLint and Prettier on staged files.
Deployment (CI/CD)
The app is hosted on AWS S3 + CloudFront, provisioned by an AWS CDK app
local to this repo (infra/cdk/). Deployment runs
through the org's reusable GitHub Actions workflow via OIDC (no stored AWS
keys):
- Push to
dev→.github/workflows/deploy.ymlcalls the org reusablecd-cdk.yaml, which runscdk deploy(infra) thenscripts/deploy-web.sh(builds the SPA, syncsdist/to S3, invalidates CloudFront). - Served on the custom domain
dev.seahaven.com; the SPA calls the backend directly over HTTPS atVITE_API_URL(https://api.dev.seahaven.com/api, cross-origin — the backend allows CORS).VITE_API_URLis baked into the build, so it is per-environment. - First-time provisioning (OIDC provider, CDK bootstrap, first local deploy, the
AWS_DEPLOY_ROLE_ARNsecret) is a one-time admin task — seeinfra/cdk/README.md.
Development proxy
During npm run dev, requests to /api are proxied to VITE_API_TARGET (see vite.config.ts).