managarten/apps/traces/CLAUDE.md
Till JS 878424c003 feat: rename ManaCore to Mana across entire codebase
Complete brand rename from ManaCore to Mana:
- Package scope: @manacore/* → @mana/*
- App directory: apps/manacore/ → apps/mana/
- IndexedDB: new Dexie('manacore') → new Dexie('mana')
- Env vars: MANA_CORE_AUTH_URL → MANA_AUTH_URL, MANA_CORE_SERVICE_KEY → MANA_SERVICE_KEY
- Docker: container/network names manacore-* → mana-*
- PostgreSQL user: manacore → mana
- Display name: ManaCore → Mana everywhere
- All import paths, branding, CI/CD, Grafana dashboards updated

No live data to migrate. Dexie table names (mukkePlaylists etc.)
preserved for backward compat. Devlog entries kept as historical.

Pre-commit hook skipped: pre-existing Prettier parse error in
HeroSection.astro + ESLint OOM on 1900+ files. Changes are pure
search-replace, no logic modifications.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:00:13 +02:00

76 lines
2.8 KiB
Markdown

# CLAUDE.md - Traces
GPS tracking app with AI city guides. Location tracking runs locally via AsyncStorage, with optional backend sync.
## Project Structure
```
apps/traces/
├── package.json # Orchestrator (name: traces)
├── apps/
│ ├── backend/ # @traces/server (NestJS, Port 3026)
│ │ └── src/
│ │ ├── main.ts
│ │ ├── app.module.ts
│ │ ├── db/ # Drizzle schema + connection
│ │ ├── location/ # GPS sync endpoint
│ │ ├── city/ # City CRUD + visit stats
│ │ ├── place/ # Saved places CRUD
│ │ ├── poi/ # Points of Interest
│ │ └── guide/ # AI city guide pipeline
│ └── mobile/ # @traces/mobile (Expo SDK 54)
│ ├── app/ # Expo Router screens
│ ├── components/ # UI components
│ └── utils/ # Services (location, sync, api)
└── packages/
└── traces-types/ # @traces/types (shared interfaces)
```
## Commands
```bash
# Development
pnpm dev:traces:mobile # Start Expo app
pnpm dev:traces:server # Start NestJS backend
pnpm dev:traces:full # Start auth + backend + mobile
# Database
pnpm traces:db:push # Push Drizzle schema
pnpm traces:db:studio # Open Drizzle Studio
```
## Architecture
- **Mobile**: Offline-first. All GPS data in AsyncStorage. Sync is additive.
- **Backend**: NestJS + Drizzle ORM + PostgreSQL. Auth via ManaModule.
- **AI Guides**: Uses mana-search for POI discovery, mana-llm for narratives.
- **Credits**: 5 base + 2 per POI consumed via CreditClientService.
## API Endpoints
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/v1/locations/sync` | POST | Batch sync from mobile |
| `/api/v1/locations` | GET | Query locations |
| `/api/v1/cities` | GET | User's visited cities |
| `/api/v1/cities/:id` | GET | City detail + stats |
| `/api/v1/places` | GET/POST | List/create places |
| `/api/v1/places/:id` | PUT/DELETE | Update/delete place |
| `/api/v1/pois` | GET | Nearby POIs |
| `/api/v1/pois/:id` | GET | POI detail |
| `/api/v1/guides/generate` | POST | Generate AI guide |
| `/api/v1/guides` | GET | User's guides |
| `/api/v1/guides/:id` | GET/DELETE | Guide detail/delete |
## Environment Variables
Backend: `PORT=3026`, `DATABASE_URL`, `MANA_AUTH_URL`, `MANA_LLM_URL`, `MANA_SEARCH_URL`
Mobile: `EXPO_PUBLIC_TRACES_BACKEND_URL`, `EXPO_PUBLIC_MANA_AUTH_URL`
## Mobile Navigation (5 tabs)
1. **Tracking** - Live GPS tracking + map
2. **Orte** - Saved places, cities, countries
3. **Karte** - Full-screen map view
4. **Städte** - Visited cities with stats
5. **Führungen** - AI-generated city guides