lve-temp-jpz
v1.0.3
Published
Scaffold one Laravel-style template with Laravel, Vue, and Express.
Downloads
368
Maintainers
Readme
Laravel Vue Express Template CLI
lve-temp-jpz is a CLI that scaffolds one Laravel-style project with Vue and Express already wired in.
It helps you skip repetitive setup and start with a ready project shape, including health-check routes and a shared local dev flow.
What You Get
- Laravel 12 app structure
- Vue 3 frontend inside
resources/js - Express API server inside
server - Vite integration for the frontend
- Health-check endpoints for Laravel and Express
- Local scripts to run Laravel, Vite, and Express together
Requirements
- Node.js 18+
- PHP 8.2+
- Composer
Quick Start
Create a new folder and scaffold into it:
npx lve-temp-jpz my-app
cd my-appInstall dependencies:
composer install
npm installCreate your environment file:
cp .env.example .envWindows CMD:
copy .env.example .envGenerate app key and start development:
php artisan key:generate
npm run devDefault URLs:
- Laravel + Vue:
http://localhost:8000 - Express API:
http://localhost:5000
Health Checks
- Laravel:
http://localhost:8000/api/health - Express:
http://localhost:5000/api/health
CLI Usage
Run with npx:
npx lve-temp-jpz [project-name] [options]Or install globally:
npm install -g lve-temp-jpzThen use any of the provided commands:
lve my-app
laravue my-appOptions
-h, --helpShow help-f, --forceAllow scaffolding into a non-empty directory
Examples:
npx lve-temp-jpz
npx lve-temp-jpz my-app
npx lve-temp-jpz . --forceNotes:
- If no project name is provided, files are generated in the current directory.
- The CLI refuses to scaffold into this CLI package root to prevent accidental overwrite.
Generated Project Structure
app/
bootstrap/
config/
public/
resources/
css/
js/
views/
routes/
scripts/
server/
storage/
artisan
composer.json
package.json
vite.config.jsScripts Inside Generated App
npm run devStart Laravel, Vite, and Express togethernpm run dev:laravelStart Laravel onlynpm run dev:viteStart Vite onlynpm run dev:expressStart Express onlynpm run buildBuild frontend assets
Troubleshooting
Windows spawn EINVAL When Running Dev Services
Older generated projects could fail during npm run dev with:
Error: spawn EINVAL
syscall: spawn
code: EINVAL
errno: -4071The failure came from scripts/dev.js spawning the local dev services in a way that Windows could reject. It could also show ENOENT when trying to spawn npm directly, or a DEP0190 warning when testing shell: true with args.
Current generated projects avoid that crash by:
- Windows: running npm commands through
cmd.exe /d /s /cand running PHP asphp.exe - macOS/Linux: running
npmandphpdirectly
After updating to the fixed template, npm run dev should start Laravel, Vite, and Express together without diagnostics errors in scripts/dev.js.
CI/CD: Publish to npm on Tags
This repository includes GitHub Actions automation in .github/workflows/publish-npm.yml.
Workflow behavior:
- Triggers on tag pushes (
v*or*.*.*) - Runs install and tests
- Verifies tag version matches
package.jsonversion - Publishes to npm with provenance
Required GitHub secret:
NPM_TOKEN(npm automation token)
Release flow:
# 1) bump package version
npm version patch
# 2) push commit and tag
git push origin main --follow-tagsYou can also create tags manually, for example v1.0.2, as long as the tag version matches package.json.
Development (This CLI Repo)
Install dependencies and run the built-in test command:
npm install
npm testLicense
MIT
