Thank you for your interest in contributing to CodePVG LeetCode Ranking.
- Fork the repository and clone your fork:
git clone https://github.com/YOUR-USERNAME/leetcode-ranking.git
cd leetcode-ranking- Create a new branch for your feature/fix:
git checkout -b feature/your-feature-name- Install dependencies:
npm install- Start the local server:
npm run devThe leaderboard data (such as users.json and historical stats) lives in a separate data repository to keep the main codebase clean. To test the scripts/sync-leaderboard.js script locally:
- Clone the data repository into a folder named
datainside the project root (this folder is already ignored in.gitignore, so you never have to worry about accidentally pushing local data changes back to the main repository):
git clone https://github.com/codepvg/leetcode-ranking-data.git data- Run the synchronization script. It will automatically detect your local
datafolder and pull stats from the LeetCode API based on the users insidedata/users.json:
node scripts/sync-leaderboard.js- Once it finishes, you can preview the newly generated
overall.json,daily.json,weekly.json, andmonthly.jsonfiles inside thedatafolder to verify your script changes.
(Note: To prevent GitHub API rate limits when the script fetches historical commit data, you can optionally set a Personal Access Token via the DATA_REPO_TOKEN environment variable.)
Familiarize yourself with the core directories:
frontend/: Contains all static assets, HTML, CSS, and client-side JS controlling the UI.scripts/: Contains automation logic (e.g.,sync-leaderboard.js) used to fetch updates from the LeetCode API..github/workflows/: CI/CD GitHub Actions driving data synchronization and code formatting.server.js: The Express server delivering the frontend files and configuring important security headers.
- Check whether an issue already exists for the change you want to make.
- If you would like to work on an existing issue, please request assignment.
- Please do not start working on an issue or submit PRs until you are officially assigned.
- The issue creator is given the first priority to work on their issue.
- If the creator declines or does not request assignment, the issue will be assigned to others in the order of requests received (first-come, first-served).
Note: This project is currently maintained by a solo maintainer, so reviews, assignments, and responses may sometimes take a little time. Thanks for your patience.
When submitting a PR:
- Link the relevant issue.
- Clearly describe the changes made.
- Include screenshots or a screen recording for UI changes.
- Test your changes before submitting.
- Test frontend changes on both desktop and mobile viewports where applicable.
- Ensure there are no console errors.
- Keep your changes focused on the issue being addressed.
- Avoid making unrelated modifications to files outside the scope of your contribution.
- Run the Prettier code formatter locally before pushing to pass the automated formatting checks.
We use Prettier to enforce consistent code style across the project. Our automated GitHub Action check will fail if unformatted code is pushed to a PR.
Before submitting your Pull Request, please run the following command in the root of the repository to automatically format all your changes:
npx prettier --write .Alternatively, you can comment /format on your Pull Request, and our GitHub Actions bot will automatically format your code and push the commit for you.
Please keep the existing terminal-inspired design language of the platform in mind when making UI changes.
For easier review:
- Test responsive behaviour on smaller screen sizes where applicable.
- Ensure any new UI elements are consistent with the existing design language.
If your branch falls behind main, please sync it and resolve any conflicts before requesting review.
If you are unsure about an implementation or feature proposal, feel free to ask in the issue before starting work.
Thank you for helping improve CodePVG LeetCode Ranking.