Skip to content

Add server-side search/sort/tag params to generate/status endpoint #54

@taha-abbasi

Description

@taha-abbasi

Why

Dashboard currently loads articles via /api/generate/status and does search, sort, and tag filtering client-side. This works fine now (24 articles per page after #53), but will degrade at scale (100+ articles) since:

  • Client-side regex search across all loaded articles gets sluggish
  • Tag filtering requires all articles in memory
  • Sort is redundant (server already sorts, then client re-sorts)

We considered refactoring the dashboard to use /api/blog/articles (which already has server-side search/sort/tag), but decided against it because:

  1. /api/generate/status serves double duty — returns job status + articles in one call, needed for live generation polling (every 2.5s)
  2. Blog endpoint is public, dashboard is authed — different security models
  3. The endpoints serve genuinely different use cases

Proposed

Add optional query params to /api/generate/status:

  • q — server-side regex search on title + description
  • sortnewest (default) or oldest
  • tag — filter by tag

This keeps one endpoint for the dashboard while offloading filtering to MongoDB. Same pattern already proven on /api/blog/articles.

When

P2 — only needed when sites regularly exceed ~100 articles. Current pagination (#53) handles the immediate load time issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Nice to haveenhancementNew feature or requestscribe-launchScribe Launch project board

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions