Skip to content

Development

Toshon edited this page Jun 20, 2026 · 1 revision

Development

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Git

Setup

git clone https://github.com/toshon-jennings/perci.git
cd perci
npm install

Scripts

Script Purpose
npm run dev Start Vite dev server (web only)
npm run build Production build
npm run preview Preview production build
npm run lint ESLint
npm run test Run tests (vitest)
npm run test:watch Run tests in watch mode
npm run electron:dev Start Electron dev mode (full desktop app)
npm run electron:build Package desktop app
npm run dist Build + package

Electron Dev Mode

npm run electron:dev

This starts both the Vite dev server and Electron. The Vite server runs on port 5173; Electron loads it.

Important: Changes to electron/preload.cjs or electron/main.cjs require a full Electron restart. Vite HMR only covers the renderer.

Packaging

npm run electron:build        # Default platform
npm run electron:build:mac    # macOS
npm run electron:build:win    # Windows
npm run electron:build:linux  # Linux

Output goes to dist_electron/.

Linting

npm run lint

ESLint configuration is in the project root.

Testing

npm run test

Tests use vitest. The test suite is minimal — contributions welcome.

Knowledge Graph Analysis

The renderer codebase is analyzed by graphify:

cd docs/architecture
graphify query "your query here"

This queries a graph of 564 nodes and 37 communities. See docs/architecture/GRAPHIFY.md for usage.

Project Conventions

  • Minimal code — write the smallest change that solves the problem
  • Reuse — prefer existing code over duplication
  • No unnecessary abstraction — avoid speculative layers
  • Match conventions — follow surrounding naming and patterns
  • Security — no eval, no shell injection, sanitize all external input

Clone this wiki locally