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

# Local dev

> Setting up your local dev environment using Herd

## Prerequisites

* Laravel Herd installed
* Git installed
* Flux Pro credentials (for Livewire components)

## Installation Steps

### 1. Clone the repository

```
git clone https://github.com/stuartbrameld/growth-method
cd growth-method
```

### 2. Install PHP dependencies

```
composer install
```

*Note: You'll be prompted for Flux Pro credentials during installation*

### 3. Install JavaScript dependencies

```
npm install
```

### 4. Set up environment file

```
cp .env.example .env
php artisan key:generate
```

### 5. Create local database

Create a new MySQL database named `growth_method`:

```
mysql -u root -e "CREATE DATABASE growth_method;"
```

*Note: Latest major version of MySQL 8 is fine*

### 6. Configure database connection

Update your `.env` file with:

```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=growth_method
DB_USERNAME=root
DB_PASSWORD=
```

### 7. Start Vite development server

```
npm run dev
```

*Keep this running in a separate terminal tab*

### 8. Access your application

Your site will be available at: `http://growth-method.test`

***

## Optional: Pull Production Database

If you need production data locally:

Use TablePlus, or export from Forge using the command below

```
ssh forge@your-server
mysqldump growth_method > growth_method.sql
exit
```

### Import locally

Use TablePlus or import to Forge using the command below

```
scp forge@your-server:~/growth_method.sql .
mysql -u root growth_method < growth_method.sql
```

### Local .ENV

Switch the filesystem to local storage

```
FILESYSTEM_DISK=local
PROFILE_PHOTO_DISK=public
```

Switch the Laravel Scout driver (used with Algolia for search indexing) to null

```
SCOUT_DRIVER=null
```

## Optional: Link Storage

If your application uses file uploads:

bash

```
php artisan storage:link
```

This creates a symbolic link from `public/storage` to `storage/app/public`.

***

## Troubleshooting

**Assets not loading?** Make sure `npm run dev` is running

**Database connection failed?** Verify MySQL is running in Herd and database credentials are correct

**Permission errors?** Ensure `storage/` and `bootstrap/cache/` directories are writable
