astral-php / astral-forge
Astral Forge — générateur de projets Astral MVC 2.1 (blueprint, plan, génération)
Requires
- php: ^8.3
- astral-php/astral-core: ^2.1
- astral-php/astral-vite: ^1.2
Requires (Dev)
- phpunit/phpunit: ^9.6 || ^10.5 || ^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Générateur de projets Astral MVC 2.1 — préversion 0.6.2 (@dev jusqu’à 1.0.0).
Tutoriel infos : astral-informations/astral-forge/Dossier-technique/docs/tuto-forge.md
Pages locales : /docs · /templates · /discover · /extensions · /news
- Blueprint JSON (schema v1)
- Plan déterministe sans I/O (
php bin/forge plan) - Recettes : blank · blog-lite · api-json
- Génération greenfield via
astral-starter:^2.1+ modules - UI Vue 3 + astral-vite (nova-red) — wizard
/forge/new - Atelier : Mes projets · migrate / rollback · créer un module · supprimer projet
- Install 0.6 :
forge:env+ migrate CLI / setup web/setup
Prérequis
- PHP ^8.3
- Composer (
composer/composer.pharjoignable depuis le même process que le serveur web) astral-php/astral-core:^2.1proc_openactivé (pas dansdisable_functions)
Sous Laragon, ajoutez Laragon au PATH (php, composer, git, node…). Si Apache n’hérite pas du PATH utilisateur, définissez dans .env (ou lancez composer forge:env) :
FORGE_PHP_BIN=D:\laragon\bin\php\php-8.3.33-Win32-vs16-x64\php.exe FORGE_COMPOSER_BIN=D:\laragon\bin\composer\composer.phar
Forge préfère l’invocation php + composer.phar (évite les shims .bat sous Windows).
Apache Windows (Laragon) : la génération web lance un job en arrière-plan (bin/forge-job) pour éviter le crash mpm_winnt — l’utilisateur reste dans l’interface.
Contournement sync expérimental : FORGE_ALLOW_APACHE_COMPOSER=1.
Préflight : GET /forge/api/environment (toolchain + état migrations Forge).
Install
composer create-project astral-php/astral-forge:^0.6 astral-forge cd astral-forge # post-create lance déjà forge:env ; sinon : composer forge:env composer forge:migrate # ou UI : ouvrir /setup → « Installer / Migrer »
Checklist Windows (Laragon) : PHP/Composer PATH ou FORGE_*_BIN · FORGE_ALLOWED_ROOT = parent (ex. D:\laragon\www) · APP_ENV=production pour CSS /build.
Checklist Linux : droits écriture sur la racine projets pour l’utilisateur PHP (www-data, ex. chgrp www-data + chmod 2775) · COMPOSER_HOME writable (Forge utilise storage/composer-home en secours) · FORGE_ALLOW_APACHE_COMPOSER=1 souvent OK sous FPM/nginx.
Ou clone + composer install puis forge:env + forge:migrate.
CLI
php bin/forge plan resources/blueprints/blank.example.json --dest=../mon-application php bin/forge generate resources/blueprints/blank.example.json --dest=../mon-application --dry-run php bin/forge generate resources/blueprints/blank.example.json --dest=../mon-application --confirm
Équivalent console :
php bin/console forge:plan|forge:generate(nécessite astral-core ≥ 2.1.2).bin/forgereste le point d’entrée dédié.
La destination doit être sous FORGE_ALLOWED_ROOT (défaut : parent du dépôt) ou sys_get_temp_dir().
Web
composer serve
# http://127.0.0.1:8090/forge
Front (dev)
npm install npm run dev # Vite :5173 — APP_ENV=development npm run build # public/build + manifest.json
Tests
composer test
Licence
MIT