Skip to content

Commit 2fd50c7

Browse files
committed
precheck
1 parent 601a815 commit 2fd50c7

File tree

3 files changed

+290
-18
lines changed

3 files changed

+290
-18
lines changed

README.md

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,42 +38,48 @@ curl -fsSL https://raw.githubusercontent.com/chrisbaswell/laravel-claude-code-se
3838

3939
### Setup Steps
4040

41-
1. **Start Herd services:**
41+
1. **Run pre-installation check (recommended):**
42+
```bash
43+
./pre-check.sh
44+
```
45+
This will verify all requirements and identify potential issues before installation.
46+
47+
2. **Start Herd services:**
4248
```bash
4349
# Herd automatically manages PHP, Nginx, and databases
4450
# Just ensure Herd is running and serving your project
4551
```
4652

47-
2. **Load development shortcuts:**
53+
3. **Load development shortcuts:**
4854
```bash
4955
source .claude/shortcuts.sh
5056
```
5157

52-
3. **Install dependencies:**
58+
4. **Install dependencies:**
5359
```bash
5460
composer install
5561
npm install
5662
```
5763

58-
4. **Install FluxUI and Volt (if not already installed):**
64+
5. **Install FluxUI and Volt (if not already installed):**
5965
```bash
6066
composer require livewire/flux livewire/volt
6167
php artisan flux:install
6268
php artisan volt:install
6369
```
6470

65-
5. **Install Playwright for end-to-end testing:**
71+
6. **Install Playwright for end-to-end testing:**
6672
```bash
6773
npx playwright install
6874
```
6975

70-
6. **Start development:**
76+
7. **Start development:**
7177
```bash
7278
npm run dev # Start Vite dev server
7379
# Herd automatically serves your Laravel app
7480
```
7581

