A Spring Boot web application that fetches and visualizes LeetCode user statistics via LeetCode's public GraphQL API. Built with Thymeleaf, Bootstrap 5.3, and Chart.js.
- 4 Ring Charts — doughnut charts for Easy, Medium, Hard, and Total solved counts
- Topic Tags — grouped by Advanced, Intermediate, Fundamental with solved counts (format:
Array x109) - Language Stats — progress bars showing problem counts per language
- 30-Day Solved Trend — line chart tracking daily solved counts over time
- User Comparison — side-by-side comparison of any two LeetCode users
- Dark / Light Theme — persistent theme toggle (Bootstrap 5.3
data-bs-theme) - Auto Refresh — daily cron refreshes stats for all tracked users
| Layer | Technology |
|---|---|
| Backend | Java 21, Spring Boot 3.4.4, Spring Data JPA |
| Frontend | Thymeleaf, Bootstrap 5.3, Chart.js 4.4, Bootstrap Icons |
| Database | H2 in-memory (dev), PostgreSQL (production) |
| Build | Maven |
git clone <repo-url>
cd leetcode-tracker
mvn spring-boot:runOpen http://localhost:8080, enter a LeetCode username, and hit Search.
- Search — enter a LeetCode username on the home page to fetch and display their stats
- Dashboard — view solved counts, acceptance rate, ranking, topic tags, language breakdown, recent submissions, and the 30-day solved trend
- Compare — navigate to
/compare(or click Compare in the navbar) to view two users side-by-side - Theme — click the sun/moon icon in the navbar to toggle between light and dark mode
src/main/java/com/leetcode/tracker/
├── LeetCodeTrackerApplication.java — entry point, RestTemplate bean, scheduling
├── model/
│ ├── LeetCodeUser.java — user stats entity
│ └── DailySnapshot.java — daily snapshot entity for trend chart
├── repository/ — Spring Data JPA repositories
├── service/
│ └── LeetCodeService.java — GraphQL queries, data mapping, cron refresh
└── controller/
├── TrackerController.java — web endpoints
└── GlobalExceptionHandler.java — global error handling
src/main/resources/
├── application.properties — dev config (H2, port 8080)
├── application-prod.properties — prod config (PostgreSQL)
└── templates/
├── index.html — search form
├── dashboard.html — main stats dashboard
└── compare.html — user comparison page
- Set the active profile to
prod - Add a
DATABASE_URLenvironment variable pointing to your PostgreSQL instance - The production profile disables the H2 console and uses PostgreSQL
The userProgressQuestionList GraphQL query requires authentication and cannot list a specific user's solved/attempted problems publicly. The /api/problems/{username} endpoint exists but returns empty for unauthenticated requests.