- Node.js 22 (LTS) — use
.nvmrc:nvm use - Rust stable — use
rust-toolchain.toml:rustup show - wasm-pack —
cargo install wasm-pack
git clone https://github.com/miniscope/CaLab.git
cd CaLab
nvm use # Node 22
npm install # JS dependencies (all workspaces)
npm run build:wasm # Compile Rust → WASM (only needed if changing solver)
npm run dev # Start dev serverCaLab is an npm workspaces monorepo:
| Workspace | Path | Description |
|---|---|---|
catune |
apps/catune/ |
SolidJS app — deconvolution parameter tuning |
carank |
apps/carank/ |
SolidJS app — CNMF trace quality ranking |
@calab/core |
packages/core/ |
Shared types, pure math, WASM adapter |
@calab/compute |
packages/compute/ |
Generic worker pool, warm-start cache |
@calab/io |
packages/io/ |
File parsers (.npy/.npz), validation, export |
@calab/community |
packages/community/ |
Supabase DAL, submission logic, field options |
@calab/tutorials |
packages/tutorials/ |
Tutorial type definitions, progress persistence |
@calab/ui |
packages/ui/ |
Shared layout: Shell, Panel, VizLayout |
All packages are consumed as TypeScript source — Vite transpiles them directly via path aliases. No separate build step needed for development.
Run from the repo root:
| Script | Description |
|---|---|
npm run dev |
Start CaTune dev server |
npm run dev:carank |
Start CaRank dev server |
npm run build |
Build WASM + both apps |
npm run build:pages |
Build + combine dist for GitHub Pages |
npm run build:wasm |
Compile Rust solver to WASM |
npm run test |
Run Vitest tests across all workspaces |
npm run test:watch |
Run tests in watch mode (apps/catune) |
npm run lint |
Run ESLint on apps/ + packages/ |
npm run lint:fix |
Auto-fix ESLint issues |
npm run typecheck |
Run TypeScript type checking (all packages + app) |
npm run format |
Format all files with Prettier |
npm run format:check |
Check formatting (CI gate) |
You can also run scripts in a specific workspace:
npm run dev -w apps/catune # Start CaTune dev server
npm run dev -w apps/carank # Start CaRank dev server
npm run test -w apps/catune # Run app tests only
npm run test -w packages/io # Run io package tests only- Create
packages/<name>/withpackage.json,tsconfig.json, andsrc/index.ts - Add
@calab/<name>toapps/catune/package.jsondependencies as"*" - Add path mapping to
apps/catune/tsconfig.jsonandapps/catune/vite.config.ts - Add the package to the root
typecheckscript inpackage.json - Run
npm installto link the workspace
Code style is enforced automatically:
- Prettier — single quotes, trailing commas, 100 char width
- ESLint — TypeScript recommended + SolidJS plugin + boundary rules
- TypeScript — strict mode, project build mode for type checking
Run npm run lint && npm run format:check && npm run typecheck before pushing.
ESLint enforces these import boundaries:
- WASM: Only
packages/core/src/wasm-adapter.tsmay import fromcrates/solver/pkg/ - Supabase: Only
packages/community/src/supabase.tsmay import@supabase/supabase-js - Package barrels: App files import from
@calab/<pkg>, never from@calab/<pkg>/src/*
The CI pipeline runs on every PR to main:
- Format check (
prettier --check) - Lint (
eslint) - Type check (
tsc -b) - Tests (
vitest runacross all workspaces) - Build (
vite build)
The WASM package is committed to the repo, so CI does not require Rust.
- Use descriptive commit messages:
feat:,fix:,refactor:,docs:,chore: - Keep commits focused — one logical change per commit
- The formatting commit (Prettier) should be separate from logic changes
See ARCHITECTURE.md for module layout, dependency DAG, state management patterns, and boundary rules.
CaLab is licensed under the MIT License.