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

# Environment Setup

> Set up your development environment with all required tools

## Required Tools

<Steps>
  <Step title="Node.js & pnpm">
    ```bash theme={null}
    # Install Node.js 20+ via nvm
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
    nvm install 20
    nvm use 20

    # Install pnpm
    npm install -g pnpm
    ```
  </Step>

  <Step title="VS Code">
    Download from [code.visualstudio.com](https://code.visualstudio.com)

    Essential extensions:

    * ESLint
    * Prettier
    * Tailwind CSS IntelliSense
    * Prisma
    * GitLens
  </Step>

  <Step title="Claude Code Terminal">
    ```bash theme={null}
    # Install Claude CLI
    npm install -g @anthropic/claude-cli

    # Verify installation
    claude --version
    ```
  </Step>

  <Step title="Git Configuration">
    ```bash theme={null}
    git config --global user.name "Your Name"
    git config --global user.email "you@weventures.ai"
    git config --global init.defaultBranch main
    ```
  </Step>
</Steps>

## Development Stack

<Tabs>
  <Tab title="Frontend Tools">
    ```bash theme={null}
    # Essential global packages
    pnpm add -g vercel
    pnpm add -g @mintlify/cli
    ```

    ### Browser Extensions

    * React Developer Tools
    * Redux DevTools
    * Pesticide CSS
  </Tab>

  <Tab title="Backend Tools">
    ```bash theme={null}
    # Supabase CLI
    brew install supabase/tap/supabase

    # Database GUI (optional)
    # Download TablePlus or DBeaver
    ```
  </Tab>

  <Tab title="AI Development">
    ```bash theme={null}
    # Python for model work
    brew install python@3.11
    pip install langchain openai

    # Together AI CLI
    pip install together
    ```
  </Tab>
</Tabs>

## VS Code Settings

<CodeGroup>
  ```json settings.json theme={null}
  {
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.fixAll.eslint": true
    },
    "typescript.preferences.importModuleSpecifier": "relative",
    "typescript.updateImportsOnFileMove.enabled": "always",
    "tailwindCSS.experimental.classRegex": [
      ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
      ["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
    ]
  }
  ```

  ```json .vscode/extensions.json theme={null}
  {
    "recommendations": [
      "dbaeumer.vscode-eslint",
      "esbenp.prettier-vscode",
      "bradlc.vscode-tailwindcss",
      "prisma.prisma",
      "eamodio.gitlens",
      "github.copilot",
      "unifiedjs.vscode-mdx"
    ]
  }
  ```
</CodeGroup>

## Project Configuration

### TypeScript Config

```json tsconfig.json theme={null}
{
  "compilerOptions": {
    "target": "ES2022",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "noUncheckedIndexedAccess": true,
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"]
}
```

### ESLint & Prettier

<Accordion title="ESLint Configuration">
  ```javascript .eslintrc.js theme={null}
  module.exports = {
    extends: [
      'next/core-web-vitals',
      'prettier'
    ],
    rules: {
      '@typescript-eslint/no-unused-vars': 'error',
      '@typescript-eslint/no-explicit-any': 'warn',
      'react/no-unescaped-entities': 'off'
    }
  }
  ```
</Accordion>

<Accordion title="Prettier Configuration">
  ```json .prettierrc theme={null}
  {
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "es5",
    "printWidth": 80,
    "plugins": ["prettier-plugin-tailwindcss"]
  }
  ```
</Accordion>

### Git Hooks

```bash theme={null}
# Install husky and lint-staged
pnpm add -D husky lint-staged
pnpm husky init

# Configure pre-commit hook
echo "pnpm lint-staged" > .husky/pre-commit
```

```json package.json theme={null}
{
  "lint-staged": {
    "*.{js,jsx,ts,tsx}": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.{json,md,mdx}": [
      "prettier --write"
    ]
  }
}
```

## Environment Variables

### Local Development

```bash .env.local theme={null}
# Supabase
NEXT_PUBLIC_SUPABASE_URL=https://[project].supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...
SUPABASE_SERVICE_KEY=eyJ...

# AI Services
OPENAI_API_KEY=sk-...
LANGCHAIN_API_KEY=ls_...
TOGETHER_API_KEY=...

# Monitoring
SENTRY_DSN=https://...
NEXT_PUBLIC_SENTRY_DSN=https://...

# Feature Flags
NEXT_PUBLIC_ENABLE_AI=true
```

<Warning>
  Never commit `.env.local` files. Use `.env.example` as a template and store actual values in 1Password or environment-specific vaults.
</Warning>

## Database Setup

<Steps>
  <Step title="Install Supabase CLI">
    ```bash theme={null}
    brew install supabase/tap/supabase
    ```
  </Step>

  <Step title="Login to Supabase">
    ```bash theme={null}
    supabase login
    ```
  </Step>

  <Step title="Link Project">
    ```bash theme={null}
    supabase link --project-ref [project-ref]
    ```
  </Step>

  <Step title="Pull Schema">
    ```bash theme={null}
    supabase db pull
    ```
  </Step>
</Steps>

## Testing Tools

<CardGroup cols={2}>
  <Card title="Unit Testing" icon="vial">
    ```bash theme={null}
    pnpm add -D vitest @testing-library/react
    ```
  </Card>

  <Card title="E2E Testing" icon="robot">
    ```bash theme={null}
    pnpm add -D playwright @playwright/test
    ```
  </Card>
</CardGroup>

## Troubleshooting

<Accordion title="pnpm: command not found">
  ```bash theme={null}
  npm install -g pnpm
  # Or via corepack
  corepack enable
  corepack prepare pnpm@latest --activate
  ```
</Accordion>

<Accordion title="Permission denied errors">
  ```bash theme={null}
  # Fix npm permissions
  mkdir ~/.npm-global
  npm config set prefix '~/.npm-global'
  echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
  source ~/.zshrc
  ```
</Accordion>

<Accordion title="Port 3000 already in use">
  ```bash theme={null}
  # Find and kill process
  lsof -i :3000
  kill -9 [PID]

  # Or use different port
  PORT=3001 pnpm dev
  ```
</Accordion>

## Next Steps

<Steps>
  <Step title="Clone Expand AI">
    Follow the [Expand AI Setup](/getting-started/expand-ai-setup) guide
  </Step>

  <Step title="Join Slack">
    Connect with the team in #dev channel
  </Step>

  <Step title="Read Driver Docs">
    Review `claude.md`, `plan.md`, and `agents.md` in the repo
  </Step>
</Steps>
