1.5 KiB
1.5 KiB
title, type, permalink
| title | type | permalink |
|---|---|---|
| conventions | note | voyage/knowledge/conventions |
Coding Conventions & Patterns
Frontend Patterns
- i18n: Use
$t('key')fromsvelte-i18n; add keys to locale files - API calls: Always use
credentials: 'include'andX-CSRFTokenheader - Svelte reactivity: Reassign to trigger:
items[i] = updated; items = items - Styling: DaisyUI semantic classes + Tailwind utilities; use
bg-primary,text-base-contentnot raw colors - Maps:
svelte-maplibrewith MapLibre GL; GeoJSON data
Backend Patterns
- Views: DRF
ModelViewSetsubclasses;get_queryset()filters byuser=self.request.user - Shared-access queries: Use
Q(user=user) | Q(shared_with=user)).distinct()for collection lookups that should include shared members (e.g. chat agent tools). Always.distinct()to avoidMultipleObjectsReturnedwhen owner is also inshared_with. - Money:
djmoneyMoneyField - Geo: PostGIS via
django-geojson - Chat providers: Dynamic catalog from
GET /api/chat/providers/; configured inCHAT_PROVIDER_CONFIG
Workflow Conventions
- Do not attempt to fix known test/configuration issues as part of feature work
- Use
bunfor frontend commands,uvfor local Python tooling where applicable - Commit and merge completed feature branches promptly once validation passes (avoid leaving finished work unmerged)
- See decisions.md for rationale