{"slug":"developers/04_EXISTING_COMPONENT_INVENTORY_AND_REUSE_MAP","title":"04 — Existing Component Inventory and Reuse Map","section":"developers","sectionLabel":"Developers","status":"unclassified","type":"document","path":"developers/04_EXISTING_COMPONENT_INVENTORY_AND_REUSE_MAP.mdx","bytes":3187,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\n## Objective\n\nReuse valid existing frontend components before creating new ones. The implementation must inspect the repository and classify components instead of replacing department workspaces with generic templates.\n\n## Required inventory roots\n\n```text\napps/web/src/components/activation\napps/web/src/components/l1/domains/*/views\napps/web/src/components/l1/workspace\napps/web/src/components/l1/navigation\napps/web/src/components/l1/workbench\napps/web/src/components/connectivity\napps/web/src/components/governance\napps/web/src/components/intelligence\napps/web/src/components/_deprecated\n```\n\n## Classification\n\n| Classification | Meaning                                                                |\n| -------------- | ---------------------------------------------------------------------- |\n| Keep           | Component and data boundary are already suitable                       |\n| Adapt          | UI is useful but routing, state, or data source must change            |\n| Move           | Useful component is under a deprecated or incorrect path               |\n| Merge          | Multiple components implement the same user surface                    |\n| Retire         | Component encodes an obsolete product, runtime, or provider assumption |\n| Missing        | No reusable implementation exists                                      |\n\n## Inventory record\n\n```ts\nexport interface ComponentInventoryRecord {\n  path: string;\n  exportedName: string;\n  domain: string;\n  viewId: string;\n  routeCandidate: string;\n  classification: \"keep\" | \"adapt\" | \"move\" | \"merge\" | \"retire\" | \"missing\";\n  localInteractions: string[];\n  dependencies: string[];\n  notes?: string;\n}\n```\n\n## Department views\n\nEvery component under `apps/web/src/components/l1/domains/*/views` must be recorded with:\n\n- Department\n- View label\n- Route\n- Required permissions\n- Applicable industries\n- Existing filters\n- Existing cards, tables, charts, drawers, and actions\n- Missing local interactions\n- Twin opportunity points\n\n## Account Success requirement\n\nThe Account Success inventory is the first required mapping. All valid views in `apps/web/src/components/l1/domains/account-success/views` must be included in the Work registry. A generic Account Success lens does not replace these views.\n\n## Template reuse rule\n\nExternal template categories may provide interaction and layout patterns for authentication, dashboards, agents, AI workspaces, inboxes, marketplaces, tables, and responsive layouts. They must not replace repository-native domain views or introduce a second design system.\n\n## Provider boundary review\n\nFlag any frontend component that directly imports or calls:\n\n- Supabase or database clients\n- Redis, KV, or object storage SDKs\n- Nango or provider SDKs\n- Descope management APIs\n- MCP runtime clients\n- Model provider clients\n- Firebase\n\nThese components must be adapted to local frontend contracts for the v0 UI increment.\n\n## Deliverable\n\nThe implementation report must include a table of inventoried components, classifications, final routes, and whether each was reused, moved, adapted, merged, retired, or newly created.\n"}