2.3 KiB
2.3 KiB
Voyage Development Instructions (OpenCode)
Project
- Name: Voyage
- Purpose: Self-hosted travel companion web app (fork of AdventureLog)
- Stack: SvelteKit 2 (TypeScript) frontend · Django REST Framework (Python) backend · PostgreSQL + PostGIS · Memcached · Docker · Bun (frontend package manager)
Architecture Overview
- API proxy pattern: Frontend never calls Django directly. All API calls go through
frontend/src/routes/api/[...path]/+server.ts, which proxies tohttp://server:8000, handles cookies, and injects CSRF behavior. - Service ports:
web→:8015server→:8016db→:5432cache→ internal only
- Authentication: Session-based via
django-allauth; CSRF token from/auth/csrf/; mutating requests sendX-CSRFToken; mobile middleware path supportsX-Session-Token.
Codebase Layout
- Backend:
backend/server/- Apps:
adventures/,users/,worldtravel/,integrations/,achievements/,chat/
- Apps:
- Frontend:
frontend/src/- Routes:
src/routes/ - Shared types:
src/lib/types.ts - Components:
src/lib/components/ - i18n:
src/locales/
- Routes:
Development Commands
Frontend
cd frontend && npm run formatcd frontend && npm run lintcd frontend && npm run checkcd frontend && npm run build
Backend
docker compose exec server python3 manage.py testdocker compose exec server python3 manage.py migrate
Docker
docker compose up -ddocker compose down
Pre-Commit Checklist
Run in this order:
cd frontend && npm run formatcd frontend && npm run lintcd frontend && npm run checkcd frontend && npm run build
Known Issues (Expected)
- Frontend
npm run check: 3 type errors + 19 warnings expected - Backend tests: 2/3 fail (expected)
- Docker dev setup has frontend-backend communication issues (500 errors beyond homepage)
Key Patterns
- i18n: use
$t('key')for user-facing strings - API calls: route through proxy at
/api/[...path]/+server.ts - Styling: use DaisyUI semantic colors/classes (
bg-primary,text-base-content, etc.) - Security: handle CSRF tokens via
/auth/csrf/andX-CSRFToken
Conventions
- Do not attempt to fix known test/configuration issues as part of feature work.