karura-trails
tigawanna/karura-trails
Forest trail maps, field marker capture, and an admin sync hub for Karura Forest.
- expo
- op-sqlite
- pglite
- react-native
- spatialite
- tanstack-start
tigawanna/karura-trails
Forest trail maps, field marker capture, and an admin sync hub for Karura Forest.
Forest trail maps, field marker capture, and an admin sync hub for Karura Forest.
App | Stack | Purpose |
|---|---|---|
mobile | Expo, MapLibre, SpatiaLite | Offline maps, navigation, marker edits in the field |
web | TanStack Start, Cloudflare Workers, D1 | Landing page, admin dashboard, auth, sync API |
Architecture detail: ARCHITECTURE.md
1apps/2 mobile/ Expo app (primary product)3 web/ TanStack Start on Cloudflare Workers4packages/ Shared TS / ESLint configs
Managed with pnpm workspaces and Turborepo.
1pnpm install
1cd apps/web2cp .env.example .env3cp .dev.vars.example .dev.vars # edit secrets — see ARCHITECTURE.md4pnpm db:migrate:local5pnpm dev # http://localhost:3050
Sign up at /auth/signup with the email matching ADMIN_EMAIL in .dev.vars to access /dashboard.
1cd apps/mobile2pnpm dev # Expo dev server3# or4pnpm run:android5pnpm run:ios
See apps/mobile/GAMEPLAN.md for schema, routing, and build profiles.
1pnpm dev2pnpm build3pnpm check-types
Filter to one app:
1pnpm dev --filter=web2pnpm dev --filter=mobile
Two files in apps/web:
File | Scope |
|---|---|
| Vite client ( |
| Worker secrets (auth, CORS, sync secret, Google OAuth) |
Full variable list: ARCHITECTURE.md — Environment
1cd apps/web2# 1. Set real database_id in wrangler.jsonc (wrangler d1 create karura-trails-db)3# 2. wrangler secret put BETTER_AUTH_SECRET (and other secrets)4pnpm db:migrate:remote5pnpm deploy
Mobile clients (or curl) can push events:
1curl -X POST http://localhost:3050/api/sync/events \2 -H "Content-Type: application/json" \3 -H "x-sync-secret: local-dev-sync-secret" \4 -d '{"deviceId":"test","events":[{"id":"01932f8a-7c3a-7000-8000-000000000001","deviceId":"test","table":"points","rowId":"42","action":"create","payload":{},"createdAt":"2026-06-08T12:00:00.000Z"}]}'
Admins verify events at /events. Verified events are returned on GET /api/sync/events.
Protocol: apps/mobile/docs/EVENT-SYNC-PLAN.md
1pnpm lint2pnpm format3pnpm quality # lint + format check4pnpm quality:fix
See per-app license files where applicable (apps/mobile/LICENSE).