Ce projet sert de template pour démarrer un nouveau projet API sous Symfony, incluant la gestion utilisateur.
Suivez ces consignes pour monter votre projet rapidement et proprement.
- PHP >= 8.x
- Composer
- Git
- Symfony CLI
symfony new my_project_directory --version="7.3.x"
cd my_project_directory# URL du bundle
$repoUrl = "https://github.com/fabienlamotte487/user-bundle.git"
# Dossier temporaire
$tempDir = Join-Path -Path $env:TEMP -ChildPath ([System.IO.Path]::GetRandomFileName())
New-Item -ItemType Directory -Path $tempDir | Out-Null
# Cloner le repo bundle temporairement
git clone --depth 1 $repoUrl $tempDir
# Déplacer tous les fichiers du bundle vers le projet, sauf le .git
Get-ChildItem -Path $tempDir -Force | Where-Object { $_.Name -ne ".git" } | ForEach-Object {
Move-Item $_.FullName . -Force
}
# Supprimer le dossier temporaire
Remove-Item -Recurse -Force $tempDirrm composer.lock
composer installphp bin/console lexik:jwt:generate-keypairJe recommande la configuration de test pour valider que tout fonctionne
MAILER_DSN=smtp://mon-email@mondomaine.fr:password@smtp.mail.ovh.net:587
DATABASE_URL="mysql://root:@127.0.0.1:3306/mabasededonnee"php bin/console doctrine:database:create
php bin/console make:migration
php bin/console doctrine:migrations:migrate
php bin/console doctrine:database:create --env=test
php bin/console doctrine:migrations:migrate --env=testsymfony servephp bin/phpunit --testdox