Firstly, I created a paginate module that accepts required totalCount, url and queries. And calculates metadata accordingly. Provided strict tests for it.
Use the paginate methods in required modules like environment, project, secret, event, and more. I have used highly efficient techniques to count data and query db, improving project's performance and features as well.
Create End-to-End tests for the affected modules, to verify results.
Raised issues that were not known to the team, and solved it within given time.