Skip to content

[Performance] Use server-side filtering for template catalog instead of client-side #528

Description

@Somil450

Problem

The template catalog page loads the entire dataset of available templates to the client, and performs search, filtering, and tag matching client-side. As the template library grows, this increases the initial page bundle size, memory footprint, and slows down interaction.

Proposed Solution

Refactor the template retrieval:

  1. Implement query parameters on the API endpoint (e.g., /api/templates?search=...&tag=...&page=...)
    1. Perform search/filtering in the database query
    1. Use server actions or standard React use hook to fetch filtered results from the server on query change
    1. Keep the list paginated (e.g., 20 templates per page)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions