WIP: Komoot import integration

Add Komoot API client, import logic, crypto helpers, integration routes,
DB schema changes, and i18n strings for the Komoot import feature.

Import processing runs as a durable pg-boss background job with retries
instead of blocking the HTTP request.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-04-13 20:10:00 +02:00
parent 32c5fbde8f
commit 5fd60ba07d
24 changed files with 982 additions and 51 deletions

View file

@ -5,6 +5,8 @@ import { join, extname, resolve } from "node:path";
import { logger } from "./app/lib/logger.server.ts";
import { httpRequestDuration, registry } from "./app/lib/metrics.server.ts";
import { createBoss, startWorker } from "@trails-cool/jobs";
import { setBoss } from "./app/lib/boss.server.ts";
import { komootImportJob } from "./app/jobs/komoot-import.ts";
import postgres from "postgres";
const port = Number(process.env.PORT ?? 3000);
@ -100,8 +102,9 @@ server.listen(port, async () => {
const { seedOAuthClient } = await import("./app/lib/oauth.server.ts");
await seedOAuthClient("trails-cool-mobile", "trailscool://auth/callback", true);
// Start background job worker (no jobs yet — placeholder for Komoot import and federation)
// Start background job worker
const boss = createBoss(process.env.DATABASE_URL ?? "postgres://trails:trails@localhost:5432/trails");
await startWorker(boss, []);
setBoss(boss);
await startWorker(boss, [komootImportJob]);
logger.info("Background job worker started");
});