Feste ~20er-Taxonomie geseedet (de/en/sv, published; bestehende
Kategorien werden wiederverwendet) + Tabelle category_batches.
src/lib/classifyWords.js: findet in Pairs verwendete Wörter ohne
Kategorie und klassifiziert sie per Haiku gegen die feste Liste.
- Stundenjob über die Message Batches API (asynchron, ~50% günstiger):
submit/collect-Ticks, in index.js nach Boot + stündlich.
- Sofortiger synchroner One-Shot-Backfill (classifyWordsSync) für
Live-Test ohne 24h-Verzug.
Beides materialisiert pair_categories via derivePairCategories.
POST /api/categories/auto-assign (admin): ?sync=true = Sofort-Backfill,
sonst ein Batch-Tick. Entkoppelt von generate-words und Publish.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- tts_settings (voice/model/speed/... pro Sprache) + Seed de/en/sv; Route /api/tts-settings
- audios: Stimme/Parameter aus tts_settings; Coverage zählt jetzt auch draft/translated
- pairs: GET /publishability (Readiness, sortierbar nach 'am wenigsten fehlt'),
POST /:id/publish (kaskadiert question/statements→published, validiert Bild+Audio je Sprache)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
POST /api/claude/generate-pairs — proxies image + objects to Claude
Haiku and returns 30 structured pairs (text/yes_no/question, easy/medium)
as JSON. Keeps the Anthropic API key server-side via ANTHROPIC_API_KEY.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- GET /auth/feed?lang=sv&limit=20 (JWT, end-user allowed)
- Resolves {{uuid}} placeholders to word labels in all languages
- Includes picture URLs, pos/neg words per statement
- Fix migration seed: use full unique index (non-partial) for ON CONFLICT
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix broken rename migration array (sed had corrupted from values to _sv)
- Add languages table with status lifecycle and trilingual titles
- Add user_names table with unique lowercase index
- Add users_public table linking to user_names and languages (native/target)
- Wire all three new routes under /api/languages, /api/user-names, /api/users-public
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- is_blocked BOOLEAN (default true), INET type for IP validation
- Indexes on email/username/phone/ip for fast registration checks
- POST /api/blocklist/check — checks all fields in one request, returns 403 if blocked
- Auto-timestamps on block/unblock, email stored lowercase
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- objects: status enum, JSONB selections, notes, blocked_topic, auto-timestamps
- pairs placeholder table for future use
- Junction tables: object_words, object_pictures, object_pairs
- Full CRUD + link/unlink endpoints for all three relations
- README updated
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fills out placeholder categories table with all fields
- Trilingual titles, status enum, difficulty level, auto-timestamps
- ALTER TABLE IF NOT EXISTS for safe migration on existing table
- /api/categories CRUD route, word_ids included in responses
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- words table with trilingual titles, status enum, difficulty level, timestamps
- word_pictures junction table (M2M words <-> pictures)
- categories placeholder table
- word_categories junction table (M2M words <-> categories)
- Auto-timestamps on status change (requested/published/blocked)
- Full CRUD + link/unlink endpoints for pictures and categories
- README updated with schema and endpoints
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All /api/* routes require Authorization: Bearer <token>.
Tokens are configured via API_TOKENS env var (comma-separated for multiple).
/health remains public for Coolify health checks.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove process.exit(-1) on pool error — a DB blip killed the whole container
- Health check now always returns 200 so Coolify doesn't mark it unhealthy
when PostgreSQL is temporarily unreachable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Node.js/Express API server that connects to PostgreSQL via environment variables.
Includes health check, table listing, row queries, and raw SQL endpoint.
Designed for deployment in Coolify alongside the snakkimo PostgreSQL container.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>