Skip to content

[TD-01] Migrate asset metadata from localStorage to Supabase #1

Description

@licette32

Problem

The name, location, and type of each asset are stored in localStorage with the key medovant_asset_names (see app/src/utils/assetNames.ts).

If the user changes browser, clears the cache, or opens the app from another device, they lose all metadata of their assets. The data is also not shareable between users of the same institution.

Impact

Critical for real-world use. A hospital with multiple users cannot share the inventory.

Plan

  1. Create assets table in Supabase with fields: asset_pda, hospital, name, location, asset_type, created_at
  2. Replace reads/writes of assetNames.ts with Supabase API calls
  3. The on-chain Asset PDA remains the source of truth for the state; the DB adds descriptive metadata

Affected files

  • app/src/utils/assetNames.ts
  • Components that call getAssetName() and setAssetName()

Milestone: v1.1 — Week 3 of incubation

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions