# eVentSystem Local Setup — macOS/XAMPP

This guide is for a fresh local copy. Your existing development database can also be retained when upgrading.

## Requirements

- PHP 8.3+
- Composer 2
- MySQL/XAMPP
- Node.js is optional because `public/build` is already compiled; use it only when changing frontend source.

## Fresh local setup

1. Extract the project to `~/Documents/laravel-projects/eVentSystem`.
2. Start MySQL in XAMPP.
3. Create an empty MySQL database such as `pegls`.
4. Import `database.sql` through phpMyAdmin.
5. Copy `.env.example` to `.env`.
6. Edit the local `.env` values:

```dotenv
APP_ENV=local
APP_DEBUG=true
APP_URL=http://127.0.0.1:8004
DB_HOST=127.0.0.1
DB_DATABASE=pegls
DB_USERNAME=root
DB_PASSWORD=
```

7. In Terminal:

```bash
cd ~/Documents/laravel-projects/eVentSystem
composer install
php artisan key:generate
php artisan config:clear
bash start-eventsystem.sh
```

8. Open `http://127.0.0.1:8004`.

The local launcher sets PHP to allow 256M uploads while eVentSystem keeps its own 250 MB/file validation.

## Existing local database

If you are upgrading the existing FCST copy, keep its database and `.env`, then run only pending migrations:

```bash
php artisan migrate
```

Do **not** run `php artisan migrate:fresh`; it deletes existing tables/data.

If database asset records refer to media from an older project folder, also copy that installation's matching `storage/app/public/launch-assets` folder.
