Relates to #2750 — Phase 2 migration.
Goal
Move contact export (CSV, VCard, Google Contacts) from Express backend to a new export-contacts edge function.
Endpoint
| Method |
Path |
Purpose |
| POST |
/:type |
Export contacts (csv/vcard/google_contacts) with credit verification |
Key challenges
- Billing flow: Port credit verification including 402 (no credits), 266 (confirm partial), 206 (partial content) responses
- File generation: CSV and VCard generators are pure functions, portable
- Google Contacts API: Uses OAuth access token from mining sources
- Rate limiter: Replace express-rate-limit (100 req/15min)
Files to create
- supabase/functions/export-contacts/index.ts — Hono app
- supabase/functions/export-contacts/formats/ — CSV, VCard, Google Contacts generators
Files to modify
- frontend/src/components/mining/buttons/ExportContacts.vue
Files to remove
- backend/src/routes/contacts.routes.ts:29-34
- backend/src/controllers/contacts.controller.ts:207-273
- backend/src/services/export/ (entire directory)
Acceptance criteria
Relates to #2750 — Phase 2 migration.
Goal
Move contact export (CSV, VCard, Google Contacts) from Express backend to a new export-contacts edge function.
Endpoint
Key challenges
Files to create
Files to modify
Files to remove
Acceptance criteria