Yard StudioJamaica-first · scam-skeptical
Back to YardTrade

YardTrade — technical spec

Binding law: `../../JAMAICA_TRUST.md`

Stack. Next.js PWA, TypeScript, Postgres, object storage for photos/audio, WhatsApp Cloud API, SMS/WhatsApp OTP. No consumer wallet.

Shared with the other flagship. YardTrade and LoadYard are two skins. Same listings, bids, provider_wallets, OTP, ratings. This skin filters kind = services. See `../../ENGINE.md`.

Architecture

[PWA] → [BFF] → listings / matching / ratings / OTP → WhatsApp Cloud (receipts, disputes) → object storage (photos, short audio) → provider ledger (prepaid lead balance — provider money only) [OCR / whisper] optional, never blocking

  • Browse is public. Auth is phone OTP.
  • Matching is automated. No dispatch office.
  • Get three named prices for this photographed skill job.

Core APIs

MethodPathJob
GET/api/yardtrade/browsePublic inventory or board — no login
POST/api/yardtrade/otp/startPhone OTP
POST/api/yardtrade/otp/verifySession cookie
POST/api/yardtrade/lead/acceptDeduct provider lead fee
POST/api/yardtrade/completeTwo-way rating unlock
POST/api/yardtrade/wa-exportImage/PDF for WhatsApp
GET/api/yardtrade/exportDPA zip
DELETE/api/yardtrade/accountDelete

Data model (sketch)

  • users — phone, role (seeker / provider), OTP verified_at
  • yardtrade_listings — public fields only
  • yardtrade_leads — provider_id, seeker_id, fee_jmd, status
  • ratings — two-way, job_id
  • provider_wallets — prepaid provider balance for lead fees (not household escrow)
  • id_checks — licence/TRN photo, reviewer, status
  • audit_events — append-only

Security

  • OTP rate limits. No password store.
  • ID photos encrypted at rest; 90-day review then delete unless dispute hold.
  • PII scoped. No sale. No JPS/NWC/bank credential fields exist.
  • Provider wallet is a simple debit ledger. Top-up is Lynk/card to our company account with a receipt — same as buying airtime for ads.
  • Payee on every card is the trade, mechanic, or kit owner on the quote.

Scalability

Parish shards on listing tables. Media on object storage. WhatsApp send queue. Read replicas for browse.

Offline / PWA

Photo or pin first. Category filter. Quotes cache. OTP after the first price. WhatsApp share of the strip. Same shell as LoadYard.

Service worker caches last browse payload. Writes queue when FLOW/Digicel drops. Shell under 150 KB gzipped.

What we will not build

Custodial household wallets. Escrow. “Pay the job here.” Blockchain settlement. Call-centre IVR.