A sideloaded Android app (Capacitor) for merchant field visits, synced with FreeHub, FREE Madeira's Nostr CRM. It reads the Merchants table from the team relay, shows each business's visit heat (days since the team's last visit), and publishes visits and new merchants as FreeHub events.
- Relay:
wss://relay.freemadeira.org/private(Haven private relay, NIP-42 AUTH + whitelist). The whitelist is the access control: no merchant data ships in the app. - Reads: the project's Merchants CRM table (kind 30305), its records (30306), and
activity: visitcomments (1111) for heat. The table is recognised as a merchant-named table with a Journey stage and a Location field. Any slug starting withmerchantis the fallback. - Writes: a visit comment on Check in & save, plus the record republished whole when the visit changes its Journey, follow-up flag or location; and a new record on Add merchant. These are the same shapes FreeHub produces.
- Locations and FreeHub's map: coordinates live only in the Location field
(FreeHub's
lat,lngformat), which is also what FreeHub's map pins. New merchants and locations filled in during a visit (📍 Use my position here, shown only when a merchant has none) are written there. - Signing: Amber on the phone (NIP-55), with no relays involved in signing. NIP-07 / NIP-46 work in a browser.
- Offline: the last list is cached, and signed events wait in an outbox until a relay accepts them.
pnpm install
pnpm dev # browser version (NIP-07 / NIP-46)
pnpm apk # build the APK and install it on the phone (USB or wireless adb)
pnpm sync # pull work photos/videos (Pictures/FREE Madeira/) to data/field-sync/media
pnpm freehub-csv # one-time: data/merchant_map.csv (+ FM24 sheet) → data/field-sync/freehub-merchants.csv for FreeHub's importPhotos and videos taken from a visit go to Pictures/FREE Madeira/<date>_<merchant>/ on
the phone, their own album separate from the camera roll. FreeHub has no attachments yet,
so they come to the PC with pnpm sync.
Real merchant data is never in this repo. The scripts read it from data/ (gitignored), a
folder or a link to one, holding merchant_map.csv, the FM24 spreadsheet and
field-sync/.