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

# Environment Setup

> Configure WSL2, ADB device bridging, and project environment variables.

# Setting Up Your Environment

This guide explains how to configure your development machine for building and running CommitT, with a focus on Windows WSL2 setups.

## WSL2 to Android Connectivity (ADB Bridge)

If you are developing inside WSL2 on Windows, the Android Debug Bridge (ADB) inside WSL cannot natively see devices plugged into Windows. You must bridge them using `socat` or TCP forwarding.

### Step 1: Start ADB Server on Windows

Open PowerShell on Windows and run:

```powershell theme={null}
adb kill-server
adb -a nodaemon server start
```

Keep this window open. This exposes the Windows ADB server on port `5037` to your network.

### Step 2: Configure WSL2 to use Windows ADB

Inside WSL2, point your local ADB client to the Windows host IP address:

1. Add the following to your `~/.bashrc` or `~/.zshrc`:
   ```bash theme={null}
   # Connect WSL ADB to Windows ADB host
   export ADB_SERVER_SOCKET=tcp:$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):5037
   ```
2. Reload your shell configuration:
   ```bash theme={null}
   source ~/.bashrc
   ```

### Step 3: Verify Connection

Verify your device is listed in WSL:

```bash theme={null}
adb devices
```

If you see your device (e.g., `Lenovo K12 Note`), the bridge is working!

***

## Environment Variables

Copy the `.env.example` templates in the monorepo packages to configure your local keys.

### 1. Backend (`packages/backend/.env.local`)

This file is automatically generated by Convex when you run `npx convex dev`, but you need to manually add the following keys for authentication and notifications:

```env theme={null}
BETTER_AUTH_SECRET="your-better-auth-secret"
EXPO_PROJECT_ID="your-expo-project-id"
```

### 2. Native Client (`apps/native/.env`)

Ensure the Expo client knows where to find the local Convex client:

```env theme={null}
EXPO_PUBLIC_CONVEX_URL="https://your-convex-deployment.convex.cloud"
```
