This guide covers setting up a development environment and contributing to Evo.
Evo is being rebuilt as a pnpm workspace around a headless simulation engine (see ADR 0001 and ADR 0002). The original app is archived in legacy/prototype.
- Node.js v22 or later
- pnpm, via corepack:
corepack enable(the version is pinned inpackage.json)
Run from the repository root:
| Command | Description |
|---|---|
pnpm install |
Install all workspace dependencies |
pnpm check |
Typecheck, lint (including dependency rules), and test |
pnpm build |
Compile-check every package and build the web app |
pnpm typecheck |
TypeScript checks for every package |
pnpm lint |
Dependency-rule check plus ESLint |
pnpm test |
Tool tests plus every package's Vitest suite |
pnpm format |
Format with Prettier (pnpm format:check verifies without writing) |
pnpm lint:deps |
Only the workspace dependency-rule check |
Packages live in packages/* (contracts, config, simulation, renderer, ui) and apps/* (web, desktop, simulator-cli). Allowed dependencies are documented in the dependency diagram and enforced in CI. The simulation package must stay headless and deterministic: no React, DOM, Electron, Math.random(), or wall-clock time.
The commands below apply to the archived prototype. Run them from legacy/prototype.
- Node.js v18 or later (Download)
- npm (comes with Node.js)
- Git (Download)
- VS Code (recommended) with extensions:
- ESLint
- Prettier
- TypeScript and JavaScript Language Features
-
Fork the repository on GitHub
-
Clone your fork
git clone https://github.com/YOUR_USERNAME/Evo.git cd Evo -
Install dependencies
npm install
-
Start development server
Web version (recommended for development):
npm run dev:web
Desktop version:
npm run dev
| Script | Description |
|---|---|
npm run dev:web |
Start web development server |
npm run dev |
Start Electron development app |
npm run build:web |
Build web version for production |
npm run build |
Build Electron app |
npm run build:win |
Build for Windows |
npm run build:mac |
Build for macOS |
npm run build:linux |
Build for Linux |
npm run lint |
Run ESLint |
npm run format |
Format code with Prettier |
npm run typecheck |
Run TypeScript type checking |
src/
├── main/ # Electron main process
├── preload/ # Electron preload scripts
└── renderer/ # React application
├── App.tsx # Root component
├── components/ # UI components
│ ├── SimulationCanvasNew.tsx # Main canvas
│ ├── Sidebar.tsx # Control sidebar
│ ├── DNAPanel.tsx # Agent info panel
│ └── ...
├── core/ # Simulation logic
│ ├── Agent.ts # Agent class
│ ├── NeuralNetwork.ts # Neural network
│ ├── EvolutionManager.ts # Evolution logic
│ └── utilities/ # Helpers
├── hooks/ # Custom React hooks
├── types/ # TypeScript types
└── assets/ # CSS and static assets
- Use strict TypeScript with proper typing
- Avoid
anytypes when possible - Use interfaces for object shapes
- Use functional components with hooks
- Keep components small and focused
- Use
useCallbackanduseMemoappropriately
- 2 spaces for indentation
- Single quotes for strings
- Semicolons required
- Run
npm run formatbefore committing
- ESLint is configured for the project
- Run
npm run lintto check for issues - All lint errors must be resolved before merging
-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write clean, well-documented code
- Follow existing patterns in the codebase
-
Test your changes
- Run the development server
- Test in both web and Electron modes if applicable
- Check for console errors
-
Lint and format
npm run lint npm run format npm run typecheck
-
Commit your changes
git add . git commit -m "feat: add your feature description"
-
Push and create PR
git push origin feature/your-feature-name
Then open a Pull Request on GitHub.
Follow conventional commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting)refactor:Code refactoringperf:Performance improvementstest:Adding testschore:Maintenance tasks
- Component-based architecture for UI
- Rich ecosystem and tooling
- TypeScript support
- High performance for many moving objects
- Direct control over rendering
- Efficient for 2D simulations
- Cross-platform desktop support
- Native OS integration
- File system access for saves
- Create file in
src/renderer/components/ - Export from component file
- Import and use in parent component
Example:
// src/renderer/components/MyComponent.tsx
import React from 'react'
interface MyComponentProps {
value: string;
}
export const MyComponent: React.FC<MyComponentProps> = ({ value }) => {
return <div>{value}</div>
}- Update type in
src/renderer/types/simulation.ts - Add default value in
src/renderer/core/utilities/AgentConfig.json - Add UI control in sidebar
- Use value in simulation logic
- Edit
src/renderer/core/Agent.ts - Update neural network inputs/outputs if needed
- Test extensively - small changes can have big effects!
- Edit
src/renderer/core/EvolutionManager.ts - Update types if adding new config options
- Add UI controls if user-configurable
- Use React DevTools for component inspection
- Console logs appear in browser console
- Network tab for any API calls
- DevTools automatically open in development
- Main process logs appear in terminal
- Use
console.logfor debugging
TypeScript errors:
- Run
npm run typecheckfor details - Check import statements
- Verify type definitions
Simulation bugs:
- Add console.log in update loop
- Reduce speed to observe behavior
- Check for NaN values in calculations
npm run build:web
# Output in ./dist/# All platforms
npm run build
# Specific platform
npm run build:win
npm run build:mac
npm run build:linux
# Output in ./release/- Questions: Open a GitHub Discussion
- Bugs: Open a GitHub Issue
- Features: Open a GitHub Issue with proposal
All contributions are subject to the MIT License. See LICENSE for details.