Leetcode - the worlds leading platform for for coding and algorithmic problems.
I discovered that there are not many APIs that allow you to enter a username and see your Leetcode Stats and as a Leetcode advocate I decided to tackle this problem.
- Springboot backend
- Thymleaf for the view/front-end
- GraphQL
- Postman for testing leetcode's graphql endpoint
https://leetcode.com/graphql - uses Leetcode's GraphQL endpoint to retrieve data
- Clone the repository
- Run the following command in the project directory:
- /mvnw spring-boot:run
- Navigate to http://localhost:8080/leetcode/stats
LeetcodeApiApplication.java- Entry point of the Spring applicationLeetcodeController.java- Handles request relating to Leetcode stats and returning the responseLeetcodeData.java- Plain old Java objects (holder of the data passed by the Controller to be displayed on a View)LeetcodeService.java- Service class that calls Leetcode's graphQL endpoint, converts data to POJO and returns to controllerschema.graphqls- GraphQL schemaform.html- Thymleaf template for the view
- Improve front-end UI
