# PlanX (FasoChantier) > **Branding** : l’interface utilisateur affiche désormais **FasoChantier** (charte Burkina Faso — vert, rouge, or). Le dépôt et les namespaces techniques peuvent encore porter le nom PlanX. > L’identité visuelle officielle du MVP est définie dans [`docs/brand/fasochantier-charte-graphique-v1.md`](docs/brand/fasochantier-charte-graphique-v1.md). Application professionnelle de **gestion de chantier multi-chantiers** (chantiers, lots, tâches, documents, DOE, réunions, actions, etc.). Ce dépôt contient le socle technique initial : API Laravel et frontend Vite React. ## Structure ``` planx/ api/ # Backend Laravel (API REST, MySQL) frontend/ # Interface Vite + React + TypeScript + Tailwind docs/ # Architecture, standards, déploiement (dont deployment/bluehost-demo.md) .cursor/ # Règles pour l’assistant Cursor ``` ## Prérequis (Windows 11) - PHP 8.2+ et extensions requises par Laravel - [Composer](https://getcomposer.org/) - MySQL 8+ (local ou Laragon/XAMPP) - Node.js 20+ et npm (développement et build frontend uniquement) ## Backend (Laravel) ```powershell cd api composer install copy .env.example .env php artisan key:generate php artisan migrate php artisan serve ``` ### Configuration MySQL Dans `api/.env` (copié depuis `.env.example`) : ``` DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=planx DB_USERNAME=root DB_PASSWORD= ``` Créer la base `planx` dans MySQL avant `php artisan migrate`. ### URLs locales backend | URL | Description | |-----|-------------| | http://127.0.0.1:8000/ | Page d’accueil API (texte) | | http://127.0.0.1:8000/api/health | Health check JSON | | http://127.0.0.1:8000/api/auth/login | Authentification (POST) | ### Comptes démo (`php artisan migrate:fresh --seed`) Mot de passe commun : `password` | Email | Rôle | Usage | |-------|------|--------| | admin@planx.test | AC | Administrateur chantier | | cp@planx.test | CP | Chef de projet | | moe@planx.test | MOE | Maîtrise d’œuvre (Cabinet MOE Alpha, PX-UV) | | bc@planx.test | BC | Bureau de contrôle (Bureau Contrôle Sigma, PX-UV) | | entreprise@planx.test | ENT | Entreprise A | | lecteur@planx.test | LEC | Lecture seule | | disabled@planx.test | ENT | Compte désactivé (tests refus) | ### Tests API rapides (PowerShell) ```powershell $base = "http://127.0.0.1:8000/api" function Login-PlanX($email, $password = "password") { $r = Invoke-RestMethod -Method Post -Uri "$base/auth/login" -ContentType "application/json" ` -Body (@{ email = $email; password = $password } | ConvertTo-Json) return @{ Authorization = "Bearer $($r.token)" } } $hCp = Login-PlanX "cp@planx.test" Invoke-RestMethod -Uri "$base/projects/1/meetings" -Headers $hCp ``` ## Frontend (Vite React) ```powershell cd frontend npm install copy .env.example .env npm run dev npm run build ``` ### URL locale frontend - Développement : http://127.0.0.1:5173/ - Variable : `VITE_API_BASE_URL=http://127.0.0.1:8000/api` (voir `frontend/.env.example`) ## Hébergement Bluehost - API : document root vers `api/public` si possible ; MySQL via panneau ; secrets uniquement dans `.env` serveur. - Frontend : `npm run build` puis déploiement de `frontend/dist/` en statique — **pas de Node en production**. Voir [docs/DEPLOYMENT_BLUEHOST.md](docs/DEPLOYMENT_BLUEHOST.md). ## Documentation - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) - [docs/CODING_STANDARDS.md](docs/CODING_STANDARDS.md) - [docs/CURSOR_RULES.md](docs/CURSOR_RULES.md)