React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default tseslint.config([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
...tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
...tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
...tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default tseslint.config([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
E2E testing (Cypress)
Run end-to-end tests in a Docker container with a single script and a shared env file.
Setup
- Copy the example env file:
cp .env.e2e.example .env.e2e - Edit
.env.e2ewith the correct credentials/URLs for your environment.
Run all E2E specs in order (Docker)
The Docker runner script runs specs in this order by default:
- Join organization (Mailhog)
- Offboard/onboard
- Deployments wizard + details
- Ensembles CRUD/JSON flows
./scripts/run-e2e-docker.sh
Run from another machine
Set the base URLs to the reachable host/IP for the UI and backend:
CYPRESS_BASE_URL=http://appliance-host:5173 \\
CYPRESS_BACKEND_BASE_URL=http://appliance-host:8080 \\
./scripts/run-e2e-docker.sh
On Linux, you can also use host networking for the container:
DOCKER_NETWORK=host ./scripts/run-e2e-docker.sh
Customize which specs run
Override the spec list (comma-separated) if you need a different order or a subset:
CYPRESS_SPECS=cypress/e2e/deployments.cy.ts,cypress/e2e/ensembles.cy.ts \\
./scripts/run-e2e-docker.sh
Notes
- The join-organization spec uses Mailhog. Configure
CYPRESS_MAILHOG_BASE_URL,CYPRESS_MAIL_INBOX_DOMAIN, andCYPRESS_MAIL_SUBJECT_FRAGMENTif you use a different setup. - Override the join-org target with
CYPRESS_NUTEST_ORG_DIDandCYPRESS_NUTEST_ROLEif needed. - For test-only orgs, place
known_organizations.e2e.jsonnext to the main known-orgs file on the appliance; it is merged at load time. - The script uses
cypress/included:13.15.2and installs dependencies inside the container. It keepsnode_modulesand pnpm store in Docker volumes so the repo stays clean.