Skip to content

Latest commit

 

History

301 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AlgoLocal

AlgoLocal

Offline coding practice, from LeetCode-style problems to real engineering projects.

Latest release Downloads Stars Platforms License MIT

中文  ·  Español  ·  Website  ·  Discussions  ·  Issues


Solve LeetCode-style algorithm problems in JavaScript, TypeScript or Python, then build multi-stage engineering projects that are graded on concurrency, latency, resilience and code quality. Everything runs on your own machine; AI assistance is optional and uses the provider you configure.

Solving an algorithm problem, tests running in the browser

Quick start

Desktop application

No runtime dependencies are required. Download the latest release:

Platform Artifact
macOS (Apple Silicon) AlgoLocal-*-macOS-arm64.dmg
macOS (Intel) AlgoLocal-*-macOS-x64.dmg
Windows (Installer) AlgoLocal-*-Windows-Setup.exe
Windows (Portable) AlgoLocal-*-Windows-Portable.exe
Linux (AppImage) AlgoLocal-*-Linux.AppImage
Linux (Debian, Ubuntu) AlgoLocal-*-Linux.deb
Linux (Fedora, RHEL) AlgoLocal-*-Linux.rpm

Opening the app on macOS

These builds are signed ad-hoc rather than with an Apple Developer ID, so macOS cannot verify the developer and will refuse the first launch. To allow it:

  1. Move AlgoLocal to Applications and double-click it. macOS says it cannot verify the app is free of malware — click Done.
  2. Open System Settings → Privacy & Security, scroll to Security, and click Open Anyway next to AlgoLocal. Confirm with Touch ID or your password.

This is only needed once. On macOS Sequoia (15) and later the old Control-click → Open shortcut no longer works, and xattr -rd com.apple.quarantine is neither needed nor sufficient.

Removing this warning entirely requires a paid Apple Developer ID certificate and notarization. Building from source avoids it.

From source

Requires Node.js 18 or later and npm 8 or later.

git clone https://github.com/zxypro1/algolocal.git
cd algolocal
npm install
npm run build
npm start

The application is then available at http://localhost:3000. start-local.bat (Windows) and start-local.sh (macOS, Linux) perform the same steps and offer to write an AI configuration file on first run.

Contents

Features

Capability Detail
Two practice modes Algorithm problems and multi-stage engineering projects
Offline execution Code runs in the browser through WebAssembly, with no server-side execution
Local data Problems, drafts and statistics stay in local storage
Optional AI Problem generation, hints, solutions and engineering review, via your own provider
Editor Monaco, with per-problem and per-language draft persistence
Dashboard Accuracy by difficulty and tag, activity heatmap, recent attempts
Platforms Windows, macOS, Linux

Practice modes

Algorithm problems

Standard interview-style practice: read the statement, implement the function, run the test cases. 29 problems are included and the library is extensible.

Engineering practice

A project is a small system built across several stages in a multi-file workspace. Correctness is necessary but not sufficient; each stage also measures behaviour.

Engineering Practice: a multi-file workspace with hidden specs and engineering gates

Component Description
Workspace File tree, tabbed editor, read-only contract files, files unlocked per stage
Acceptance specs Hidden test cases, executed in a Web Worker
Engineering gates Assertions on measured metrics, for example peak concurrency at most 4, or 12 requests within 300ms
Virtual clock sleep(200) costs no real time while latency and concurrency remain exactly measurable
Scoring Correctness, concurrency, latency, resilience, encapsulation, elegance
AI review Reads the code, the latest run and the static metrics, then reviews it as a production pull request

Three projects are included:

Project Topics
Resilient fetch pipeline Bounded concurrency, backoff, single-flight caching, cancellation
Event-driven order pipeline Event bus, onion middleware, idempotency, dead letter queue
Resilient API gateway Token bucket, circuit breaker, timeout budgets

Projects can also be generated by AI. A generated project is executed against its own reference solution before it is accepted. See the Engineering Practice Guide for the authoring format.

Language support

Language Execution
JavaScript Native browser execution
TypeScript Transpiled by the TypeScript compiler, then executed
Python Pyodide (CPython compiled to WebAssembly)

AI features

All four features share a single provider configuration.

Feature Description
Problem generator Produces a complete problem from a natural-language description: statement, test cases, templates, reference solution
Solution generator Produces several approaches with complexity analysis and trade-offs
Chat assistant Answers questions about the code currently in the editor without revealing the full solution
Engineering review Reviews a completed stage on concurrency safety, failure behaviour, module boundaries and style

Supported providers: DeepSeek, OpenAI, Claude, Qwen, and any OpenAI-compatible endpoint, local or remote (Ollama, LM Studio, vLLM, LocalAI, llama.cpp, or a hosted gateway). See AI_PROVIDER_GUIDE.md.

Usage

Algorithm problems:

  1. Select a problem and a language.
  2. Implement the solution in the editor.
  3. Select "Submit & Run Tests" to execute the test cases in the browser.
  4. Review the results, execution time, and the dashboard statistics.

Engineering projects:

  1. Open a project and read the stage brief.
  2. Implement the stage in the workspace.
  3. Select "Run acceptance" to execute the hidden specs and evaluate the gates.
  4. Review the spec results, metrics, score and optional AI review. Clearing a stage unlocks the next one.

Configuration and problem management:

  • AI providers are configured in Settings (application menu in the desktop app, /settings in the browser). Desktop configuration is stored in ~/.offline-leet-practice/config.json.
  • Problems can be added through the "Add Problem" page, by importing JSON, or by editing public/problems.json. See MODIFY-PROBLEMS-GUIDE.md.

Development

Command Purpose
npm run dev Development server
npm run build Production build
npm run test:engineering Engineering runtime and preset project tests
npm run test:ai Provider, streaming and JSON extraction tests
npm run test:editor Draft persistence tests
npm run projects:build Compile projects/definitions into projects.json
npm run projects:verify Execute every stage against its reference solution
npm run dist:mac / dist:win / dist:linux / dist:all Desktop builds, see DESKTOP-APP-GUIDE.md

Built with React 18, Next.js 13, TypeScript, Mantine v7, Monaco Editor and Electron.

Project structure

algolocal/
├── pages/
│   ├── api/                    # Problem, AI and project endpoints
│   ├── problems/[id].tsx       # Problem detail, with AI chat and solutions
│   ├── projects/               # Engineering Practice: list, workspace, generator
│   ├── generator.tsx           # AI problem generator
│   ├── stats.tsx               # Practice dashboard
│   ├── manage.tsx              # Problem management
│   └── index.tsx               # Problem list
├── src/
│   ├── components/             # React components
│   ├── hooks/                  # WASM executor, project runner, AI configuration
│   ├── lib/engineering/        # Virtual clock, lab, module runtime, spec runner, scoring
│   ├── lib/server/             # AI provider, project store, prompts
│   └── workers/                # Stage runner worker
├── projects/definitions/       # Engineering project sources
├── public/
│   ├── problems.json           # Problem database
│   └── projects.json           # Engineering project database
├── electron-main.js
└── electron-builder.config.js

Documentation

Document Contents
ENGINEERING-PRACTICE-GUIDE.md How the engineering runtime works and how to author projects
AI_PROVIDER_GUIDE.md Provider configuration, models, troubleshooting
MODIFY-PROBLEMS-GUIDE.md Problem format and offline editing
DESKTOP-APP-GUIDE.md Desktop build and packaging

Contributing

Contributions are welcome. Additional algorithm problems and engineering projects are the most useful additions; improvements to the analytics, interface and documentation are equally welcome.

License

MIT