> ## Documentation Index
> Fetch the complete documentation index at: https://docs.olis-ai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Set up your Olis development environment in minutes

## Prerequisites

Before you begin, ensure you have the following installed:

* **Node.js** (v18 or higher)
* **pnpm** (v9.15.4 or higher)
* **Python** (v3.9 or higher)
* **Rust** (latest stable) - for native modules
* **Git** - for version control

<AccordionGroup>
  <Accordion icon="node-js" title="Install Node.js and pnpm">
    ```bash theme={null}
    # Install Node.js from https://nodejs.org/

    # Install pnpm globally
    npm install -g pnpm@9.15.4
    ```
  </Accordion>

  <Accordion icon="python" title="Install Python">
    ```bash theme={null}
    # Download Python from https://www.python.org/downloads/

    # Verify installation
    python --version
    ```
  </Accordion>

  <Accordion icon="rust" title="Install Rust">
    ```bash theme={null}
    # Install Rust using rustup
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

    # Verify installation
    rustc --version
    ```
  </Accordion>
</AccordionGroup>

## Installation

<Steps>
  <Step title="Clone the Repository">
    ```bash theme={null}
    git clone https://github.com/BowArrow/olis.git
    cd olis
    ```
  </Step>

  <Step title="Install Dependencies">
    ```bash theme={null}
    # Install JavaScript/TypeScript dependencies
    pnpm install

    # Install Python dependencies
    pip install -r requirements.txt
    ```
  </Step>

  <Step title="Set Up Environment Variables">
    Create a `.env` file in the root directory:

    ```bash theme={null}
    # Copy example env file
    cp .env.example .env

    # Edit .env with your configuration
    ```

    Key environment variables:

    * `OLIS_INTENT_MODEL` - Model name for intent detection
    * `OLIS_INTENT_REMOTE_URL` - URL for hosted intent service
    * `OLIS_DOCS_FOLDER` - Path to document folder for context
  </Step>

  <Step title="Build Native Modules">
    ```bash theme={null}
    # Build Rust native modules
    cd apps/electron-client
    pnpm run sidecar:build
    cd ../..
    ```
  </Step>
</Steps>

## Running the Applications

### Electron Desktop Client

<CodeGroup>
  ```bash Development Mode theme={null}
  cd apps/electron-client
  pnpm run electron:dev
  ```

  ```bash Production Build theme={null}
  cd apps/electron-client
  pnpm run build
  pnpm run build:electron
  pnpm run package
  ```
</CodeGroup>

The desktop application will start on `http://localhost:3000` in development mode.

### API Server

<CodeGroup>
  ```bash Local Development theme={null}
  cd apps/api-server
  python -m uvicorn main:app --reload
  ```

  ```bash Docker Compose theme={null}
  # Run with local configuration
  docker-compose -f docker-compose.local.yml up
  ```

  ```bash RAG Preflight Check theme={null}
  # PowerShell
  .\scripts\preflight_rag.ps1

  # Bash
  ./scripts/preflight_rag.sh
  ```
</CodeGroup>

### Chrome Extension

```bash theme={null}
cd apps/chrome-extension
pnpm run build

# Load the extension in Chrome:
# 1. Open chrome://extensions/
# 2. Enable "Developer mode"
# 3. Click "Load unpacked"
# 4. Select the apps/chrome-extension/dist directory
```

## Verify Installation

Run the following commands to verify everything is set up correctly:

<AccordionGroup>
  <Accordion title="Check All Apps">
    ```bash theme={null}
    # From the root directory
    pnpm run build
    pnpm run test
    pnpm run lint
    ```
  </Accordion>

  <Accordion title="Verify Nx Setup">
    ```bash theme={null}
    pnpm nx graph
    ```

    This will open a browser showing your project's dependency graph.
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Explore Architecture" icon="diagram-project" href="/architecture">
    Learn about the system architecture and design patterns
  </Card>

  <Card title="Development Guide" icon="code" href="/development/setup">
    Deep dive into development workflows and best practices
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Explore the API endpoints and integration options
  </Card>

  <Card title="Contributing" icon="hand-holding-heart" href="/development/contributing">
    Learn how to contribute to the Olis project
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Native Module Build Failures">
    If you encounter errors building native modules:

    ```bash theme={null}
    # Clean and rebuild
    pnpm run clean
    pnpm install

    # Rebuild native modules specifically
    cd apps/electron-client
    pnpm run install-app-deps
    ```

    **Windows Note**: If Electron is running, it may lock `keytar.node`. Stop all Electron instances before rebuilding.
  </Accordion>

  <Accordion title="Port Already in Use">
    If port 3000 is already in use:

    ```bash theme={null}
    # Find and kill the process using port 3000
    # Windows
    netstat -ano | findstr :3000
    taskkill /PID <PID> /F

    # macOS/Linux
    lsof -ti:3000 | xargs kill -9
    ```
  </Accordion>

  <Accordion title="Python Environment Issues">
    If you encounter Python dependency issues:

    ```bash theme={null}
    # Create a virtual environment
    python -m venv venv

    # Activate it
    # Windows
    .\venv\Scripts\activate

    # macOS/Linux
    source venv/bin/activate

    # Install dependencies
    pip install -r requirements.txt
    ```
  </Accordion>
</AccordionGroup>
