This script automates the setup of a new Laravel project integrated with pure Vue.js (v3), Vite (as the bundler), and Tailwind CSS for styling. It's designed for developers who want a manual, scaffold-free setup without using Laravel Breeze, Jetstream, or Inertia.js.
- Creates a fresh Laravel project.
- Installs Vue.js 3 and the Vite Vue plugin (compatible with Vite 7).
- Configures Vite for hot module replacement (HMR).
- Sets up Tailwind CSS v3 with PostCSS and Autoprefixer (avoids v4 init issues).
- Includes a root App.vuecomponent with a simple interactive counter demo styled with Tailwind.
- Updates the default welcome page to mount the Vue app.
- Optional: Downloads Docker configs for nginx, PHP, MySQL, and Supervisor for containerized development.
- PHP 8.2+ with Composer.
- Node.js 18+ with npm.
- Git (optional, for repo management).
- curland- bash(for direct script execution).
- For Docker: Docker and Docker Compose installed.
You can run the script directly from GitHub without downloading it (one-liner), or download it first for more control.
Run the script directly via curl and pipe to bash (includes the project name, optional Laravel port, and optional Vite port):
curl -s https://raw.githubusercontent.com/Urani-Solutions/laravel-vuejs-setup/refs/heads/main/create_laravel_vuejs.sh | bash -s my-project- Arguments: <project-name> [laravel-port] [vite-port]- Defaults: my-laravel-vue-app
 
- Defaults: 
- Note: This is convenient but less secure—review the script source first if concerned.
- 
Download the script: curl -O https://raw.githubusercontent.com/Urani-Solutions/laravel-vuejs-setup/refs/heads/main/create_laravel_vuejs.sh 
- 
Run the script with arguments: ./setup-laravel-vue.sh my-project - Defaults to my-laravel-vue-app(project) if not provided.
 
- Defaults to 
- 
Follow the on-screen instructions: - The script will create the project and configure everything.
- Start the Laravel dev server: php artisan serve --port=8000.
- In a new terminal, build/watch assets: npm run dev -- --port=5173.
- Open http://127.0.0.1:8000 to see the Vue app in action.
 
For production:
npm run buildDuring script execution, you'll be prompted: "Do you want to download Docker configuration files (nginx, php, db, supervisord) to run the project with Docker? (y/n)"
If you select y:
- Docker files will be downloaded to the project root.
- Key files include: docker-compose.yml,Dockerfile,.env,supervisord.conf, and configs in./docker/(nginx/app.conf, nginx/Dockerfile, php/local.ini, php/www.conf).
To run with Docker:
- Run: docker-compose up -d(builds and starts services: nginx, PHP-FPM, MySQL, Supervisor).
- Run migrations: docker-compose exec php php artisan migrate.
- For Vite assets: npm run dev.
- Access at http://localhost:9000(or your configured port).
Stop with: docker-compose down.
The script generates a standard Laravel structure with the following key additions/modifications for Vue.js, Vite, and Tailwind:
my-laravel-vue-app/
├── app/                     # Laravel app logic (controllers, models, etc.)
├── bootstrap/               # Laravel bootstrap files
├── config/                  # Laravel config
├── database/                # Migrations, factories, seeders
├── docker/                  # Docker configs (if selected)
│   └── nginx/
│   │   ├── app.conf
│   │   └── Dockerfile
│   └── php/
│       ├── local.ini
│       └── www.conf
├── public/                  # Public assets (index.php, etc.)
├── resources/
│   ├── css/
│   │   └── app.css          # Tailwind directives (@tailwind base; etc.)
│   ├── js/
│   │   ├── app.js           # Vue app entry point (imports App.vue)
│   │   ├── App.vue          # Root Vue component (counter demo with Tailwind)
│   │   └── bootstrap.js     # Laravel JS bootstrap (Axios, etc.)
│   └── views/
│       └── welcome.blade.php # Mounts Vue app (#app div with @vite)
├── routes/                  # Routes (web.php, etc.)
├── storage/                 # Logs, framework cache
├── tailwind.config.js       # Tailwind config (content paths for Blade/JS/Vue)
├── vite.config.js           # Vite config (Laravel + Vue plugins)
├── package.json             # Node dependencies (Vue, Tailwind, etc.)
├── postcss.config.js        # PostCSS config (for Tailwind)
├── docker-compose.yml       # Docker Compose (if selected)
├── Dockerfile               # App Dockerfile (if selected)
├── .env                     # Env (if selected)
├── supervisord.conf         # Supervisor config (if selected)
├── composer.json            # PHP dependencies
└── ... (other standard Laravel files)
- Vue Components: Add more components in resources/js/and import them inapp.js.
- Tailwind: Extend tailwind.config.jsfor custom themes.
- Routes: Update routes/web.phpto render other Blade views with Vue mounts.
- Docker: Customize docker-compose.ymlfor additional services or volumes.
- npm ERESOLVE (dependency conflicts): Ensure Node.js 22+; the script pins compatible versions (@vitejs/plugin-vue@^6.0.0 for Vite 7).
- npx tailwindcss init error: Script uses Tailwind v3 to avoid v4 CLI changes; if issues, run npm cache clean --forcebefore setup.
- Other npm errors: Delete node_modulesandpackage-lock.json, then rerunnpm install.
- Vite HMR not working: Check npm run devoutput for errors. Ensure ports are free.
- Docker issues: Ensure Docker is running; check logs with docker-compose logs.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to fork, improve, and submit pull requests! Contributors include:
- Urani Solutions
⭐ Star this repo if it helps you get started quickly!