Structure du Projet (PP Tree)
Date : 2026-09-06
Approche : Monorepo avec Trunk-based Development
Environnements : dev, prod
Structure proposée
Section titled “Structure proposée”/home/anderson/PP/├── apps/│ ├── web/ # Projet Astro (amn-astro)│ │ ├── src/│ │ ├── public/│ │ ├── astro.config.mjs│ │ └── package.json│ └── studio/ # Projet Sanity (amn)│ ├── schemas/│ ├── studio/│ └── package.json├── services/ # Workers Cloudflare│ ├── middleware/│ │ ├── src/│ │ ├── wrangler.toml│ │ └── package.json│ ├── form-handler/│ ├── cms-webhook-receiver/│ ├── media-upload/│ ├── media-cleanup/│ └── sanity-backup/├── docs/ # Documentation│ ├── L1_Contenu/│ │ ├── sanity/│ │ ├── astro/│ │ └── cloudflare/│ ├── L2_Presentation/│ │ ├── astro/│ │ └── pagefind/│ └── L3_Backend/│ └── cloudflare/├── GettingStarted/ # Guides│ ├── Sprint0-Setup-Initial.TODO.md│ ├── Sprint0-Setup-Initial.DONE.md│ ├── Day1-Setup-Local.md│ └── outputs-for-wrangler-toml-config.md├── .github/ # CI/CD│ ├── workflows/│ │ ├── ci.yml│ │ ├── deploy-dev.yml│ │ └── deploy-prod.yml│ └── pull_request_template.md├── wrangler.toml # Configuration Wrangler globale├── package.json # Root package.json (scripts monorepo)├── .env.example # Variables d'environnement└── .gitignoreStructure actuelle
Section titled “Structure actuelle”/home/anderson/PP/├── amn/ # Projet Sanity├── amn-astro/ # Projet Astro├── docs/ # Documentation├── .wrangler/ # Configuration Wrangler├── GettingStarted/ # Guides├── Templates/ # Templates (ancien)├── .github/ # CI/CD├── wrangler.toml # Configuration Wrangler (créé)└── .env.example # Variables d'environnement (créé)Actions de réorganisation
Section titled “Actions de réorganisation”-
Créer la structure monorepo
- Créer
apps/ - Déplacer
amn-astro/→apps/web/ - Déplacer
amn/→apps/studio/ - Créer
services/(pour les futurs Workers)
- Créer
-
Nettoyer
- Supprimer
Templates/(ancien) - Supprimer
.wrangler/(configuration locale, non nécessaire)
- Supprimer
-
Créer le root package.json
- Scripts pour le monorepo
- Workspaces npm
Root package.json
Section titled “Root package.json”{ "name": "pp-monorepo", "version": "1.0.0", "private": true, "workspaces": [ "apps/*", "services/*" ], "scripts": { "dev": "npm run dev --workspace=apps/web", "dev:studio": "npm run dev --workspace=apps/studio", "build": "npm run build --workspace=apps/web", "build:studio": "npm run build --workspace=apps/studio", "test": "npm run test --workspaces", "lint": "npm run lint --workspaces", "typecheck": "npm run typecheck --workspaces" }, "devDependencies": { "@types/node": "^20.0.0", "typescript": "^5.0.0" }}Avantages de cette structure
Section titled “Avantages de cette structure”- Monorepo : Gestion unifiée des dépendances
- Workspaces npm : Partage des dépendances
- Séparation claire : apps vs services
- Scalabilité : Facile d’ajouter de nouveaux services
- CI/CD simplifié : Un seul repository