Skip to content

feat: convert instructions audio into a Trip experience served by the Experiences API - #310

Merged
masch merged 8 commits into
mainfrom
feat/instructions-as-trip
Jul 19, 2026
Merged

feat: convert instructions audio into a Trip experience served by the Experiences API#310
masch merged 8 commits into
mainfrom
feat/instructions-as-trip

Conversation

@masch

@masch masch commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Closes #309

Summary

  • Convierte el audio de instrucciones (instrucciones.mp3) en un Trip first-class servido por la Experiences API
  • Nuevo bucket R2 público (sonora-public-audio-staging) para contenido gratuito, sin auth
  • Nueva ruta GET /audio/public/:key en la API
  • Hook useInstructionsAudio con resolución API + fallback
  • Flag showHomeInstructions en remote config controla visibilidad en home
  • Elimina el bypass de CLIENT_API_KEY en /audio/stream

Changes

File Change
packages/shared/src/experiences.ts Add constants + image key
packages/shared/src/locales/en.ts Add onboarding label
packages/shared/src/locales/es.ts Add onboarding label
packages/shared/src/schemas/config.ts Add showHomeInstructions flag
apps/api/src/db/seed.ts Add onboarding theme + instructions trip + waypoint
apps/api/src/routes/audio.ts Add /audio/public/:key route, remove client key bypass
apps/api/src/index.ts Add PUBLIC_BUCKET to Env
apps/api/wrangler.staging.toml Add PUBLIC_BUCKET binding
apps/api/wrangler.toml Add PUBLIC_BUCKET binding
apps/mobile/src/hooks/use-instructions-audio.ts CREATE — new hook
apps/mobile/src/components/home-audio-player.tsx Use useInstructionsAudio hook
apps/mobile/src/config/app-config.ts Update fallback URL to /audio/public/...
apps/mobile/src/data/experiences.ts Re-export new constants
apps/mobile/src/constants/images.ts Add trip-instructions-cover mapping
apps/mobile/src/store/remote-config-store.ts Add showHomeInstructions to initial config
apps/mobile/src/app/(tabs)/index.tsx Conditional render HomeAudioPlayer
apps/mobile/src/components/track-map.tsx DELETE — unused
Makefile Add public bucket targets

Test Plan

  • make test-front — 480 passed
  • make test-back — 183 passed
  • make test-shared — 96 passed

masch added 8 commits July 17, 2026 23:09
…lidation on staging

- Look up purchases by external_reference (our purchase UUID) instead of
  mismatched MP payment/preference IDs — fixes 'Payment not found' error
- Made externalReference required in WebhookResult interface
- Enable MP signature validation on staging (MP_BYPASS_SIGNATURE = false)

Closes #307
…t endpoints

   back_urls now always point to the API's HTTPS origin so Mercado
   Pago auto_return works with any redirect URL scheme (deep link,
   web, etc.). The original redirect URL is stored in purchase
   metadata, and new GET /payments/return/:status/:purchaseId
   endpoints 302 the browser back to the app's deep link.

   Also includes:
   - refactor(cors): simplify configureCors wrapper — reads all
     env vars from c.env per request, uses Hono's cors() natively
   - refactor(audio): extract shared streaming helpers
   - chore: bucket binding rename BUCKET -> PRIVATE_BUCKET

@masch masch left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥦

@masch
masch merged commit e73c9e8 into main Jul 19, 2026
14 checks passed
@masch
masch deleted the feat/instructions-as-trip branch July 19, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: convert instructions audio into a Trip experience served by the Experiences API

1 participant