Align READMEs with SSH host management and current config layout.

This commit is contained in:
2026-07-19 22:07:27 +02:00
parent 7631591f30
commit 5307ba1a7b
2 changed files with 73 additions and 30 deletions
+52 -25
View File
@@ -1,32 +1,59 @@
# React + TypeScript + Vite
# ClusterCanvas web UI
This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
React 19 + TypeScript + Vite SPA for ClusterCanvas. It talks to the Go API over `/api` and `/health`.
Currently, two official plugins are available:
For service config, remotedev, and repo-wide build/test targets, see the [root README](../README.md).
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
## Develop
## React Compiler
From this directory:
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
## Expanding the Oxlint configuration
If you are developing a production application, we recommend enabling type-aware lint rules by installing `oxlint-tsgolint` and editing `.oxlintrc.json`:
```json
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "oxc"],
"options": {
"typeAware": true
},
"rules": {
"react/rules-of-hooks": "error",
"react/only-export-components": ["warn", { "allowConstantExport": true }]
}
}
```bash
npm install
npm run dev
```
See the [Oxlint rules documentation](https://oxc.rs/docs/guide/usage/linter/rules) for the full list of rules and categories.
Or from the repo root: `make webui` (UI only) or `make dev` (API + UI).
The Vite dev server listens on `:5173` and proxies `/api` and `/health` to `http://localhost:8080` (see `vite.config.ts`).
Optional: set `VITE_API_BASE_URL` if you call the API without the Vite proxy (defaults to `http://localhost:8080`). An empty value means same-origin requests (used by `make remotedev` builds).
## Scripts
| Script | Purpose |
|--------|---------|
| `npm run dev` | Vite dev server with HMR |
| `npm run build` | Typecheck + production build to `dist/` |
| `npm run preview` | Serve the production build locally |
| `npm test` | Vitest (jsdom) once |
| `npm run test:watch` | Vitest in watch mode |
| `npm run lint` | Oxlint (see `.oxlintrc.json`) |
## App map
Flow: **setup wizard****login** → main shell.
| Area | Notes |
|------|-------|
| Overview | Placeholder for a future dashboard |
| Containers / Docker / VMs | UI categories for manually registered SSH hosts |
| Activity | Node and auth audit logs (when permitted) |
| Profile | Password change and TOTP enroll/disable |
| Configuration | Users, groups, roles catalog, actions, security, network; Integrations / Advanced are placeholders |
Node detail tabs: **Overview** (metadata), **Actions** (groups, schedules, run), **Logs** (action run history).
### Key source files
| Path | Role |
|------|------|
| `src/App.tsx` | Shell, routing state, main screens |
| `src/api/client.ts` | HTTP client and API types |
| `src/navigation.ts` | Section / tab / URL helpers |
| `src/NodeDetailPanel.tsx` | Per-node overview, actions, logs |
| `src/SetupWizard.tsx` | First-run setup |
## Stack
React 19, Vite 8, Vitest + Testing Library, Oxlint. React Compiler is not enabled.