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.
Prerequisites
Section titled “Prerequisites”Before you begin, make sure the following tools are installed and available on
your PATH:
| Tool | Minimum Version | Check Command |
|---|---|---|
| Node.js | 20.0 | node --version |
| npm | 10.0 | npm --version |
| Python | 3.10 | python --version |
| pip | 22.0 | pip --version |
| Git | 2.30 | git --version |
Clone and Install
Section titled “Clone and Install”Eigenvue is a monorepo with three installable workspaces: web/, python/, and
docs/. Clone the repository and install each workspace:
# Clone the repositorygit clone https://github.com/eigenvue/eigenvue.gitcd eigenvueWeb Application (Next.js)
Section titled “Web Application (Next.js)”cd webnpm installDocumentation Site (Starlight)
Section titled “Documentation Site (Starlight)”cd docsnpm installPython Package
Section titled “Python Package”cd pythonpip 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.
Running Locally
Section titled “Running Locally”Web Dev Server
Section titled “Web Dev Server”cd webnpm run devThis 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.
Docs Dev Server
Section titled “Docs Dev Server”cd docsnpm run devThe Astro Starlight docs site starts at http://localhost:4321. MDX changes appear instantly in the browser.
Running Tests
Section titled “Running Tests”# TypeScript tests (from web/)cd webnpm run test # Run all Vitest testsnpm run test -- --watch # Watch mode
# Python tests (from python/)cd pythonpytest # Run all pytest testspytest -x # Stop on first failureProject Structure Overview
Section titled “Project Structure Overview”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 testsKey Relationships
Section titled “Key Relationships”-
algorithms/containsmeta.json(metadata) andgenerator.ts(TypeScript generator) for each algorithm. Python generators live underpython/src/eigenvue/generators/. -
shared/types/step.tsis the single source of truth for theStepinterface. Both TypeScript and Python must produce identical JSON output for the same inputs. -
web/src/engine/layouts/contains layout functions that convertStepobjects intoPrimitiveSceneobjects for rendering. Each layout self-registers viaregisterLayout()inregistry.ts.
Branch Strategy
Section titled “Branch Strategy”| Branch | Purpose |
|---|---|
main | Stable, 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.
# Create a feature branchgit checkout maingit pull origin maingit checkout -b feature/add-linear-searchCommit Message Format
Section titled “Commit Message Format”We follow the Conventional Commits specification. Every commit message must follow this structure:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]| Type | When to Use |
|---|---|
feat | A new feature (algorithm, layout, UI component) |
fix | A bug fix |
docs | Documentation-only changes |
style | Formatting, whitespace, no logic change |
refactor | Code restructuring without behavior change |
test | Adding or updating tests |
chore | Build system, CI, dependencies, tooling |
Scopes
Section titled “Scopes”Use the workspace name as the scope: web, python, docs, shared,
algorithms, or scripts.
Examples
Section titled “Examples”feat(algorithms): add linear search generator and meta.jsonfix(python): correct integer overflow in LCG PRNG implementationtest(web): add layout snapshot tests for array-with-pointersdocs: add contributing guide for cross-language paritychore(web): upgrade Next.js to 15.1CI Checks That Must Pass
Section titled “CI Checks That Must Pass”Every pull request runs the following CI jobs. All must pass before merge:
Web CI
Section titled “Web CI”| Check | Command | What It Verifies |
|---|---|---|
| Lint | npm run lint | ESLint rules, no warnings |
| Typecheck | npm run typecheck | TypeScript strict mode, no errors |
| Test | npm run test | All Vitest tests pass |
| Build | npm run build | Next.js production build succeeds |
Python CI
Section titled “Python CI”| Check | Command | What It Verifies |
|---|---|---|
| Lint | ruff check . | Ruff linting, no violations |
| Typecheck | mypy src/ | mypy strict mode, no errors |
| Test | pytest | All pytest tests pass |
Cross-Language Parity
Section titled “Cross-Language Parity”python scripts/verify-step-parity.pyThis 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.
Next Steps
Section titled “Next Steps”Once your development environment is ready:
- Adding an algorithm? Read Adding an Algorithm.
- Working on layouts? Read Adding a Layout.
- Writing tests? Read Writing Tests.
- Need API details? Read The Generator API.