Chat mode imported from KristofferKarlAxelEkstrand/my-stack-lamp (
.github/chatmodes/project-dev.chatmode.md). Copyright stays with the author.
LAMP Stack Laravel Project Chatmode
Communication Style
Keep It Simple, Stupid (KISS): This chatmode values simplicity and clarity above all else. Responses should be:
- Clear and Concise: Get straight to the point without unnecessary verbosity
- Down to Earth: Use plain language and avoid technical jargon when simpler terms suffice
- Professional: Maintain a professional tone without emoticons, em-dashes, or excessive formatting
- Practical: Focus on actionable information and real solutions
- Direct: Provide straightforward answers without fluff or marketing speak
Project Overview
Technology Stack: Modern LAMP (Linux, Apache, MariaDB, PHP) stack with Laravel 12 framework
Architecture: Containerized development environment with Docker Compose, featuring Apache web server, MariaDB database, and modern frontend build system using Vite 7 and TailwindCSS 4
Core Technologies
Framework & Backend
-
Laravel 12.28.1 - PHP web framework with elegant syntax
- Requires PHP 8.2+ (current project uses PHP 8.2+)
- Provides robust tooling: dependency injection, unit testing, queues, real-time events
- Progressive framework that scales from simple to enterprise applications
- Built-in features: Eloquent ORM, Blade templating, Artisan CLI
- Includes Laravel Sail, Pint (code formatting), and Pail (log viewing)
-
PHP 8.3.25 - Server-side scripting language
- Modern PHP version with performance improvements and new features
- Extensions: PDO MySQL, GD, Xdebug, Opcache, BCMath, Mbstring, ZIP, Intl, SOAP
- Composer dependency management included
Database
- MariaDB 10.11 - MySQL-compatible relational database
- UTF8MB4 character set and collation
- Custom user setup with proper permissions
- Database initialization scripts support
Web Server
- Apache 2.4 - HTTP server
- Custom configuration in
.devcontainer/apache-config.conf - Document root configured for Laravel public directory
- Module rewrites enabled for clean URLs
- Runs on port 80 within container (mapped to host)
- Custom configuration in
Frontend Build System
-
Vite 7.1.4 - Next generation frontend build tool
- Lightning-fast HMR (Hot Module Replacement)
- ESM-first approach with modern JavaScript module system
- Laravel Vite plugin integration for seamless asset compilation
- Optimized build performance and development experience
-
TailwindCSS 4.1.13 - Utility-first CSS framework
- Integrated via
@tailwindcss/viteplugin - Modern CSS features with improved performance
- Configured in
vite.config.jsfor seamless integration - Zero-configuration content detection
- Integrated via
Development Tools
-
VS Code Dev Container - Containerized development environment
- Pre-configured with Laravel, PHP, and Blade extensions
- Includes Intelephense for PHP IntelliSense and Xdebug for debugging
- TailwindCSS IntelliSense and Thunder Client for API testing
- Auto-forwarding of ports 80 (Laravel), 3306 (MariaDB), 8080 (phpMyAdmin)
- Node.js 20.19.5 - Latest LTS version for optimal Vite performance
- Additional Tools: htop, tree for system monitoring and file exploration
-
Docker Compose - Multi-container orchestration
- Web service (custom PHP-Apache build from
.devcontainer/Dockerfile) - MariaDB 10.11 service with persistent volumes
- phpMyAdmin 5.2 for database management
- Custom bridge network (
lamp-network) for inter-service communication
- Web service (custom PHP-Apache build from
-
Concurrently - Parallel command execution
- Configured in
composer.jsonfor running multiple development services - Starts Laravel server, queue worker, log viewer (Pail), and Vite dev server simultaneously
- Configured in
Project Structure
my-stack-lamp/
├── .devcontainer/ # VS Code Dev Container configuration
│ ├── devcontainer.json # Container settings, extensions, and port forwarding
│ ├── Dockerfile # Custom PHP 8.2+-Apache image
│ ├── apache-config.conf # Apache virtual host configuration
│ ├── php.ini # PHP configuration overrides
│ └── post-create.sh # Post-container creation setup script
├── .github/ # GitHub workflows and chatmodes
│ └── chatmodes/ # Project-specific AI assistant configurations
├── docker-compose.yml # Multi-service container orchestration
├── mysql-init/ # MariaDB initialization scripts
│ └── 01-init.sql # Database setup SQL
├── public/ # Laravel public directory (web root)
├── resources/ # Laravel resources (views, CSS, JS)
├── routes/ # Laravel routing files
├── database/ # Laravel database files, migrations, and SQLite
├── config/ # Laravel configuration files
├── composer.json # PHP dependencies and custom scripts
├── package.json # Node.js dependencies and build scripts
├── vite.config.js # Vite build configuration with Laravel and TailwindCSS
├── phpunit.xml # PHPUnit testing configuration
└── .env # Environment variables (create from .env.example)
Quick Start
Prerequisites
- Docker Desktop installed and running
- VS Code with Dev Containers extension
Launch Development Environment
-
Open in Dev Container: VS Code will automatically detect and offer to reopen in container
-
Container Setup: The
post-create.shscript will run automatically to set up the environment -
Install Dependencies:
composer install npm install -
Start Development Services:
composer run devThis starts Laravel server, queue worker, Pail log viewer, and Vite dev server concurrently
-
Access Application: http://localhost:80 (or configured port)
Available Services
- Web Application: http://localhost:80 (Laravel app)
- phpMyAdmin: http://localhost:8080 (Database management)
- MariaDB: localhost:3306 (Direct database access)
Development Workflow
Frontend Development
- Build System: Vite 7 with Laravel plugin handles asset compilation and HMR
- Styling: TailwindCSS 4 with Vite plugin integration
- Entry Points:
resources/css/app.cssandresources/js/app.js - Hot Reload: Automatic browser refresh on file changes via Vite dev server
Backend Development
- Framework: Laravel 12 with modern PHP 8.2+ features
- Database: MariaDB 10.11 with Eloquent ORM
- Environment: SQLite for local development (see
database/database.sqlite) - Debugging: Xdebug configured for VS Code integration
- Testing: PHPUnit 11.5.3 for unit and feature tests
- Tools: Laravel Pint for code formatting, Laravel Pail for log viewing
Container Architecture
- Web Container: Custom PHP 8.2+-Apache built from
.devcontainer/Dockerfile - Database Container: MariaDB 10.11 with persistent storage (
mariadb_datavolume) - Admin Container: phpMyAdmin 5.2 for database management interface
- Networking: Custom bridge network (
lamp-network) for secure inter-service communication - Volumes: Persistent database storage and log file mapping
Environment Configuration
Database Connection
DB_CONNECTION=mysql
DB_HOST=mariadb
DB_PORT=3306
DB_DATABASE=laravel_app
DB_USERNAME=laravel_user
DB_PASSWORD=laravel_password
Application Settings
APP_NAME="LAMP Stack"
APP_ENV=local
APP_DEBUG=true
APP_URL=http://localhost:80
Key Features
Modern Development Stack
- Latest Laravel 12 framework with PHP 8.2+
- Vite 7 for blazing-fast frontend builds with Laravel integration
- TailwindCSS 4 with Vite plugin for optimal performance
- Full Docker containerization with VS Code Dev Container support
- Concurrent development workflow with multiple services running in parallel
Developer Experience
- VS Code Dev Container with comprehensive Laravel development extensions
- Xdebug integration for step-through debugging
- Hot module replacement for instant frontend feedback
- Automatic dependency management and environment setup
- Laravel Pail for real-time log viewing
- Thunder Client extension for API testing within VS Code
Production Ready
- Optimized Docker images for deployment
- Environment-based configuration management
- Database migrations and seeding capabilities
- Asset optimization and minification via Vite
- PHPUnit testing framework integration
Best Practices
Development
- Use feature branches for new development
- Write tests for both frontend and backend code
- Follow Laravel coding standards and conventions
- Utilize VS Code extensions for enhanced productivity
Deployment
- Environment variables for configuration management
- Database migrations for schema changes
- Asset compilation for production builds
- Container orchestration for scalable deployment
Performance
- Vite's optimized build system for fast compilation
- TailwindCSS purging for minimal CSS bundle size
- Laravel's built-in caching mechanisms
- Optimized Docker images with minimal layers
Testing
Backend Testing
- PHPUnit 11.5.3: Unit and feature testing framework
- Laravel Testing: Built-in testing utilities and database factories
- Coverage: Code coverage reporting with Xdebug
Frontend Testing
- Vite Testing: Integrated testing support
- Browser Testing: Laravel Dusk for end-to-end testing
- Component Testing: Individual component testing capabilities
Common Commands
Development
# Start all development services concurrently (Laravel server, queue, logs, Vite)
composer run dev
# Install PHP dependencies
composer install
# Install Node.js dependencies
npm install
# Run Laravel migrations
php artisan migrate
# Generate application key
php artisan key:generate
# Run queue worker
php artisan queue:listen
# View real-time logs with Pail
php artisan pail
Code Quality
# Format code with Laravel Pint
./vendor/bin/pint
# Format frontend files with Prettier
npm run format
# Check formatting without making changes
npm run format:check
# Format only markdown files
npm run format:md
# Update and audit dependencies
npm run fix
Testing
# Run all PHP tests with Laravel's test command
composer run test
# Run PHPUnit directly
./vendor/bin/phpunit
# Run specific test file
php artisan test --filter=ExampleTest
# Run tests with coverage (if configured)
./vendor/bin/phpunit --coverage-html coverage
Build
# Build for production
npm run build
# Watch for changes during development
npm run dev
Troubleshooting
Common Issues
- Docker Desktop Not Running: Ensure Docker Desktop is started before opening Dev Container
- Port Conflicts: Check if ports 80, 8080, 3306 are available on your host system
- Permission Issues: Verify container user permissions for file access and volume mounting
- Missing Dependencies: Run
composer installandnpm installafter container setup - Database Connection: Ensure MariaDB container is running and environment variables are correct
Debug Steps
- Check Container Status:
docker-compose psto verify all services are running - View Container Logs:
docker-compose logs [service-name](web, mariadb, phpmyadmin) - Verify Environment: Check
.envfile matchesdocker-compose.ymldatabase settings - Test Database Connection: Use phpMyAdmin at http://localhost:8080
- Check Laravel Logs: View
storage/logs/laravel.logor usephp artisan pail - Restart Services:
docker-compose down && docker-compose up -d
Technology Notes
Laravel 12 Benefits
- Progressive Framework: Grows with developer skill level and project complexity
- Scalable Architecture: Handles everything from prototypes to enterprise workloads
- Rich Ecosystem: Extensive package repository and active community
- Modern PHP: Leverages PHP 8.2+ features and performance improvements
- Built-in Tools: Sail for Docker, Pint for formatting, Pail for logging
TailwindCSS 4 Advantages
- Vite Integration: Seamless integration via
@tailwindcss/viteplugin - Performance: Optimized build times and output
- Modern Features: Latest CSS capabilities and improved developer experience
- Zero Config: Automatic content detection and purging
Vite 7 Improvements
- Laravel Integration: Native Laravel Vite plugin support
- Fast HMR: Lightning-fast hot module replacement
- Node.js 20+: Latest runtime requirements (now running Node.js 20.19.5)
- Optimized Builds: Efficient bundling for production deployments
Development Container Benefits
- Consistent Environment: Same development setup across all team members
- Pre-configured Tools: All necessary extensions and settings included
- Isolated Dependencies: No need to install PHP, Composer, or Node.js locally
- Easy Onboarding: One-click setup for new developers
This chatmode provides comprehensive guidance for working with this modern LAMP stack implementation, emphasizing the Docker-first development approach and modern web technologies integration.