diff --git a/.env b/.env
index fe26c23..87de11f 100644
--- a/.env
+++ b/.env
@@ -1,48 +1,22 @@
-# In all environments, the following files are loaded if they exist,
-# the latter taking precedence over the former:
-#
-# * .env contains default values for the environment variables needed by the app
-# * .env.local uncommitted file with local overrides
-# * .env.$APP_ENV committed environment-specific defaults
-# * .env.$APP_ENV.local uncommitted environment-specific overrides
-#
-# Real environment variables win over .env files.
-#
-# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
-# https://symfony.com/doc/current/configuration/secrets.html
-#
-# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
-# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
-
-###> symfony/framework-bundle ###
-APP_ENV=dev
+APP_ENV=
+APP_DEBUG=
APP_SECRET=
-APP_SHARE_DIR=var/share
-###< symfony/framework-bundle ###
-###> symfony/routing ###
-# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
-# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
-DEFAULT_URI=http://localhost
-###< symfony/routing ###
-
-###> doctrine/doctrine-bundle ###
-# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
-# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
-#
-# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data_%kernel.environment%.db"
-# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
-# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
-#DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8"
-###< doctrine/doctrine-bundle ###
+DEFAULT_URI=
###> nelmio/cors-bundle ###
-CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
+CORS_ALLOW_ORIGIN=
###< nelmio/cors-bundle ###
###> lexik/jwt-authentication-bundle ###
JWT_SECRET_KEY=
JWT_PUBLIC_KEY=
JWT_PASSPHRASE=
-COOKIE_SECURE=1
+COOKIE_SECURE=
###< lexik/jwt-authentication-bundle ###
+
+# ADAPTER avec la vraie BDD (pas de variables docker)
+DATABASE_URL=
+
+PONT_BASCULE_BYPASS=
+PONT_BASCULE_URL=
diff --git a/.idea/db-forest-config.xml b/.idea/db-forest-config.xml
new file mode 100644
index 0000000..0620fdb
--- /dev/null
+++ b/.idea/db-forest-config.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index f8ce627..86cf9af 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,15 +4,9 @@
-
+
+
-
-
-
-
-
-
-
@@ -268,7 +262,7 @@
-
+
@@ -390,7 +384,15 @@
1769014602062
-
+
+
+ 1769019284586
+
+
+
+ 1769019284586
+
+
@@ -456,7 +458,8 @@
-
+
+
diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md
new file mode 100644
index 0000000..98357f4
--- /dev/null
+++ b/DEPLOYMENT.md
@@ -0,0 +1,103 @@
+# Déploiement Ferme (recette)
+
+## 1) Premier déploiement
+
+### Pré-requis système (Ubuntu)
+1. Mettre à jour la machine
+ ```bash
+ sudo apt update
+ sudo apt install -y software-properties-common ca-certificates curl gnupg unzip git nginx
+ ```
+2. Installer PHP 8.4 + FPM + extensions
+ ```bash
+ sudo add-apt-repository -y ppa:ondrej/php
+ sudo apt update
+ sudo apt install -y \
+ php8.4 php8.4-fpm php8.4-cli php8.4-common \
+ php8.4-mbstring php8.4-xml php8.4-curl php8.4-intl \
+ php8.4-zip php8.4-gd php8.4-pgsql php8.4-opcache
+ ```
+3. Installer Composer
+ ```bash
+ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
+ sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
+ rm composer-setup.php
+ ```
+4. Installer Node via NVM
+ ```bash
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
+ source ~/.bashrc
+ nvm install --lts
+ ```
+5. Installer PostgreSQL (si la DB est locale)
+ ```bash
+ sudo apt install -y postgresql postgresql-contrib
+ sudo -u postgres psql
+ ```
+ Dans psql :
+ ```sql
+ CREATE USER ferme_user WITH PASSWORD 'motdepassefort';
+ CREATE DATABASE ferme OWNER ferme_user;
+ \q
+ ```
+
+### Déploiement applicatif
+1. Cloner le repo
+ ```bash
+ sudo mkdir -p /var/www
+ sudo git clone /var/www/ferme
+ sudo chown -R malio:malio /var/www/ferme
+ ```
+2. Variables d’environnement
+ - Backend : `/var/www/ferme/.env.local`
+ - `APP_ENV=prod`
+ - `APP_DEBUG=0`
+ - `APP_SECRET=...`
+ - `DATABASE_URL=postgresql://ferme_user:motdepassefort@127.0.0.1:5432/ferme?serverVersion=16&charset=utf8`
+ - `JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem`
+ - `JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem`
+ - `JWT_PASSPHRASE=...`
+ - `COOKIE_SECURE=1`
+ - `PONT_BASCULE_BYPASS=false`
+ - Frontend : `/var/www/ferme/frontend/.env`
+ - `NUXT_PUBLIC_APP_BASE=/`
+ - `NUXT_PUBLIC_API_BASE=/api`
+3. Générer les clés JWT
+ ```bash
+ cd /var/www/ferme
+ mkdir -p config/jwt
+ php bin/console lexik:jwt:generate-keypair
+ ```
+4. Config Nginx (sous-domaine)
+ ```bash
+ sudo cp /var/www/ferme/deploy/nginx/ferme.conf /etc/nginx/sites-available/ferme.conf
+ sudo ln -s /etc/nginx/sites-available/ferme.conf /etc/nginx/sites-enabled/ferme.conf
+ sudo nginx -t && sudo systemctl reload nginx
+ ```
+6. Déployer l’app
+ ```bash
+ cd /var/www/ferme
+ ./scripts/deploy-native.sh
+ ```
+7. Vérifications
+ - Front : `http://ferme.malio-dev.fr/`
+ - API : `http://ferme.malio-dev.fr/api/users`
+ - Login : `POST http://ferme.malio-dev.fr/api/login_check`
+
+## 2) Déployer une nouvelle version (app déjà en place)
+
+1. Mettre à jour le code + build + migrations
+ ```bash
+ cd /var/www/ferme
+ ./scripts/deploy-native.sh
+ ```
+2. Si changement de conf Nginx
+ ```bash
+ sudo cp /var/www/ferme/deploy/nginx/ferme.conf /etc/nginx/sites-available/ferme.conf
+ sudo nginx -t && sudo systemctl reload nginx
+ ```
+3. Si besoin, purger le cache Symfony
+ ```bash
+ php /var/www/ferme/bin/console cache:clear --env=prod
+ php /var/www/ferme/bin/console cache:warmup --env=prod
+ ```
diff --git a/deploy/nginx/ferme.conf b/deploy/nginx/ferme.conf
new file mode 100644
index 0000000..2d3aa6e
--- /dev/null
+++ b/deploy/nginx/ferme.conf
@@ -0,0 +1,43 @@
+server {
+ listen 80;
+server_name ferme.malio-dev.fr;
+
+ root /var/www/ferme/frontend/.output/public;
+ index index.html;
+
+ location ^~ /api/ {
+ root /var/www/ferme/public;
+ try_files $uri /index.php?$query_string;
+ }
+
+ location ^~ /bundles/ {
+ root /var/www/ferme/public;
+ try_files $uri =404;
+ }
+
+ location = /api/login_check {
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /var/www/ferme/public/index.php;
+ fastcgi_param DOCUMENT_ROOT /var/www/ferme/public;
+ fastcgi_param SCRIPT_NAME /index.php;
+ fastcgi_param PATH_INFO /login_check;
+ fastcgi_param REQUEST_URI /login_check;
+ fastcgi_pass unix:/run/php/php8.4-fpm.sock;
+ }
+
+ location ~ ^/index\.php(/|$) {
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /var/www/ferme/public/index.php;
+ fastcgi_param DOCUMENT_ROOT /var/www/ferme/public;
+ fastcgi_pass unix:/run/php/php8.4-fpm.sock;
+ internal;
+ }
+
+ location ~ \.php$ {
+ return 404;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+}