Skip to content

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

@sharma-sugurthi

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

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