Ship the Next.js cycle editor with CAD chrome, technical HX symbols, Fixed/Free boundary guidance, and secondary water/air pressure drop support in the solver stack. Co-authored-by: Cursor <cursoragent@cursor.com>
Entropyk Web UI
Visual canvas builder for Entropyk thermodynamic cycles.
The UI emits the same ScenarioConfig JSON as the CLI
(crates/cli/src/config.rs). Physics always runs through
entropyk_cli::run::simulate_from_json via the Axum ui-server.
Prerequisites
- Node.js 18+ and npm
- The Rust API server running (see below)
Setup
1. Start the Rust API server
From the project root:
cargo run -p entropyk-demo --bin ui-server
# → http://localhost:3030
Endpoints:
GET /api/healthGET /api/componentsPOST /api/simulateGET /api/mollier?fluid=R134a
2. Start the Next.js dev server
cd apps/web
npm install
npm run dev
# → http://localhost:3000
By default the frontend proxies /api/entropyk/* to http://localhost:3030/api/*
(see next.config.mjs). To point at a different API, set:
ENTROPYK_API_URL=http://my-host:3030 npm run dev
Usage
- Drag components from the left palette onto the canvas.
- Connect ports by dragging from one handle to another.
- Select a node to edit its parameters in the right panel.
- Pick the fluid and backend in the top bar.
- Click Solve cycle — the result panel shows COP, edge states and a P-h diagram.
- Load drops in a CLI example from the picker; Import JSON loads any CLI config.
- Multi-run sweeps parameters (fluid, UA, …) and solves cases in parallel.
Architecture
Browser (Next.js) Rust API (Axum ui-server :3030)
React Flow canvas → POST /api/simulate
Zustand store → simulate_from_json() (CLI engine)
Recharts P-h diagram ← SimulationResult JSON
Anything buildable in the UI can also be run with:
cargo run -p entropyk-cli -- run path/to/config.json
Deprecated surfaces
ui/at the repo root — legacy static HTML; calls removed/api/calculate. Do not use.tools/circuit-builder-ui— alternate HTML builder; preferapps/web.