Skip to content

FEATURE REQUEST: Add API Pagination to Backend List Endpoints#307

Description

@sharma-sugurthi

Is your feature request related to a problem?

  • Yes, it is related to a problem

Describe the feature you'd like

馃専 Feature Description

Add pagination support to all backend list endpoints (/users/, /sponsorships/, /posts/, /sponsorship-applications/, /collaborations/) to prevent performance degradation as the database grows.

馃攳 Problem Statement

Currently, all list endpoints fetch ALL records from the database without any pagination limits. For example:

@router.get("/users/")
async def get_users():
    result = supabase.table("users").select("*").execute()  # Returns every user!
    return result

As the platform scales to hundreds/thousands of users, sponsorships, and posts, this will cause:

  • Severe database performance issues
  • Network timeouts on the frontend
  • High memory consumption on both client and server
  • Poor user experience with infinite scroll loading

馃幆 Expected Outcome

All list endpoints should support pagination with:

  • Query parameters: skip (offset) and limit (items per page)
  • Default values: skip=0, limit=50
  • Maximum limit: 100 items per request
  • Response should include:
    - data: Array of items
    - total: Total count of items
    - has_more: Boolean indicating if more items exist
    - skip: Current offset
    - limit: Items per page

Record

  • I agree to follow this project's Code of Conduct
  • I want to work on implementing this feature

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions