Skip to content

feat: Add GET /contests endpoint with pagination, filtering, and Redis caching#40

Merged
PoulavBhowmick03 merged 4 commits intoShonen-Labs:mainfrom
simplicityf:main
Jun 4, 2025
Merged

feat: Add GET /contests endpoint with pagination, filtering, and Redis caching#40
PoulavBhowmick03 merged 4 commits intoShonen-Labs:mainfrom
simplicityf:main

Conversation

@simplicityf
Copy link
Contributor

@simplicityf simplicityf commented Jun 1, 2025

Description:

This PR implements the GET /contests endpoint with the following features:
- Pagination using page and limit query parameters
- Filtering by contest type and status
- 30-second Redis caching to reduce database load on repeated queries
This improves performance and allows more flexible querying of contest data.

Also wrote a test case:
GET /api/contests
- returns contests with default pagination (19 ms)
- returns cached results when available (1 ms)
- filters by sport (1 ms)
- filters by fee range (2 ms)
- handles pagination correctly (1 ms)
- returns 400 for invalid query parameters
- continues without cache on Redis errors
- returns 500 on database errors (1 ms)
- combines multiple filters correctly (1 ms)
(Note: All unit test passed)

Screenshot 2025-06-02 at 12 48 51 AM

Related issue: closes #10

@simplicityf
Copy link
Contributor Author

@PoulavBhowmick03 please review

@PoulavBhowmick03
Copy link
Contributor

@simplicityf please fix the build errors

@simplicityf
Copy link
Contributor Author

simplicityf commented Jun 3, 2025

@PoulavBhowmick03, I have resolve it. The test is not coming from my side

Or did i break a code 🤔

@PoulavBhowmick03 PoulavBhowmick03 merged commit a64704c into Shonen-Labs:main Jun 4, 2025
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BACKEND] : Contest Listing API with Filters

2 participants