You can run the CDA GUI on your local system without tomcat.
- Install
NodeJS
cd gda-guinpm install(NodeJS Required)npm run dev- Open https://localhost:5173/cwms-data
Changes will now be hot reloaded in the browser as you update your React files.
- 🚧 WIP
-
Add a new directory to
cda-gui/src/my-page/ -
Create an
index.jsxin the new directory -
Create a component function along the lines of:
export default function MyPage() { return <div>Example Page</div>; }
You can view current page examples here - /cda-guid/src/pages
-
Add the new path/component to the client-side routing:
-
Open main.jsx in /cda-gui/src
-
Import your new component (top of file) with:
import MyPage from "./pages/my-page";
-
Add a new Object to the
childrenofcreateBrowserRouter// Make sure to import MyPage at the top! { path: "my-page", element: <MyPage /> },
-
-
Update cda-gui/src/links/header-links.js to include your new route.
The common structure of a given url is:{ id: "tools", text: "Tools", href: "tools", children: { id: "my-page", text: "My Page", href: "/my-page" } }
The
childrenkey is optional, only if you want an additional dropdown from the menu.
(Groundwork supports nesting 2 deep!)
CWMS Data API GUI makes use of the Groundwork, a React library to add stylized USACE themed components.
For Water Management components it uses Groundwork-Water, a React component library that uses CWMSjs to wrap CDA calls.
CDA has 4 primary environments. Each of these environments targets what the GUI will use when deployed.
The environments each have their own file:
| Environment | File Name | Host |
|---|---|---|
| Local | .env.local | System |
| Development | .env.development | Cloud |
| Test | .env.test | Cloud |
| Production | .env.production | Cloud |
Where the .env.local file is not typically committed!