Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 116 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,116 @@
# leetcode-ranking
# CodePVG LeetCode Ranking

A web-based platform developed for CodePVG to track and rank students based on their LeetCode performance.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A web-based platform developed for CodePVG to track and rank students based on their LeetCode performance.
A web-based platform developed by [CodePVG](https://www.linkedin.com/company/codepvg/) to track and rank students of [PVG COET](https://www.pvgcoet.ac.in/) based on their LeetCode performance.

It allows users to register with their LeetCode username and automatically fetches their problem-solving statistics to display on a leaderboard.

---

## Purpose

The goal of this project is to:

- Encourage consistent problem-solving among students
- Create a competitive yet motivating environment
- Provide visibility into individual coding progress

---

## Features
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s avoid including a features section in the README, so we don’t have to keep updating it every time new features are added.


### User Registration
- Users can register using their name and LeetCode username
- Accepts both direct usernames and profile links
- Validates whether the LeetCode user exists before registration

### Leaderboard System
- Displays ranked users based on their LeetCode statistics
- Automatically updates rankings based on fetched data
- Provides a clean interface for easy comparison

### Automated Data Fetching
- Periodically fetches user data using the LeetCode API
- Updates stored data without manual intervention
- Keeps leaderboard information up-to-date

### User Interface
- Simple and clean UI design
- Smooth user experience with loading states
- Includes blur and spinner animation during registration

### Input Handling and Validation
- Extracts username from full LeetCode profile links
- Prevents invalid or non-existent usernames
- Avoids duplicate or incorrect entries

### Error Handling
- Handles API failures gracefully
- Displays alerts for invalid inputs
- Prevents multiple submissions during requests

---

## Tech Stack
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already get a summary of the tech stack on the main repo page, so instead of repeating that in the README, we can link the related repos for the backend and the web scraping API (since LeetCode doesn’t officially provide one):

This would be more useful and avoid redundancy


| Layer | Technology |
|----------|------------------------|
| Frontend | HTML, CSS, JavaScript |
| Backend | Node.js |
| API | LeetCode API |

---

## Project Structure

```
leetcode-ranking/
│── frontend/ # UI (HTML, CSS, JS)
│── data/ # Stored user data
│── scripts/ # Automation scripts
│── server.js # Backend server
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
│── server.js # Backend server
│── server.js # Express server

│── package.json
```

---

## How to Run Locally

### 1. Clone the repository

```bash
git clone https://github.com/YOUR-USERNAME/leetcode-ranking.git
cd leetcode-ranking
```

### 2. Install dependencies


npm install
cd frontend
npm install
Comment on lines +86 to +89
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npm install
cd frontend
npm install
`npm install`


### 3. Run the project


npm run dev

or

node server.js
Comment on lines +93 to +98
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npm run dev
or
node server.js
`npm run dev`
or
`npm start`


## Usage

1. Open the registration page
2. Enter your name and LeetCode username
3. Submit the form
4. View your ranking on the leaderboard
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. View your ranking on the leaderboard
4. View your ranking on the leaderboard after the next sync


---

## Contributing

Contributions are welcome.

- Fork the repository
- Create a new branch
- Make your changes
- Submit a Pull Request