Skip to main content

Overview

This guide covers setting up a complete development environment for the Olis monorepo, including all necessary tools, configurations, and best practices.

System Requirements

Operating Systems

  • Windows 10/11
  • macOS 12+
  • Ubuntu 20.04+ / Debian-based Linux

Hardware

  • 8GB RAM minimum (16GB recommended)
  • 10GB free disk space
  • Multi-core processor

Required Tools

Core Development Tools

# Install Node.js v18+ from https://nodejs.org/

# Verify installation
node --version  # Should be v18.0.0 or higher

# Install pnpm globally
npm install -g [email protected]

# Verify pnpm
pnpm --version
Why pnpm?
  • Efficient disk space usage
  • Faster installs than npm/yarn
  • Better monorepo support
  • Strict dependency resolution

IDE Setup

1

Install VS Code

Download from code.visualstudio.com
2

Install recommended extensions

// .vscode/extensions.json
{
  "recommendations": [
    "dbaeumer.vscode-eslint",
    "esbenp.prettier-vscode",
    "ms-python.python",
    "rust-lang.rust-analyzer",
    "bradlc.vscode-tailwindcss",
    "nrwl.angular-console"
  ]
}
Install all at once:
  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Type “Extensions: Show Recommended Extensions”
  3. Click “Install All”
3

Configure workspace settings

// .vscode/settings.json
{
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "typescript.tsdk": "node_modules/typescript/lib",
  "python.linting.enabled": true,
  "python.formatting.provider": "black",
  "[rust]": {
    "editor.defaultFormatter": "rust-lang.rust-analyzer"
  }
}

Repository Setup

1

Clone the repository

git clone https://github.com/yourusername/olis-monorepo.git
cd olis-monorepo
2

Install dependencies

# Install JavaScript/TypeScript dependencies
pnpm install

# Install Python dependencies
pip install -r requirements.txt

# Or with poetry
poetry install
3

Set up environment variables

# Copy example env file
cp .env.example .env

# Edit with your values
nano .env  # or use your preferred editor
Key variables to configure:
# API Configuration
OLIS_API_URL=http://localhost:8000

# Intent Detection
OLIS_INTENT_MODEL=phi3
OLIS_INTENT_REMOTE_URL=http://localhost:11434

# Document Folder
OLIS_DOCS_FOLDER=/path/to/your/docs

# Database (for API server)
DATABASE_URL=postgresql://user:pass@localhost/olis
REDIS_URL=redis://localhost:6379
4

Build native modules

cd apps/electron-client
pnpm run sidecar:build
cd ../..
5

Verify installation

# Run tests
pnpm test

# Lint code
pnpm lint

# View project graph
pnpm nx graph

Docker Setup (Optional)

For containerized development:
  1. Install Docker Desktop
  2. Verify installation:
    docker --version
    docker-compose --version
    
  3. Start Docker Desktop

Workflow Tools

Nx Console

Nx Console provides a GUI for running Nx commands:
1

Install extension

Search for “Nx Console” in VS Code extensions
2

Access the console

Click the Nx icon in the sidebar or use Command Palette
3

Run tasks visually

  • Select a project
  • Choose a task (build, serve, test, lint)
  • Click Run

Pre-commit Hooks

Set up Git hooks for quality checks:
# Install husky
pnpm add -D husky

# Initialize husky
pnpm husky install

# Add pre-commit hook
pnpm husky add .husky/pre-commit "pnpm lint-staged"
Configure lint-staged in package.json:
{
  "lint-staged": {
    "*.{ts,tsx,js,jsx}": ["eslint --fix", "prettier --write"],
    "*.py": ["black", "isort"],
    "*.{json,md,yml,yaml}": ["prettier --write"]
  }
}

Development Workflow

Daily Development

Running Applications

cd apps/electron-client

# Development mode with hot reload
pnpm run electron:dev

# Or just the Next.js dev server
pnpm run dev

Running Tests

# Run all tests
pnpm test

# Run tests for specific app
pnpm nx test electron-client
pnpm nx test api-server

# Watch mode
pnpm nx test electron-client --watch

# With coverage
pnpm nx test electron-client --coverage

Troubleshooting

# Clear pnpm cache
pnpm store prune

# Delete node_modules and lockfile
rm -rf node_modules pnpm-lock.yaml

# Reinstall
pnpm install

# If still failing, check Node version
node --version  # Should be 18+
# Update Rust
rustup update

# Check for missing build tools
# Windows: Install Visual Studio Build Tools
# macOS: xcode-select --install
# Linux: sudo apt install build-essential

# Clean and rebuild
cargo clean
cargo build --release
# Use virtual environment
python -m venv venv
source venv/bin/activate  # Unix
.\venv\Scripts\activate   # Windows

# Upgrade pip
pip install --upgrade pip

# Install dependencies
pip install -r requirements.txt
# Clear Nx cache
pnpm nx reset

# Reinstall dependencies
pnpm install

# Update Nx
pnpm add -D nx@latest

Next Steps