This guide will help you set up a development environment for contributing to Flazz.
-
Node.js: Version 18 or higher
- Download from nodejs.org
- Verify:
node --version
-
pnpm: Version 8 or higher
- Install:
npm install -g pnpm - Verify:
pnpm --version
- Install:
-
Git: Latest version
- Download from git-scm.com
- Verify:
git --version
- VS Code: Recommended IDE with excellent TypeScript support
- GitHub Desktop: For easier Git workflow (optional)
- Windows: Windows 10 or later
- macOS: macOS 10.15 (Catalina) or later
- Linux: Ubuntu 20.04 or equivalent
# Clone your fork
git clone https://github.com/YOUR_USERNAME/flazz.git
cd flazz
# Add upstream remote
git remote add upstream https://github.com/flazz/flazz.gitFlazz uses pnpm with hoisted node-linker. Configure this before installing:
# Set node-linker to hoisted
pnpm config set node-linker hoistedOr create a .npmrc file in the project root:
node-linker=hoisted
# Install all dependencies
pnpm installThis will install dependencies for all workspace packages:
apps/main- Electron main processapps/renderer- React UIapps/preload- IPC bridgepackages/core- Business logicpackages/shared- Shared types
Create a .env file in the project root (optional for development):
# LLM Provider API Keys (optional - can be set in UI)
OPENAI_API_KEY=your_key_here
ANTHROPIC_API_KEY=your_key_here
# Development Settings
NODE_ENV=development
LOG_LEVEL=debug# Start the development server
pnpm run devThis will:
- Build the renderer in watch mode
- Build the main process in watch mode
- Start Electron with hot reload
The application will open automatically. Changes to code will trigger automatic rebuilds.
flazz/
├── apps/
│ ├── main/ # Electron main process
│ │ ├── src/
│ │ │ ├── main.ts # Entry point
│ │ │ ├── ipc.ts # IPC handlers
│ │ │ └── window.ts # Window management
│ │ └── package.json
│ ├── renderer/ # React UI
│ │ ├── src/
│ │ │ ├── App.tsx # Root component
│ │ │ ├── features/ # Feature modules
│ │ │ ├── components/ # Reusable components
│ │ │ └── hooks/ # React hooks
│ │ └── package.json
│ └── preload/ # IPC bridge
│ ├── src/
│ │ └── index.ts # Preload script
│ └── package.json
├── packages/
│ ├── core/ # Business logic
│ │ ├── src/
│ │ │ ├── agents/ # Agent runtime
│ │ │ ├── memory/ # Memory system
│ │ │ ├── skills/ # Skill management
│ │ │ ├── workspace/ # Workspace operations
│ │ │ └── integrations/ # External integrations
│ │ └── package.json
│ └── shared/ # Shared types
│ ├── src/
│ │ ├── ipc.ts # IPC contracts
│ │ ├── runs.ts # Run events
│ │ └── agent.ts # Agent types
│ └── package.json
├── docs/ # Documentation
├── scripts/ # Build and utility scripts
├── assets/ # Icons and images
└── package.json # Root package.json
Flazz uses pnpm workspaces for monorepo management:
- apps/main: Electron main process (Node.js environment)
- apps/renderer: React UI (browser environment)
- apps/preload: Secure IPC bridge
- packages/core: Application logic (Node.js environment)
- packages/shared: Shared contracts and types
User data is stored outside the repository:
- Windows:
%USERPROFILE%\Flazz - macOS:
~/Flazz - Linux:
~/Flazz
This directory contains:
memory/- Knowledge graph and memoriesskills/- User and AI-generated skillsworkspace/- Notes and documentsconfig/- User configuration
# Build all packages
pnpm run build
# Build specific package
pnpm --filter @flazz/renderer build
pnpm --filter @flazz/main build
pnpm --filter @flazz/core build
# Build in watch mode
pnpm run dev# Run ESLint on all packages
pnpm run lint
# Fix auto-fixable issues
pnpm run lint:fix
# Lint specific package
pnpm --filter @flazz/renderer lint# Type check all packages
pnpm run type-check
# Type check specific package
pnpm --filter @flazz/core type-check# Run all tests
pnpm run test
# Run tests in watch mode
pnpm run test:watch
# Run tests with coverage
pnpm run test:coverage
# Test specific package
pnpm --filter @flazz/core test# Package for current platform
pnpm --filter @flazz/main package
# Create distributable installer
pnpm --filter @flazz/main make# Clean build artifacts
pnpm run clean
# Clean and reinstall dependencies
pnpm run clean:all
pnpm installRecommended extensions:
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"ms-vscode.vscode-typescript-next",
"bradlc.vscode-tailwindcss"
]
}Recommended settings (.vscode/settings.json):
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}VS Code launch configuration (.vscode/launch.json):
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/apps/main",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"args": [".", "--remote-debugging-port=9223"],
"outputCapture": "std"
},
{
"name": "Debug Renderer Process",
"type": "chrome",
"request": "attach",
"port": 9223,
"webRoot": "${workspaceFolder}/apps/renderer",
"timeout": 30000
}
],
"compounds": [
{
"name": "Debug All",
"configurations": ["Debug Main Process", "Debug Renderer Process"]
}
]
}Issue: node-linker not set to hoisted
Solution:
pnpm config set node-linker hoisted
# or add to .npmrc
echo "node-linker=hoisted" > .npmrc
pnpm installIssue: Stale build artifacts
Solution:
pnpm run clean
pnpm install
pnpm run buildIssue: Main process build failed
Solution:
# Check for build errors
pnpm --filter @flazz/main build
# Check logs
# Look for errors in terminal outputIssue: Watch mode not detecting changes
Solution:
# Restart dev server
# Press Ctrl+C to stop
pnpm run devIssue: IDE using wrong TypeScript version
Solution:
- In VS Code: Press
Cmd/Ctrl+Shift+P - Type "TypeScript: Select TypeScript Version"
- Choose "Use Workspace Version"
Issue: Development server port is occupied
Solution:
# Find and kill process using port 5173 (renderer)
# Windows
netstat -ano | findstr :5173
taskkill /PID <PID> /F
# macOS/Linux
lsof -ti:5173 | xargs kill -9Issue: Node runs out of memory
Solution:
# Increase Node memory limit
export NODE_OPTIONS="--max-old-space-size=4096"
pnpm run buildIssue: Submodules not initialized
Solution:
git submodule update --init --recursive- Read the Architecture Overview
- Check the Contributing Guide
- Explore the Agent Guide
- Start with a good first issue
If you encounter issues not covered here:
- Check existing issues
- Search documentation
- Ask in discussions
- Create a new issue with the
questionlabel