LeetCode Draw is a local-first macOS desktop app that turns a personal LeetCode practice list into a calm, randomly drawable question library. A new installation starts with zero questions. Convert a screenshot or text export into one validated JSON file, import it once, and keep the resulting library editable on your Mac.
Version 1.2.4 uses a Claude Editorial interface: warm opaque surfaces, restrained serif headings, a true warm-dark appearance, and a tarot-inspired draw animation.
| Light · Draw | Light · Library |
|---|---|
![]() |
![]() |
| Dark · Draw | Dark · Library |
![]() |
![]() |
A fresh installation: zero questions, no draw history, and one JSON import away from a personal practice library. The empty-card light gently breathes in the app and settles to a still composition when macOS Reduce Motion is enabled.
LeetCode Draw is an independent study tool. It is not affiliated with or endorsed by LeetCode.
- Start empty. A fresh installation has no built-in question library and nothing available to draw.
- Import or add manually. Import a validated JSON library, or enter a single problem number, title, and difficulty. Both methods append to the existing library and reject duplicate problem numbers.
- One clear import place. The library heading owns the only import entry; the complete workflow opens in an accessible right-side drawer.
- Keep adding as you practice. Choose 手动添加 in 我的题库, fill in the three fields, and choose 保存题目. The form stays open for the next question; new entries are saved locally and immediately available to draw.
- Keep the library editable. Remove one imported question with inline confirmation, or clear the entire library and draw history with a confirmation dialog that defaults to Cancel.
- Keep the official reference. Every item preserves its original LeetCode problem number.
- See difficulty immediately. Official numbers use teal-green for 简单, amber for 中等, and red for 困难, with text labels always retained.
- Use the whole library canvas. Question groups fill the content width and balance into two columns on wide windows, then collapse to one column on narrower windows.
- Draw with a cooldown. A drawn question is held out of the pool for five days, making repeated draws more useful.
- Review locally. Search the library, inspect recent draws, remove an individual imported question, and open the matching LeetCode China search result when you choose to.
- Choose your appearance. Select Light, Dark, or System appearance; the Dock icon follows the active light or dark presentation.
- Get useful import feedback. Invalid or duplicate rows are reported while valid rows still import.
- Stay local by default. There is no account, telemetry, cloud sync, analytics service, or bundled private question library.
Your study library stays on your Mac.
- No account system, telemetry, cloud sync, analytics, or application server.
- Imported JSON is read locally through the native file picker. The library, draw history, import report, and theme setting remain in local application data.
- The app opens
leetcode.cnonly after you explicitly choose to open a question. It never sends your library or draw history there. - This repository intentionally contains only a generic three-question sample. Do not commit a real library to a fork, issue, or pull request. Keep private exports outside the source tree or inside the ignored
private/folder.
If you choose to give a screenshot or text list to an external model for conversion, that is a separate choice made outside LeetCode Draw. Review that service's privacy policy before sharing your material.
- Give a screenshot or text list from your practice site to a large language model.
- Ask it to return only a JSON file matching the schema below. Do not ask it to add explanations or Markdown fences.
- Save the result as a
.jsonfile. - In LeetCode Draw, open 我的题库, choose 导入题库, then select the JSON file from the drawer.
You can use this prompt with a model:
Convert the supplied question list into the exact LeetCode Draw JSON format below. Preserve each official LeetCode problem number, title, and difficulty. Use only
简单,中等, or困难fordifficulty. Return JSON only; do not add Markdown or commentary.
{
"format": "leetcode-draw/question-library",
"version": 1,
"questions": [
{
"leetcodeId": 1,
"name": "两数之和",
"difficulty": "简单"
},
{
"leetcodeId": 2,
"name": "两数相加",
"difficulty": "中等"
},
{
"leetcodeId": 42,
"name": "接雨水",
"difficulty": "困难"
}
]
}- The root fields must be exactly
format: "leetcode-draw/question-library"andversion: 1. questionsmust be an array of question objects.- Each question needs
leetcodeId,name, anddifficulty. leetcodeIdis the official positive LeetCode problem number and is used to keep entries traceable.difficultymust be one of简单,中等, or困难.- Files are limited to 2 MB. The legacy
lcfield remains readable for existing libraries, but new files should useleetcodeId.
The repository includes a safe, ready-to-import example: resources/examples/leetcode-draw-example.json.
The latest public build is available from GitHub Releases.
The release ZIP contains an Apple silicon (arm64) DMG plus a SHA-256 checksum file. The application is ad-hoc signed for bundle integrity checks but is not notarized by Apple. If your security policy requires a notarized Developer ID build, build the app locally or sign and notarize your own distribution.
- macOS
- Node.js 20 or later
npm ci
npm test
npm run build
npm run electron:devCreate a DMG after the tests and production build pass:
npm run distThe result is written to release/LeetCode-Draw-<version>-arm64.dmg. The local build uses an ad-hoc macOS signature so the complete bundle can be integrity-checked on the build machine. It is not an Apple Developer ID or notarized distribution; maintainers distributing builds to other people should configure their own Developer ID signing and notarization.
After npm run dist, install the packaged app with:
npm run install:localThe installer validates version 1.2.4, bundle ID com.leetcode-draw.desktop, the executable, and the code signature before touching /Applications. It preserves the previous installation under release/install-backups/, installs through a temporary .next bundle with automatic rollback, and registers only /Applications/LeetCode Draw.app. Successful backups are sealed into recoverable, non-application folders so Spotlight and Launchpad do not list Electron helper bundles as duplicate apps.
The current suite contains 33 tests covering the import format, duplicate and invalid-row handling, the three-question sample, cooldown behavior, theme behavior, the sole import entry, drawer focus and close behavior, successful and invalid imports, semantic difficulty numbers, individual deletion, full-library clearing, the main draw flow, consecutive manual additions, persistence after reopening, validation, preservation of existing history, and clear-library confirmation and cancellation. npm run build also checks the Electron bridge and packaged assets before a DMG is created.
Electron, React, TypeScript, Vite, Vitest, and electron-store.



