Sync Repo-docs-06-offline-strategy from project files

2026-07-06 14:42:16 +02:00
parent 851e7d7bba
commit f49a5f2015

@@ -0,0 +1,96 @@
<!-- codex-wiki-sync:e26c4990142ce1acc4667bf0 -->
> Mirrored from `/mnt/DATA/git/pikebacker/docs/06_offline_strategy.md`.
> Origin: `repository`.
> Active tasks and changing state belong in Gitea issues; this wiki page is durable project context.
---
# Offline Strategy
## Offline requirement
Offline use must cover riding-critical information, not only maps.
## Offline pack contents
A trip offline pack should include:
- route geometry,
- route alternatives,
- daily stages,
- elevation profile,
- selected vector/raster map area,
- route-corridor POIs,
- emergency/bailout POIs,
- local rule cards,
- cached weather forecast at departure,
- saved bookings/deep links/addresses,
- user notes,
- GPX/TCX/FIT exports,
- report queue for later upload.
## Pack scope
Use a corridor-based pack:
```text
primary corridor: 5 km on either side of route
logistics corridor: 20 km around stage endpoints and bailout towns
map context: bounding box with simplification by zoom level
```
## Offline modes
### MVP offline mode
- Download planned route, POIs, stage plan, rules, and GPX.
- Allow map viewing if tile pack is present.
- Allow report capture and sync later.
- Allow basic distance-to-next-critical-thing calculation from cached data.
### Production offline mode
- Offline rerouting using a compact regional routing graph.
- Offline POI search.
- Offline rule lookup.
- Offline elevation sampling.
- Offline exports.
## Storage model
Mobile app storage:
- SQLite for structured trip data and POIs.
- File storage for tile packs and exports.
- Key-value storage for user preferences and sync state.
## Pack versioning
Each offline pack should include:
```json
{
"pack_id": "pack_123",
"trip_id": "trip_123",
"created_at": "2026-06-30T00:00:00Z",
"data_versions": {
"osm_extract": "geofabrik-europe-germany-2026-06-29",
"poi_index": "2026-06-29",
"rules": "2026-06-01",
"weather_cached_at": "2026-06-30T06:00:00Z"
},
"bbox": [6.0, 47.0, 15.0, 55.0],
"route_buffer_km": 5,
"expires_at": "2026-07-14T00:00:00Z"
}
```
## User-facing warnings
Before departure, show:
- which items are available offline,
- which items are stale,
- which route sections lack cached POIs,
- whether offline rerouting is available,
- which exports are saved.