LeetCode Metrics is a lightweight full-stack app that fetches and displays LeetCode progress by difficulty (Easy/Medium/Hard) with submission stats.
- Search any valid LeetCode username
- Difficulty-wise solved progress with animated circular charts
- Submission summary cards (overall + difficulty-wise)
- Responsive, modern UI (desktop + mobile)
- Rate limiting and API caching for optimal backend performance
- Frontend: HTML, CSS, Vanilla JavaScript
- Backend: Node.js + Express
- API Source: LeetCode GraphQL endpoint
leetcode-metrics/
βββ src/
β βββ routes/
β β βββ user.js
β βββ middleware/
β β βββ rateLimit.js
β βββ server.js
βββ public/
β βββ index.html
β βββ js/
β β βββ script.js
β βββ css/
β β βββ style.css
β β βββ styles/
β β βββ base.css
β β βββ layout.css
β β βββ components.css
β β βββ responsive.css
β βββ assets/
β βββ logo.png
β βββ favicon.ico
βββ package.json
βββ README.md
- Node.js 18+ (Native Fetch is used)
- npm
npm install
npm startOpen:
PORT(default:5000) β server port
PowerShell example:
$env:PORT=5001
npm startRequest body:
{
"username": "leetcode_username"
}Responses:
200user stats payload400username is required404user not found500internal/server or upstream error
- CORS enabled for cross-origin requests
- Basic request validation for username presence
- API Rate Limiting to prevent spam and abuse
- In-memory Caching to reduce upstream LeetCode API latency
- Graceful error handling for upstream LeetCode API failures
public/css/style.cssacts as the entry stylesheet.- Actual styles are split by concern under
public/css/styles/for easier maintenance.
- If old UI appears, hard refresh (
Ctrl + F5) once. - If
EADDRINUSEappears, run on another port:
$env:PORT=5001
npm start- Aditya Kumar
- GitHub: https://github.com/debug-node