Skip to content

Development Setup

This guide walks you through everything you need to start contributing to Eigenvue. By the end, you will have the web app, documentation site, and Python package running locally with all tests passing.

Before you begin, make sure the following tools are installed and available on your PATH:

ToolMinimum VersionCheck Command
Node.js20.0node --version
npm10.0npm --version
Python3.10python --version
pip22.0pip --version
Git2.30git --version

Eigenvue is a monorepo with three installable workspaces: web/, python/, and docs/. Clone the repository and install each workspace:

Terminal window
# Clone the repository
git clone https://github.com/eigenvue/eigenvue.git
cd eigenvue
Terminal window
cd web
npm install
Terminal window
cd docs
npm install
Terminal window
cd python
pip install -e ".[dev]"

The -e flag installs the package in editable mode so your local changes are reflected immediately. The [dev] extra pulls in Ruff, mypy, pytest, and other development dependencies.

Terminal window
cd web
npm run dev

This starts the Next.js development server at http://localhost:3000 with hot module reloading. Changes to files in web/, shared/, and algorithms/ are picked up automatically.

Terminal window
cd docs
npm run dev

The Astro Starlight docs site starts at http://localhost:4321. MDX changes appear instantly in the browser.

Terminal window
# TypeScript tests (from web/)
cd web
npm run test # Run all Vitest tests
npm run test -- --watch # Watch mode
# Python tests (from python/)
cd python
pytest # Run all pytest tests
pytest -x # Stop on first failure

Understanding the monorepo layout helps you navigate the codebase:

eigenvue/
algorithms/ # Algorithm definitions (meta.json + generators)
classical/ # Binary search, sorting, graph traversal, etc.
deep-learning/ # Perceptron, backpropagation, convolution, etc.
generative-ai/ # Tokenization, attention, transformer block, etc.
web/ # Next.js web application
src/
engine/ # Rendering engine (layouts, animation, canvas)
generator/ # Generator runner and types
layouts/ # Layout functions and registry
animation/ # Animation and interpolation
canvas/ # Canvas manager and DPI handling
components/ # React components
python/ # PyPI package (eigenvue)
src/eigenvue/
generators/ # Python generator implementations
runner.py # Python generator runner
docs/ # Astro Starlight documentation site
src/content/docs/ # MDX documentation pages
shared/ # Cross-language types and schemas
types/ # Step, VisualAction, CodeHighlight definitions
fixtures/ # Golden test fixtures
validation/ # JSON Schema validators
scripts/ # Build and validation scripts
verify-step-parity.py # Cross-language parity checker
tests/ # Integration and end-to-end tests
  • algorithms/ contains meta.json (metadata) and generator.ts (TypeScript generator) for each algorithm. Python generators live under python/src/eigenvue/generators/.

  • shared/types/step.ts is the single source of truth for the Step interface. Both TypeScript and Python must produce identical JSON output for the same inputs.

  • web/src/engine/layouts/ contains layout functions that convert Step objects into PrimitiveScene objects for rendering. Each layout self-registers via registerLayout() in registry.ts.

BranchPurpose
mainStable, releasable state. Protected by CI.
feature/*New features (e.g., feature/add-linear-search).
fix/*Bug fixes (e.g., fix/canvas-dpi-scaling).
docs/*Documentation changes (e.g., docs/update-api-ref).

All work happens on feature branches created from main. When your branch is ready, open a pull request targeting main. At least one approval and all CI checks must pass before merging.

Terminal window
# Create a feature branch
git checkout main
git pull origin main
git checkout -b feature/add-linear-search

We follow the Conventional Commits specification. Every commit message must follow this structure:

<type>(<scope>): <description>
[optional body]
[optional footer(s)]
TypeWhen to Use
featA new feature (algorithm, layout, UI component)
fixA bug fix
docsDocumentation-only changes
styleFormatting, whitespace, no logic change
refactorCode restructuring without behavior change
testAdding or updating tests
choreBuild system, CI, dependencies, tooling

Use the workspace name as the scope: web, python, docs, shared, algorithms, or scripts.

feat(algorithms): add linear search generator and meta.json
fix(python): correct integer overflow in LCG PRNG implementation
test(web): add layout snapshot tests for array-with-pointers
docs: add contributing guide for cross-language parity
chore(web): upgrade Next.js to 15.1

Every pull request runs the following CI jobs. All must pass before merge:

CheckCommandWhat It Verifies
Lintnpm run lintESLint rules, no warnings
Typechecknpm run typecheckTypeScript strict mode, no errors
Testnpm run testAll Vitest tests pass
Buildnpm run buildNext.js production build succeeds
CheckCommandWhat It Verifies
Lintruff check .Ruff linting, no violations
Typecheckmypy src/mypy strict mode, no errors
TestpytestAll pytest tests pass
Terminal window
python scripts/verify-step-parity.py

This script verifies that Python dataclasses round-trip through JSON identically to the TypeScript interfaces. It is the final gate ensuring both languages produce byte-identical step output.

Once your development environment is ready: