API Reference

Next.js App Router on Vercel. 45+ endpoints powering quests, snaps, taste memory, notifications, and the public discovery map.

Quest Generation

Endpoints that produce the quest deck: live events, daily picks, tailored recommendations, local LLM quests for non-Barcelona cities, and the chat game master.

MethodEndpointPurpose
GET/api/quests/liveLive event quest (time-sensitive, one per city)
GET/api/quests/dailyDaily quest deck from curated library (Barcelona)
GET/api/quests/tailoredTaste-memory-personalised quest for a user
GET/api/quests/localLLM-generated quests for non-Barcelona cities
POST/api/quests/chatConversational game master (custom quest via chat)

Quest Lifecycle

Accept, track progress, validate snaps, complete, or abandon a quest.

MethodEndpointPurpose
POST/api/quest/acceptAccept a quest (creates user_quests row)
GET/api/quest/activeFetch user's currently active quest
GET/api/quest/progressCurrent snap/visit progress for active quest
POST/api/quest/validate-snapAI validates a snap against quest theme
POST/api/quest/completeMark quest as complete (awards XP + badge check)
POST/api/quest/abandonAbandon active quest

Daily Community Quest

One community-wide quest per day. Separate from the personal quest deck.

MethodEndpointPurpose
GET/api/daily-questGet today's daily community quest
POST/api/daily-quest/acceptAccept the daily quest
POST/api/daily-quest/completeClaim daily quest completion
GET/api/daily-quest/feedPublic feed of daily quest snaps

Photos + Snaps

Upload, classify, and query walk photos. AI classifies themes for collection badge progress.

MethodEndpointPurpose
POST/api/photos/uploadUpload a snap photo (compressed, with location)
GET/api/photos/theme-countsCumulative theme counts for collection badges

Public Discovery Map

Community snap map: publish, browse, bookmark, and unpublish snaps.

MethodEndpointPurpose
GET/api/public-mapFetch public snaps within map bounds
POST/api/public-map/publishPublish a snap to the public map
POST/api/public-map/unpublishRemove a snap from the public map
POST/api/public-map/saveBookmark a public snap
POST/api/public-map/unsaveRemove bookmark
GET/api/public-map/savedFetch user's saved/bookmarked snaps

Collection Map

Shareable collection quest photo maps (public link via token).

MethodEndpointPurpose
POST/api/collection-map/shareCreate a shareable collection map link
GET/api/collection-map/[token]Public view of a shared collection
GET/api/collection-map/photosFetch photos for a collection theme

Taste Memory

User taste profile: seed from onboarding, update from walk behaviour, query for personalisation.

MethodEndpointPurpose
POST/api/taste/seedSeed initial taste profile from onboarding answers
GET/api/taste/profileFetch user's current taste profile
POST/api/taste/batch-updateBatch update taste dimensions from walk data

Wander

Free-form wandering: direction generation and bloom data for the compass ring.

MethodEndpointPurpose
GET/api/wanderGenerate a wander direction + vibe
GET/api/wander/bloomBloom ring data (nearby POI density)

Places + POIs

Google Places integration for POI details, photos, and autocomplete.

MethodEndpointPurpose
GET/api/place-detailFetch Google Place details by place_id
GET/api/place-photoProxy a Google Place photo
GET/api/poi-photoSingle POI photo lookup
GET/api/poi-photosBatch POI photos for map pins
GET/api/autocompleteGoogle Places autocomplete suggestions
GET/api/autocomplete/geocodeGeocode a place prediction to lat/lng

Diary + Sharing

Walk history and social sharing.

MethodEndpointPurpose
GET/api/diaryFetch user's walk diary (completed walks + snaps)
POST/api/shareGenerate a shareable walk summary image

Routing

Walking route generation for visit quests.

MethodEndpointPurpose
GET/api/routeWalking route between quest stops (Google Directions)

Notifications

Push notification registration, preferences, and cron-triggered nudge endpoints.

MethodEndpointPurpose
POST/api/notifications/registerRegister a push token (Expo push)
POST/api/notifications/preferencesUpdate notification settings
POST/api/notifications/heartbeatApp open heartbeat (updates activity log)
GET/api/notifications/streak-nudgeCron: streak reminder for active walkers
GET/api/notifications/comeback-nudgeCron: re-engagement nudge for inactive users
GET/api/notifications/quest-reminderCron: remind users of accepted but incomplete quests
GET/api/notifications/weather-windowCron: good weather walking nudge
GET/api/notifications/live-eventCron: notify users of new live events

Maintenance

MethodEndpointPurpose
GET/api/cleanupCron: expire old walks, prune orphaned data

Deprecated

Legacy endpoints kept for backwards compatibility. Do not use in new code.

MethodEndpointPurpose
POST/api/destination-resolve(deprecated) Resolve a destination string to coordinates
POST/api/vibe-extract(deprecated) Extract vibe keywords from free text
POST/api/suggest(deprecated) Early quest suggestion endpoint