How threadseeker/backend works
Project type and purpose
• This is an open‑sourced backend service (“Threadseeker Backend”) built on Nitro (Node.js server framework) to serve RESTful APIs for managing “threads,” “users,” “tasks,” and “reports.”
• It relies on Supabase (PostgreSQL) as its primary datastore and Redis as a caching layer and task‐management queue.
File structure
• Top level:
• server/ – contains all server-side code: API handlers, middleware, OpenAPI schemas, utility modules, type definitions, and routing.
• database/ – holds DB schema and setup instructions.
• Configs: nitro.config.ts, threadseeker.config.ts, ESLint, Prettier, tsconfig, CI workflows.
• Inside server/:
• api/ – endpoint definitions under /api/…, organized by version (v1) and “threads” vs “internal” vs Cloudflare functions (cf).
• routes/ – non‑API Nitro routes (if any).
• middleware/ – auth and internal‑auth middleware.
• openapi/ – JSON/YAML fragments used for auto‑generating Swagger docs.
• utils/ – composable helpers for Supabase client, Redis connection, task queue, thread/report operations.
• types/ – TypeScript interfaces/auto‑generated DB types.
README for additional insights
• Key stacks: Nitro server framework, Supabase (Postgres + Auth), Redis (cache + job queue).
• It auto‑generates OpenAPI docs and serves them at /_docs/_swagger.
• Deployment target is container or Zeabur; optional Cloudflare Worker as reverse proxy for docs.