76-
7. **Run tests:**
82+
8. **Run tests:**
7783
```bash
7884
pest # Run Laravel tests
7985
npm run test:e2e # Run Playwright E2E tests
@@ -327,6 +333,64 @@ After running `source .claude/shortcuts.sh`:
327333
- `test-e2e` - npm run test:e2e (Playwright)
328334
- `test-e2e-ui` - npm run test:e2e:ui (Playwright UI mode)
329335

336+
## Troubleshooting
337+
338+
### Common Installation Issues
339+
340+
**Database MCP Integration Skipped**
341+
```bash
342+
# Issue: "No database configured in .env file"
343+
# Solution: Configure database in .env
344+
DB_DATABASE=your_project_name
345+
DB_HOST=127.0.0.1
346+
DB_PORT=3306
347+
DB_USERNAME=root
348+
DB_PASSWORD=
349+
```
350+
351+
**Playwright Browser Installation Warning**
352+
```bash
353+
# Issue: Playwright warns about missing dependencies
354+
# Solution: Install Playwright in your project first
355+
npm install @playwright/test
356+
npx playwright install
357+
```
358+
359+
**Filesystem MCP Server Already Exists**
360+
```bash
361+
# Issue: "MCP server filesystem-[name] already exists"
362+
# Solution: This is normal and safe to ignore - server is already configured
363+
```
364+
365+
**npm Security Vulnerabilities**
366+
```bash
367+
# Issue: High severity vulnerabilities in fetch-mcp
368+
# Solution: Vulnerabilities are automatically fixed during installation
369+
# Or manually run: npm audit fix --force
370+
```
371+
372+
**Deprecated Package Warnings**
373+
```bash
374+
# Issue: GitHub MCP server shows deprecation warning
375+
# Solution: This is expected - the official server is deprecated but still functional
376+
```
377+
378+
### Quick Fixes
379+
380+
```bash
381+
# Reset MCP servers if issues occur
382+
claude mcp remove --all
383+
./setup.sh
384+
385+
# Check MCP server status
386+
claude mcp list
387+
388+
# Reinstall specific server
389+
cd ~/.config/claude-code/mcp-servers/
390+
rm -rf fetch-mcp
391+
# Run setup.sh again
392+
```
393+
330394
Happy coding with Laravel 12 + FluxUI + Livewire Volt + Claude Code! 🚀
331395

332396
## Production Deployment

pre-check.sh

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
#!/bin/bash
2+
3+
# Pre-installation check script for Laravel Claude Code Setup
4+
# Run this before setup.sh to identify potential issues
5+
6+
set -e
7+
8+
# Colors for output
9+
RED='\033[0;31m'
10+
GREEN='\033[0;32m'
11+
YELLOW='\033[1;33m'
12+
BLUE='\033[0;34m'
13+
NC='\033[0m' # No Color
14+
15+
print_status() {
16+
echo -e "${BLUE}[CHECK]${NC} $1"
17+
}
18+
19+
print_success() {
20+
echo -e "${GREEN}[PASS]${NC} $1"
21+
}
22+
23+
print_warning() {
24+
echo -e "${YELLOW}[WARN]${NC} $1"
25+
}
26+
27+
print_error() {
28+
echo -e "${RED}[FAIL]${NC} $1"
29+
}
30+
31+
print_header() {
32+
echo -e "${BLUE}=== $1 ===${NC}"
33+
}
34+
35+
echo "Laravel Claude Code Setup - Pre-Installation Check"
36+
echo "================================================="
37+
echo ""
38+
39+
ISSUES_FOUND=0
40+
41+
print_header "Laravel Project Verification"
42+
43+
# Check if we're in a Laravel project
44+
if [ ! -f "artisan" ] || [ ! -f "composer.json" ]; then
45+
print_error "Not a Laravel project directory"
46+
((ISSUES_FOUND++))
47+
else
48+
print_success "Laravel project detected"
49+
fi
50+
51+
# Check .env file
52+
if [ ! -f ".env" ]; then
53+
print_error ".env file not found"
54+
print_status "Copy .env.example to .env and configure it"
55+
((ISSUES_FOUND++))
56+
else
57+
print_success ".env file exists"
58+
59+
# Check database configuration
60+
if ! grep -q "^DB_DATABASE=" .env || grep -q "^DB_DATABASE=$" .env; then
61+
print_warning "DB_DATABASE not configured in .env"
62+
print_status "Database MCP integration will be skipped"
63+
print_status "To fix: Set DB_DATABASE=your_database_name in .env"
64+
else
65+
print_success "Database configuration found"
66+
fi
67+
fi
68+
69+
print_header "System Requirements"
70+
71+
# Check PHP version
72+
if command -v php &> /dev/null; then
73+
PHP_VERSION=$(php -r "echo PHP_VERSION;")
74+
if [[ $(echo "$PHP_VERSION 8.3" | awk '{print ($1 >= $2)}') == "1" ]]; then
75+
print_success "PHP $PHP_VERSION (meets Laravel 12 requirement)"
76+
else
77+
print_error "PHP $PHP_VERSION (Laravel 12 requires PHP 8.3+)"
78+
((ISSUES_FOUND++))
79+
fi
80+
else
81+
print_error "PHP not found"
82+
((ISSUES_FOUND++))
83+
fi
84+
85+
# Check Node.js version
86+
if command -v node &> /dev/null; then
87+
NODE_VERSION=$(node --version | sed 's/v//')
88+
NODE_MAJOR=$(echo $NODE_VERSION | cut -d. -f1)
89+
if [ "$NODE_MAJOR" -ge 20 ]; then
90+
print_success "Node.js $NODE_VERSION (meets requirement)"
91+
else
92+
print_warning "Node.js $NODE_VERSION (recommended: 20+)"
93+
fi
94+
else
95+
print_error "Node.js not found"
96+
((ISSUES_FOUND++))
97+
fi
98+
99+
# Check npm
100+
if command -v npm &> /dev/null; then
101+
NPM_VERSION=$(npm --version)
102+
print_success "npm $NPM_VERSION"
103+
else
104+
print_error "npm not found"
105+
((ISSUES_FOUND++))
106+
fi
107+
108+
# Check Git
109+
if command -v git &> /dev/null; then
110+
print_success "Git available"
111+
else
112+
print_error "Git not found (required for MCP server installation)"
113+
((ISSUES_FOUND++))
114+
fi
115+
116+
# Check Claude Code
117+
if command -v claude &> /dev/null; then
118+
CLAUDE_VERSION=$(claude --version 2>/dev/null || echo "unknown")
119+
print_success "Claude Code installed ($CLAUDE_VERSION)"
120+
else
121+
print_error "Claude Code not found"
122+
print_status "Install from: https://claude.ai/code"
123+
((ISSUES_FOUND++))
124+
fi
125+
126+
print_header "Optional Dependencies"
127+
128+
# Check Go (for database MCP server)
129+
if command -v go &> /dev/null; then
130+
GO_VERSION=$(go version | grep -o 'go[0-9]*\.[0-9]*' | grep -o '[0-9]*\.[0-9]*')
131+
print_success "Go $GO_VERSION (for database MCP server)"
132+
else
133+
print_warning "Go not found (database MCP server will be skipped)"
134+
print_status "Install Go from: https://golang.org/dl/"
135+
fi
136+
137+
# Check Laravel Herd
138+
if command -v herd &> /dev/null; then
139+
print_success "Laravel Herd available"
140+
else
141+
print_warning "Laravel Herd not found"
142+
print_status "Install from: https://herd.laravel.com"
143+
print_status "Recommended for optimal local development experience"
144+
fi
145+
146+
print_header "Project Dependencies"
147+
148+
# Check if composer.json has required packages
149+
if [ -f "composer.json" ]; then
150+
if grep -q "livewire/flux" composer.json; then
151+
print_success "FluxUI package found"
152+
else
153+
print_warning "FluxUI not installed"
154+
print_status "Will be installed during setup if you choose"
155+
fi
156+
157+
if grep -q "livewire/volt" composer.json; then
158+
print_success "Livewire Volt package found"
159+
else
160+
print_warning "Livewire Volt not installed"
161+
print_status "Will be installed during setup if you choose"
162+
fi
163+
fi
164+
165+
# Check package.json for Playwright
166+
if [ -f "package.json" ]; then
167+
if grep -q "@playwright/test" package.json; then
168+
print_success "Playwright test package found"
169+
else
170+
print_warning "Playwright not in package.json"
171+
print_status "Playwright browsers will need manual installation later"
172+
fi
173+
fi
174+
175+
echo ""
176+
print_header "Summary"
177+
178+
if [ $ISSUES_FOUND -eq 0 ]; then
179+
print_success "All requirements met! Ready to run setup.sh"
180+
echo ""
181+
echo "Run: ./setup.sh"
182+
else
183+
print_error "Found $ISSUES_FOUND critical issue(s) that need to be resolved"
184+
echo ""
185+
echo "Please fix the issues above before running setup.sh"
186+
fi
187+
188+
echo ""
189+
exit $ISSUES_FOUND

0 commit comments

Comments
 (0)