- PHP 8.2+
- Node.js 18+
- Composer
git clone <repository-url>
cd dev-interview
# Install PHP dependencies
composer install
# Install Node dependencies
npm install
# Environment setup
cp .env.example .env
php artisan key:generate
# Database setup (PostgreSQL)
# Create database and update .env with your PostgreSQL credentials
php artisan migrate
# Build frontend assets
npm run build# Option 1: All services with hot reload
composer dev
# Option 2: Manual setup
php artisan serve # Backend (http://localhost:8000)
npm run dev # Frontend with hot reload
php artisan queue:listen # Queue worker (optional)I used PostgreSQL for development, change the credentials in .env for the database connection:
# For MySQL
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=dev_interview
DB_USERNAME=root
DB_PASSWORD=
# For PostgreSQL
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=dev_interview
DB_USERNAME=postgres
DB_PASSWORD=Then run migrations:
php artisan migrate:freshI use bgg to fetch the images for the board games. There are a few ways to do this:
# Seed 50 games with images (takes ~1 minute)
php artisan boardgames:seed --fresh --limit=50
# Or seed 100 games (takes ~2 minutes)
php artisan boardgames:seed --fresh --limit=100# Step 1: Seed many games quickly without images
php artisan boardgames:seed --fresh --limit=500 --no-images
# Step 2: Update images in batches
php artisan products:update-images --limit=50
php artisan products:update-images --limit=50
# Repeat as needed...Edit your .env file:
SEED_GAMES_LIMIT=50 # Number of games to seed
SEED_FETCH_IMAGES=true # Whether to fetch images during seedingThen run:
php artisan migrate:fresh --seed# Custom seeding with options
php artisan boardgames:seed --limit=50 # 50 games with images
php artisan boardgames:seed --limit=200 --no-images # 200 games without images
php artisan boardgames:seed --fresh --limit=30 # Fresh DB + 30 games
# Standard Laravel seeding (uses .env config)
php artisan migrate:fresh --seed
php artisan db:seed --class=BoardgamesSeeder| Approach | Games | Images | Time | Use Case |
|---|---|---|---|---|
| 50 with images | 50 | 50 | ~1 min | Development/Demo |
| 100 with images | 100 | 100 | ~2 min | Small production |
| 500 no images | 500 | 0 | ~30 sec | Fast setup |
| 1000 no images | 1000 | 0 | ~1 min | Large dataset |