Phone App

React Native + Expo, TypeScript, expo-router. 17 custom hooks, 3 tab screens, context-driven walk sessions.

Screens

Three main tabs plus modal screens for walk mode and quest detail.

Home (index)

Quest deck, compass ring, location prompt. Entry point for starting a walk or browsing quests.

Walk

Active walk mode: compass navigation, snap camera, quest progress bar, map with POI pins.

Diary (LOG)

Walk history, snap gallery, and sub-tabs: QUESTS (quest log), BADGES (earned badges), PROFILE (taste notes + stats).

Custom Hooks

17 hooks in hooks/. Each encapsulates one concern.

HookPurpose
useLocationGPS tracking with foreground/background permissions and distance accumulation
useSnapCamera capture flow + AI validation for wander/collect quests. Compresses, uploads, and validates against quest detection themes.
useQuestQuest lifecycle: accept, track progress, complete, abandon. Manages active quest state.
useQuestLogFetch and display completed/abandoned quest history for the LOG tab
useQuestProximity80m auto-check for visit quest locations via GPS proximity
usePOIsFetch and filter 372 curated POIs for map pins and quest targets
useProximityAlertHaptic + visual alert when user walks near a POI or quest location
useWalkTrackerWalk session state: start/end, distance, duration, route polyline recording
useMapCameraMap camera position, zoom, and follow-user behaviour
useWeatherCurrent weather for quest generation context and weather-aware nudges
useDiaryWalk diary data fetching for the LOG tab
useBadgesBadge state: earned badges, progress toward next badge, celebration triggers
useBloomDataSeasonal bloom data for Barcelona trees and flowers. Fetches bloom spots and provides local bloom images by species.
usePublicMapPublic discovery map: fetch public snaps, publish/unpublish, bookmark
useUploadQueueOffline-resilient photo upload queue with retry logic
useWatchSyncApple Watch connectivity: sync compass bearing, walk state, and haptic triggers
useNotificationsPush notification registration, permission handling, and token management

Context

WalkContext

Shared walk session state across all screens. Provides: active walk ID, quest data, snap count, distance, duration, compass bearing, and walk status (idle / walking / paused). Used by walk screen, quest bar, and diary.

Utilities

FilePurpose
utils/compress.tsPhoto compression before upload (reduces file size for mobile upload)
utils/geo.tsHaversine distance, bearing calculation, coordinate helpers
utils/time.tsTime-of-day detection, duration formatting, date helpers
utils/deviceId.tsPersistent device UUID (AsyncStorage) used as user_id

Config

FilePurpose
config/theme.tsPalette tokens (charcoal, coral, sage, mustard, cream), typography, shadow definitions. Single source of truth for all colours.
config/api.tsAPI base URL and endpoint path constants
config/mapStyle.jsonCustom Google Maps style (muted palette matching the app theme)

Client-Side API Wrappers

Files in api/ wrap fetch calls to the backend. Each file corresponds to a domain (quests, photos, taste, etc.) and handles request building, error handling, and response parsing.