diff --git a/.env.example b/.env.example index 2333278..67718a4 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,7 @@ APP_NAME=Laravel APP_ENV=local APP_KEY= APP_DEBUG=true -APP_URL=http://localhost +APP_URL=http://localhost:8000 APP_LOCALE=fr APP_FALLBACK_LOCALE=en @@ -11,7 +11,7 @@ APP_FAKER_LOCALE=en_US APP_MAINTENANCE_DRIVER=file # APP_MAINTENANCE_STORE=database -# PHP_CLI_SERVER_WORKERS=4 +PHP_CLI_SERVER_WORKERS=4 BCRYPT_ROUNDS=12 @@ -21,10 +21,10 @@ LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug DB_CONNECTION=mysql -DB_HOST=127.0.0.1 +DB_HOST=mysql DB_PORT=3306 DB_DATABASE=treasure_hunt_api -DB_USERNAME=root +DB_USERNAME= DB_PASSWORD= SESSION_DRIVER=database diff --git a/README.md b/README.md index 0165a77..334aa4f 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,44 @@ -

Laravel Logo

+# Treasure Hunt API avec Laravel Sail -

-Build Status -Total Downloads -Latest Stable Version -License -

+Ce projet se lance via Laravel Sail (Docker). Ce guide explique comment demarrer l'environnement et executer les commandes courantes. -## About Laravel +## Prerequis -Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: +- Docker Desktop ou Engine avec Docker Compose actif. +- Si `vendor/` est absent, installez d'abord les dependances pour recuperer Sail: `composer install` (en local) ou `./vendor/bin/sail composer install`. +- Copiez le fichier `.env.example` vers `.env` et adaptez les valeurs utiles (`APP_PORT`, `VITE_PORT`, `DB_DATABASE`, `DB_USERNAME`, `DB_PASSWORD`, `FORWARD_DB_PORT`). -- [Simple, fast routing engine](https://laravel.com/docs/routing). -- [Powerful dependency injection container](https://laravel.com/docs/container). -- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. -- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). -- Database agnostic [schema migrations](https://laravel.com/docs/migrations). -- [Robust background job processing](https://laravel.com/docs/queues). -- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). +## Demarrage rapide -Laravel is accessible, powerful, and provides tools required for large, robust applications. +1. Lancer la stack: `./vendor/bin/sail up -d`. +2. Generer la cle d'application: `./vendor/bin/sail artisan key:generate`. +3. Initialiser la base: `./vendor/bin/sail artisan migrate`. +4. (Optionnel) Ajouter un alias shell pour simplifier: `alias sail="./vendor/bin/sail"`. -## Learning Laravel +## Ports et services -Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. You can also check out [Laravel Learn](https://laravel.com/learn), where you will be guided through building a modern Laravel application. +- Application: `APP_PORT` (80 par defaut). +- Vite: `VITE_PORT` (5173 par defaut). +- MySQL 8.0: `FORWARD_DB_PORT` (3306 par defaut). Les donnees sont stockees dans le volume Docker `sail-mysql`. +- Les conteneurs sont definis dans `compose.yaml` (service principal `laravel.test` et base `mysql`). -If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. +## Commandes courantes -## Laravel Sponsors +- Demarrer: `sail up -d` (ou `./vendor/bin/sail up -d` sans alias). +- Arreter: `sail down`. +- Rebuild si l'image change: `sail up -d --build` ou `sail build --no-cache`. +- Logs: `sail logs -f laravel.test` ou `sail logs -f mysql`. +- Shell applicatif: `sail shell` (ou `sail bash`). +- Artisan: `sail artisan migrate`, `sail artisan migrate:fresh --seed`, `sail artisan tinker`. +- Tests: `sail artisan test`. -We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com). +## Base de donnees -### Premium Partners +- Acces host: `127.0.0.1:` avec les identifiants definis dans `.env`. +- Pour repartir de zero: `sail down -v` (supprime les volumes, donc les donnees) puis `sail up -d` et `sail artisan migrate --seed`. -- **[Vehikl](https://vehikl.com)** -- **[Tighten Co.](https://tighten.co)** -- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** -- **[64 Robots](https://64robots.com)** -- **[Curotec](https://www.curotec.com/services/technologies/laravel)** -- **[DevSquad](https://devsquad.com/hire-laravel-developers)** -- **[Redberry](https://redberry.international/laravel-development)** -- **[Active Logic](https://activelogic.com)** +## Debug et outils -## Contributing - -Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). - -## Code of Conduct - -In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). - -## Security Vulnerabilities - -If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. - -## License - -The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). +- Activer Xdebug en ajoutant dans `.env`: `SAIL_XDEBUG_MODE=develop,debug` et `SAIL_XDEBUG_CONFIG=client_host=host.docker.internal`, puis `sail up -d --build`. +- Composer/PHP direct: `sail composer `, `sail php -v`. +- Nettoyage des images intermediaires: `sail down` puis `docker system prune` (optionnel).