Skip to main content

Legacy & Deprecated

This page collects everything in the codebase that is no longer used, in one place, so nobody wastes time on it. Each item is tagged.

TagMeaning
🔴 DeadEmpty or never referenced. Safe to delete.
🟠 OrphanedHas real code but nothing imports it. Confirm, then delete.
🟡 SupersededStill works, but a newer replacement exists.
⚠️ Anomaly / debtNot "legacy" exactly, but confusing or unfinished.
Scope

This is a documentation snapshot, not a change to the code. Nothing here has been removed from the repo — this page just records the current state so it can be cleaned up deliberately later.


Libraries

🔴 legacyReports — dead

libs/legacyReports/ contains only empty folders — zero files, no project.json, no import alias. Nothing references it. It is the pre-v1 reports remnant. Safe to delete.

🟠 aquagpt — orphaned (superseded by aquaAi)

libs/aquagpt/ (the GPT chat assistant) has real code, but it is only aliased — in every app's rspack.config.js and in tsconfig.base.json — and is never imported by any route or component. The active AI assistant is aquaAi (ecogpt; see the naming note below), which all five apps actually import.

🟠 demoAquaGpt — orphaned

libs/demoAquaGpt/ is a mock/dummy-data version of the GPT chat. No app's routes or components import it (the demo build still declares an alias for it, like aquagpt).

🟠 waterRisk — orphaned

libs/waterRisk/ is one of the four sustainability-index libraries, but it is only self-referenced — it is not in any app's route table. It is not wired up anywhere.

🟠 uilib — orphaned (Nx stub)

libs/uilib/ is a placeholder generated by Nx (lib/uilib.js + a CSS module). It has no real imports; the only references are alias declarations. The real UI library is components.

🔴 pricing and wri — dead import aliases

tsconfig.base.json declares two aliases that point at folders that do not exist:

  • @aquagen-mf-webapp/pricinglibs/pricing/* (no such folder)
  • @aquagen-mf-webapp/wri/*libs/wri/* (no such folder)

No source file imports either. They are stale alias entries.

reports (v1) is NOT legacy

It is tempting to assume the older reports library is dead now that reportsV2 exists, but reports v1 is still actively used by AquaRecycle, Lakepulse, and AquaRain. reportsV2 is used by AquaGen and the demo. The two coexist by app tier. Consolidating them is a future cleanup, not something that has happened. See Architecture → Libraries.


Dead build config

🔴 rspack.config.prod.js (all five apps)

Every app has a rspack.config.prod.js that uncomments the Module Federation plugin (though its remotes list is still empty). It is never used — Nx only reads rspack.config.js, and nothing in the repo points at the .prod.js variant. See Module Federation Status.

🟡 Module Federation config — inert

module-federation.config.js exists in each app but the plugin is commented out in the active config, and every remotes list is empty. Details in Module Federation Status.


Legacy app patterns

🟡 Legacy startup pattern — production, demo

Both still use the old double-nested AppStoreContextProvider (declared in both bootstrap.jsx and app.jsx). It works, but the current pattern (used by uwms and lakepulse) is cleaner. See Standalone Apps → How the pattern evolved.

⚠️ rwi — half-migrated

AquaRain's bootstrap.jsx uses the current pattern but its app.jsx still declares old provider wiring — unfinished migration work. See Standalone Apps → AquaRain is half-migrated.

⚠️ Per-app clone leftovers

npm run create:app clones production, which leaves two kinds of cruft in each cloned app:

  • Broken NODE_ENV guard. demo, uwms, lakepulse, and rwi gate production optimizations on process.env.NODE_ENV === '<appname>' (e.g. === 'uwms'). NODE_ENV is only ever production/development, so for these four apps the production optimizations and output hashing never turn on. Only production uses the correct === 'production' check.
  • Carried-over library aliases. Standalone apps list aliases for libraries they never route to (for example, uwms aliases scadaEditor, scadaViewer, hmi, ilm but uses none of them).

⚠️ main.jsx async boundary

Every app's src/main.jsx is import('./bootstrap') — an async import kept from the Module Federation setup, even though it is no longer needed. Harmless, but not meaningful today.


CI and tooling

🔴 production_aquagen_old.yml.disabled — legacy CI workflow

The old two-job (build → upload artifact → deploy) GitHub Actions workflow. Disabled via its file extension (GitHub only runs *.yml). The active workflow (production_aquagen.yml) replaced it with a single job and a newer deploy action. See Deployment & Environments.

🟠 @nx/azure-cache — installed but unused

The package is in devDependencies and installed, but there is no tasksRunnerOptions or plugin config wiring it in. The active remote cache is Nx Cloud (nxCloudId in nx.json). The Azure cache backend is vestigial.

🔴 Missing ci.yml reference

nx.json lists .github/workflows/ci.yml as a shared input, but that file does not exist. Stale reference.


Deployment anomalies

Covered in detail in Deployment & Environments → Known anomalies:

  • demotest8 swap — the demo build is served by test8; the demo target serves production.
  • rwi defined twice in firebase.json (both point at dist/apps/rwi).

Naming oddities (not legacy, but confusing)

These are worth knowing so the code doesn't surprise you. Full detail in Architecture → Libraries.

You seeIt actually is
aquaAi library, project name ecogptThe current, active AI assistant
rwi library, project name rwi-libThe Rainwater Index feature
waterRatio library, project name waterUsageWater usage ratio
uwms appThe AquaRecycle product
@aquagen-mf-webapp/ scope"mf" = Module Federation, which is no longer used

Cleanup summary

If someone does a cleanup pass, this is the shortlist:

ItemTagAction
libs/legacyReports🔴Delete (empty)
pricing / wri aliases in tsconfig.base.json🔴Delete
Missing ci.yml reference in nx.json🔴Remove reference
production_aquagen_old.yml.disabled🔴Delete
rspack.config.prod.js (×5)🔴Delete or wire up intentionally
libs/aquagpt, libs/demoAquaGpt, libs/waterRisk, libs/uilib🟠Confirm unused, then delete
@nx/azure-cache dependency🟠Remove if not adopting it
rwi double entry in firebase.json⚠️De-duplicate
Broken NODE_ENV guards (×4 apps)⚠️Fix so optimizations turn on
rwi half-migration⚠️Trim app.jsx to routes-only
Legacy pattern in production/demo🟡Migrate when convenient