Skip to content

debug-node/leetcode-metrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode Metrics

LeetCode Metrics is a lightweight full-stack app that fetches and displays LeetCode progress by difficulty (Easy/Medium/Hard) with submission stats.

Live Demo

Features

  • Search any valid LeetCode username
  • Difficulty-wise solved progress with animated circular charts
  • Submission summary cards (overall + difficulty-wise)
  • Responsive, modern UI (desktop + mobile)

Tech Stack

  • Frontend: HTML, CSS, Vanilla JavaScript
  • Backend: Node.js + Express
  • API Source: LeetCode GraphQL endpoint

Project Structure

leetcode-metrics/
├── public/
│   ├── index.html
│   ├── style.css
│   ├── styles/
│   │   ├── base.css
│   │   ├── layout.css
│   │   ├── components.css
│   │   └── responsive.css
│   ├── script.js
│   ├── logo.png
│   └── favicon.ico
├── server.js
├── package.json
└── README.md

Requirements

  • Node.js 16+
  • npm

Local Setup

npm install
npm start

Open:

Environment Variables

  • PORT (default: 5000) — server port

PowerShell example:

$env:PORT=5001
npm start

API

POST /api/user

Request body:

{
	"username": "leetcode_username"
}

Responses:

  • 200 user stats payload
  • 400 username is required
  • 404 user not found
  • 500 internal/server or upstream error

Security & Reliability

  • CORS enabled for cross-origin requests
  • Basic request validation for username presence
  • Graceful error handling for upstream LeetCode API failures

Styling Structure

  • public/style.css acts as the entry stylesheet.
  • Actual styles are split by concern under public/styles/ for easier maintenance.

Troubleshooting

  • If old UI appears, hard refresh (Ctrl + F5) once.
  • If EADDRINUSE appears, run on another port:
$env:PORT=5001
npm start

Author

About

A simple Node.js web app to track and display your LeetCode progress.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors