Add mobile app, map-core, nearby sync, and activity recording specs

mobile-app: Unified React Native + Expo app combining Planner and
Journal. OAuth2 PKCE auth, MapLibre maps, versioned REST API with
Zod schemas, configurable server URL, offline SQLite, Web Push relay
notifications. TanStack Query + Zustand state management. Jest +
Maestro testing. 76 tasks across 5 phases.

map-core-package: Extract renderer-agnostic map definitions (tiles,
color palettes, POI categories, z-index) into @trails-cool/map-core.
Pure refactor preparing for MapLibre on mobile. 27 tasks.

mobile-activity-recording: GPS recording, live stats, HealthKit/Health
Connect export. Separated from mobile-app for independent scheduling.

mobile-nearby-sync: BLE route sync between nearby devices for offline
group riding. QR waypoint sharing as simpler v1. TXQR noted as future.

journal-rest-api spec: Full API contract — endpoints, auth, pagination,
errors, discovery, versioning, BRouter proxy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-04-12 21:52:30 +02:00
parent e288630a12
commit fff77a2ed2
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
23 changed files with 996 additions and 0 deletions

View file

@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-04-12

View file

@ -0,0 +1,22 @@
## Why
The mobile app (when built) will show routes and allow editing, but won't record activities. Users want to track their rides/hikes with GPS, see live stats, and save recordings as Journal activities. This is a separate feature that depends on the mobile app foundation being in place first.
## What Changes
- GPS track recording via expo-location (foreground + background)
- Live stats overlay (distance, duration, speed, elevation gain)
- Save recorded track as GPX → Journal activity linked to the active route
- HealthKit (iOS) / Health Connect (Android) export
- Discard/pause/resume recording flow
## Capabilities
### New Capabilities
- `mobile-activity-recording`: GPS recording, live stats, save as activity, health platform export
## Impact
- Depends on `mobile-app` change being implemented first
- New dependencies: expo-location, expo-health
- Background location permissions needed (App Store privacy review)

View file

@ -0,0 +1,45 @@
## ADDED Requirements
### Requirement: GPS track recording
The system SHALL record GPS tracks using the device's location services, supporting foreground and background recording.
#### Scenario: Start recording
- **WHEN** the user taps "Start Recording" from a route's map view
- **THEN** GPS tracking begins, the live stats overlay is shown, and track points are stored locally
#### Scenario: Background recording
- **WHEN** the user switches to another app or locks the screen during recording
- **THEN** GPS tracking continues in the background and track points are still recorded
#### Scenario: Stop recording
- **WHEN** the user taps "Stop Recording"
- **THEN** recording ends, track points are converted to GPX, and the user is prompted to save
### Requirement: Live stats display
The system SHALL show real-time statistics during an active recording.
#### Scenario: Stats overlay
- **WHEN** a recording is in progress
- **THEN** the screen displays: elapsed duration, distance covered, current speed, and elevation gain
### Requirement: Save as Journal activity
The system SHALL save completed recordings as activities on the user's Journal, linked to the active route.
#### Scenario: Save recording
- **WHEN** the user confirms saving after stopping a recording
- **THEN** the GPX track is uploaded to the Journal API as a new activity linked to the route, with distance, duration, and startedAt
#### Scenario: Discard recording
- **WHEN** the user discards a recording
- **THEN** the track data is deleted locally and no activity is created
### Requirement: HealthKit and Health Connect export
The system SHALL export recorded activities to Apple HealthKit (iOS) and Health Connect (Android).
#### Scenario: Export to health platform
- **WHEN** the user saves a recording and has granted health permissions
- **THEN** the activity (distance, duration, route, elevation) is written to HealthKit or Health Connect
#### Scenario: Health permissions not granted
- **WHEN** the user has not granted health permissions
- **THEN** the activity is saved to Journal without health export, and the user can grant permissions later from Profile