alfaarghya / alfa-leetcode-api

It's a custom leetcode api. This API provides endpoints to retrieve details about a user's profile, badges, solved questions, contest details, contest history, submissions, calendar and and also daily questions, selected problem, list of problems.
https://alfa-leetcode-api.onrender.com/
MIT License
251 stars 97 forks source link

Added graphql queries and added API cache. #15

Closed changchunlei closed 4 months ago

changchunlei commented 4 months ago

Thank you for releasing this API; it's greatly appreciated. I've expanded the queries for LeetCode and integrated API caching and Axios for faster updates. Please review the changes at your convenience. I've also removed the personalized content.

alfaarghya commented 4 months ago

Hii 👋 @changchunlei ! Welcome to alfa-leetcode-api repo 🤝

You added more queries & new endpoints, and I greatly appreciate your hard work. However, I'd like to ask one question and request one change.


Question 🧐

Q. Why do we need /dailyQuestion & /questionOfTodayQuery when we have /daily? And both of your routes give pretty much the same data, so why 2 routes?


Changes require 🤔

Please write all of your route logic inside the leetCode.ts file and explore the codebase to see all the data formatting code written in a separate file.


Thank you for your contribution 😊

changchunlei commented 4 months ago

Thanks my friend. To answer your question: The need for both /dailyQuestion and /questionOfTodayQuery routes, despite having /daily, there are specific requirements of the iOS build I am working on. The raw daily question includes extra properties that are highly beneficial for my iOS app. The change required: Answer: Absolutely, it makes sense. my current focus is on the iOS project, which is quite demanding. As soon as I have some bandwidth, I'll refactor the code, moving all route logic into the leetCode.ts file and ensuring data formatting code is separated. I will raise a new PR then.

alfaarghya commented 4 months ago

Thank you @changchunlei for your answers 😊

Do not need to do the changes right away, first you build your project, then make changes and raise a new PR.

alfaarghya commented 4 months ago

🎉 Thanks for your contribution! 😊

Your code looks great, and I appreciate the thoroughness of your work. The new features you added are well-implemented, and I've reviewed everything. I'm happy to approve it for merging. 🚀 Thanks again for your valuable contribution 😄

‼️ Please remember to update the code after you have finished your project.

Best of luck 🤞 For your Project