Skip to content

Mudit-Chaudhary/LeetCode_Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode Tracker

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.

Features

  • 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

Tech Stack

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

Quick Start

git clone <repo-url>
cd leetcode-tracker
mvn spring-boot:run

Open http://localhost:8080, enter a LeetCode username, and hit Search.

Usage

  1. Search — enter a LeetCode username on the home page to fetch and display their stats
  2. Dashboard — view solved counts, acceptance rate, ranking, topic tags, language breakdown, recent submissions, and the 30-day solved trend
  3. Compare — navigate to /compare (or click Compare in the navbar) to view two users side-by-side
  4. Theme — click the sun/moon icon in the navbar to toggle between light and dark mode

Project Structure

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

Deploy to Render

  1. Set the active profile to prod
  2. Add a DATABASE_URL environment variable pointing to your PostgreSQL instance
  3. The production profile disables the H2 console and uses PostgreSQL

What's Not Public

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.

About

Track LeetCode problem-solving stats with interactive dashboards, ring charts, language breakdown, topic tags, and user comparison. Built with Spring Boot, Thymeleaf, Bootstrap 5, Chart.js.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors