Setup and run

Local Development Environment – Setup & Run

This guide walks you through configuring and running the Prep Network Events Laravel application on your local machine. You'll install dependencies, configure environment variables, import the database, clear caches, compile assets, and serve the app.

🔧 Prerequisites

Ensure you have the following installed and available in your terminal’s PATH:

  • Composer (PHP dependency manager)
  • Node.js & npm (JavaScript runtime and package manager)
  • MySQL (version 8.x recommended)
  • PHP (>= 8.1)

1. Clone & Install Dependencies

  1. Clone the repository and enter its folder:
   git clone https://github.com/prep-network/events.git
   cd events
  1. Install PHP packages without platform checks:
   composer install --ignore-platform-reqs
  1. Install front-end packages:
   npm install
  1. Compile development assets (starts Vite in watch mode):
   npm run dev

These steps set up the PHP backend, Blade views, Bootstrap/OneUI UI framework, Vue/Tailwind tooling and more .

2. Environment Configuration

  1. Copy the example environment file:
   cp .env.example .env
  1. Open .env and update your database credentials:
   DB_CONNECTION=mysql
   DB_HOST=127.0.0.1
   DB_PORT=3306
   DB_DATABASE=prep_events
   DB_USERNAME=your_user
   DB_PASSWORD=your_pass
  1. Generate a new application key:
   php artisan key:generate

3. Database Setup

Import the provided MySQL dump (ask your team for the latest .sql file):

mysql -u your_user -p prep_events < path/to/backup.sql

Ensure the DB_DATABASE in .env matches the imported database name .

4. Clear & Optimize Caches

Run the following to clear and optimize Laravel caches:

php artisan optimize
php artisan config:clear
php artisan route:clear
php artisan view:clear

This ensures configuration and route changes reflect immediately .

5. Serve the Application

You have two primary options:

Method Command Notes
Built-in PHP php artisan serve Runs on http://127.0.0.1:8000
Laravel Valet valet link eventsvalet secure events Ideal macOS dev environment; serves at https://events.test

6. Production Asset Build

When you’re ready to test a production-style build, compile and minify assets:

npm run build

This uses Vite to output optimized CSS/JS bundles .


Command Summary

Task Command
Clone repo git clone … && cd events
Install PHP deps composer install --ignore-platform-reqs
Install JS deps npm install
Dev assets (watch & compile) npm run dev
Prod assets (minify) npm run build
Copy environment cp .env.example .env
Generate app key php artisan key:generate
Import database mysql -u … -p db_name < backup.sql
Clear caches php artisan optimize && php artisan config:clear
Serve via Artisan php artisan serve
Serve via Valet valet link events && valet secure events

🎯 Tip: Always ensure your .env database settings match your local MySQL instance before serving.