-
Install Dependencies:
bun install
-
Run Development Server:
bun run dev
- Dashboard: http://localhost:3000
- Network Editor: http://localhost:3002
- PSV: http://localhost:3003
- Venting Calculation: http://localhost:3004
-
Build:
bun run build
apps/: Next.js applications (web, network-editor, psv, venting-calculation, docs)services/: Backend services (api, calc-engine, design-agents)packages/: Shared packages (ui, ui-kit, physics-engine, api-client, types, unit-converter)infra/: Docker and deployment config
- Strict mode is enabled. Avoid
anywhenever possible. - Define interfaces/types for all props and state.
- Shared types should reside in
packages/physics-engine/src/types.tsorpackages/shared.
- Use Material UI (MUI) components.
- Use the
sxprop for styling. - Glassmorphism: Use the shared
glassPanelSxandliquidGlassBorderSxfrom@eng-suite/ui-kitfor consistent panel styling. - Theming: Ensure all colors are theme-aware. Use
theme.palette.modeto switch between light and dark styles.- Dark Mode:
rgba(255, 255, 255, 0.1)backgrounds. - Light Mode:
rgba(0, 0, 0, 0.05)backgrounds.
- Dark Mode:
- Use Zustand for global application state (e.g.,
useNetworkStorein Network Editor). - Use React Context for app-wide settings like Theme (
ColorModeContext).
The Network Editor uses iOS-style input pages for deferred commit (values only update the store on Enter or navigation back):
| Component | Use Case | Deferred Commit |
|---|---|---|
IOSQuantityPage |
Numbers with or without units | ✅ Yes |
IOSTextInputPage |
Text input | ✅ Yes |
IOSPickerPage |
Selection from list | Commits on select |
Behavior:
- Enter → Commits value, navigates back
- Escape → Reverts to original value, navigates back (no commit)
Required Props: All deferred-commit inputs MUST have:
onBack={() => navigator.pop()} // or nav.pop() in render functionsDO NOT use IOSNumberInputPage for new code - use IOSQuantityPage with empty units instead.
Pipe Direction & Propagation:
- Forward: Fluid flows from Start Node → End Node. The pressure of the End Node is calculated based on the Start Node.
- Backward: Fluid flows from Start Node -> End Node. But the pressure at the Start node is calculated based on the End Node.
- The physics engine uses the defined direction to calculate pressure drops (including elevation signs).
- Propagation:
- Forward: Target uses pipe
OutletState. - Backward: Target uses pipe
InletState. - Direction is handled natively without creating proxy pipes.
- Forward: Target uses pipe
- Create a new branch for your feature or fix.
- Implement your changes, following the coding standards.
- Run
bun run buildto ensure no TypeScript or build errors. - Submit a Pull Request.
- Hydration Errors: If you see hydration mismatch errors, check for browser extensions injecting code. We use
suppressHydrationWarninginlayout.tsxto mitigate this. - Type Errors: If you encounter type mismatches between packages, ensure you have rebuilt the packages or that the types are correctly exported and imported.
- Docker Issues: Use
infra/docker-compose.ymlfor running services locally