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

# Local Setup

> Clone, install, and run HostMetrics locally in 5 minutes

# Local Development Setup

## 1. Clone the Repository

```bash theme={null}
git clone https://github.com/balasivapindra/TuroDashboard.git
cd TuroDashboard
```

## 2. Install Dependencies

```bash theme={null}
npm install
```

## 3. Configure Environment Variables

```bash theme={null}
cp .env.example .env.local
```

Edit `.env.local` with your Supabase credentials (see [Environment Variables](/getting-started/environment-variables) for the full reference):

```env theme={null}
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
```

## 4. Set Up the Database

Follow the [Supabase Setup](/getting-started/supabase-setup) guide to create your project and run migrations.

## 5. Start the Development Server

```bash theme={null}
npm run dev
```

Open [http://localhost:3000](http://localhost:3000). You should see the login page.

## 6. Create a User Account

1. Click "Sign Up" on the login page
2. Enter your email and password
3. Check your email for the confirmation link (or disable email confirmation in Supabase Auth settings for local dev)

## Common Commands

| Command                 | Purpose                      |
| ----------------------- | ---------------------------- |
| `npm run dev`           | Start dev server (port 3000) |
| `npm run build`         | Production build             |
| `npm run lint`          | Run ESLint                   |
| `npx tsc --noEmit`      | Type check without emitting  |
| `npm run test`          | Run unit tests (Vitest)      |
| `npm run test -- --run` | Run tests once (no watch)    |
| `npx playwright test`   | Run E2E tests                |

## Troubleshooting

<Accordion title="Port 3000 already in use">
  Kill the process using port 3000:

  ```bash theme={null}
  lsof -ti:3000 | xargs kill -9
  ```

  Or start on a different port:

  ```bash theme={null}
  npm run dev -- -p 3001
  ```
</Accordion>

<Accordion title="Supabase connection errors">
  1. Verify your `.env.local` values match Supabase Dashboard > Settings > API
  2. Ensure your Supabase project is active (free tier pauses after inactivity)
  3. Check that migrations have been run
</Accordion>

<Accordion title="TypeScript errors after pulling">
  ```bash theme={null}
  rm -rf node_modules .next
  npm install
  npm run dev
  ```
</Accordion>
