Sprint 0 - Setup Initial
Durée estimée : 1-2 jours Objectif : Préparer l’infrastructure, les outils et les processus pour permettre le développement des slices
Statut : En cours
1. Vue d’ensemble
Section titled “1. Vue d’ensemble”Le Sprint 0 est une phase de préparation dédiée à la mise en place de l’infrastructure, des outils de développement et des processus de travail. Aucun code métier n’est développé pendant ce sprint.
1.1. Objectifs
Section titled “1.1. Objectifs”- ✅ Infrastructure Cloudflare configurée et opérationnelle
- ✅ Projet Sanity créé et accessible
- ✅ Repository Git initialisé avec protections
- ✅ CI/CD configuré et testé
- ✅ Environnements (staging, production) séparés
- ✅ Processus de travail défini et documenté
- ✅ Guides de setup (Day 1) créés
1.2. Livrables
Section titled “1.2. Livrables”- Infrastructure Cloudflare (Workers, R2, Stream, Pages)
- Projet Sanity avec credentials
- Repository Git avec branches et protections
- Pipeline CI/CD fonctionnel
- Configuration Astro initiale
- Configuration Wrangler initiale
- Variables d’environnement définies
- Secrets injectés
- Documentation opérationnelle (runbooks, playbooks)
- Guide Day 1 pour les nouveaux développeurs
2. Infrastructure Cloudflare
Section titled “2. Infrastructure Cloudflare”2.1. Comptes et sous-domaines
Section titled “2.1. Comptes et sous-domaines”| Ressource | Action | Détails |
|---|---|---|
| Compte Cloudflare | done | Compte temporaire avec free plan |
| Sous-domaine Workers | A Configurer apres avoir creer un worker | a la creation du premier worker il pointera sur worker-name.anderson-metsanou.workers.dev ensuite on le modifiera en worker-name.amn.lasommedesrosees.com |
| Sous-domaine Pages | A Configurer apres avoir creer un page | a la creation du premier worker il pointera sur page-name.anderson-metsanou.pages.dev ensuite on le modifiera en page-name.amn.lasommedesrosees.com |
| R2 Buckets | voir section 2.3 | - |
| Stream | done | Bibliothèque vidéo créée |
| Turnstile | done | Site key et secret key (a trouver dans la plateforme) |
2.2. Wrangler CLI
Section titled “2.2. Wrangler CLI”# Installationnpm install -g wrangler
# Authentificationwrangler login
# Vérificationwrangler whoami2.3. Création des ressources (A VOIR DANS ~/PP/GettingStarted/outputs-for-wrangler-toml-config.md)
Section titled “2.3. Création des ressources (A VOIR DANS ~/PP/GettingStarted/outputs-for-wrangler-toml-config.md)”NB: La separation des environnements (dev et prod) se feront dans le fichier de configuration wrangler.toml pour les automatisations. Car la plateforme Cloudflare ne permet pas de creer des environnements differents pour les ressources R2, Queue et KV.
# Buckets R2wrangler r2 bucket create medias-r2-prodwrangler r2 bucket create medias-r2-devwrangler r2 bucket create backups-r2-prodwrangler r2 bucket create backups-r2-dev
# Queuewrangler queues create submissions-queue-prodwrangler queues create submissions-queue-dev
# KV namespacewrangler kv:namespace create WEBHOOK_LOCK_PRODwrangler kv:namespace create WEBHOOK_LOCK_DEV3. Projet Sanity
Section titled “3. Projet Sanity”3.1. Création du projet
Section titled “3.1. Création du projet”# Installation CLInpm install -g @sanity/cli
# Création du projetsanity init
# Configuration✔ You are logged in as andsinus.ai@gmail.com using Google✔ Fetching existing projects
✔ Create a new project or select an existing one amn (4wa7mvsz)✔ Select dataset to use development✔ Configure Sanity MCP and agent skills for these editors? Antigravity, VS Code✔ MCP configured for Antigravity, VS Code✔ Sanity agent skills installed: [sanity-best-practices, sanity-migration]
Universal (~/.agents/skills) Antigravity, GitHub Copilot
✔ Project output path: /home/anderson/PP/amn✔ Select project template Blog (schema)✔ Do you want to use TypeScript? Yes✔ Bootstrapping files from template✔ Resolving latest module versions✔ Creating default project files✔ Package manager to use for installing dependencies? npm✔ Running npm install
✅ Success! Your Studio has been created.
(cd /home/anderson/PP/amn to navigate to your new project directory)
Get started by running npm run dev to launch your Studio's development server
To set up your project with the MCP server, restart Antigravity and VS Code and type "Get started with Sanity" in the chat.
Learn more: https://mcp.sanity.io3.2. Configuration API
Section titled “3.2. Configuration API”| Variable | Description | Source |
|---|---|---|
SANITY_PROJECT_ID |
ID du projet Sanity | Dashboard Sanity |
SANITY_DATASET |
Dataset (production/development) | Sanity CLI |
SANITY_API_READ_TOKEN |
Token lecture | API Tokens |
SANITY_API_WRITE_TOKEN |
Token écriture | API Tokens |
SANITY_PREVIEW_SECRET |
Secret preview | Généré aléatoirement |
3.3. Injection des secrets (A FAIRE VIA CI/CD OU .ENV - CES CMD NE SONT PAS ENCORE EXECUTEES)
Section titled “3.3. Injection des secrets (A FAIRE VIA CI/CD OU .ENV - CES CMD NE SONT PAS ENCORE EXECUTEES)”# Cloudflare Workerswrangler secret put SANITY_PROJECT_IDwrangler secret put SANITY_DATASETwrangler secret put SANITY_API_READ_TOKENwrangler secret put SANITY_PREVIEW_SECRET
# Astro (via CI/CD ou .env)# Voir §64. Repository Git
Section titled “4. Repository Git”Ce depot doit etre gere selon l’approche trunk-based. une seule branche (main) et 02 environnements (prod et dev).
4.1. Initialisation
Section titled “4.1. Initialisation”# Création du repositorygit initgit branch -m maingit add .wrangler/ docs/ amn/git commit -m "getting started the project"git remote add origin git@github.com:audyssee/PP.gitgit push -u origin main
# Trunk-based development# Setup trunk-based development with the single branch main and 02 envs prod and dev.4.2. Trunk-based development
Section titled “4.2. Trunk-based development”| Branche | Protection | Règles |
|---|---|---|
main |
✅ | PR requis, reviews, tests passants |
prod/* |
❌ | PR requis, reviews, tests passants |
dev/* |
❌ | PR requis, reviews, tests passants |
4.3. PR Template (A VOIR DANS .github/pull_request_template.md)
Section titled “4.3. PR Template (A VOIR DANS .github/pull_request_template.md)”## Description[Bref description de la modification]
## Type de modification- [ ] Bug fix- [ ] New feature- [ ] Breaking change- [ ] Documentation update
## Slice concerné- Slice 1 : Schéma Sanity "page"- Slice 2 : Schéma Sanity "post"- ...
## Checklist- [ ] Code suit les standards du projet- [ ] Tests unitaires ajoutés/mis à jour- [ ] Tests d'intégration ajoutés/mis à jour- [ ] Documentation mise à jour (fiches d'objets)- [ ] ADR créée si nécessaire- [ ] CI/CD passe
## Screenshots (si applicable)[Ajouter screenshots]5. CI/CD (REVOIR LE CODE DES PIPLINE POUR SE RASSURER QU’ILS FONCTIONNENT CORRECTEMENT AVEC LA STRATEGIE TRUNK-BASED)
Section titled “5. CI/CD (REVOIR LE CODE DES PIPLINE POUR SE RASSURER QU’ILS FONCTIONNENT CORRECTEMENT AVEC LA STRATEGIE TRUNK-BASED)”5.1. Pipeline GitHub Actions (A VOIR DANS .github/workflows/)
Section titled “5.1. Pipeline GitHub Actions (A VOIR DANS .github/workflows/)”name: CI
on: pull_request: branches: [main]
jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' - run: npm ci - run: npm run test - run: npm run lint - run: npm run typecheckname: Deploy dev
on: push: branches: [main]
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' - run: npm ci - run: npm run build - run: npx wrangler pages deploy dist --project-name=amn-devname: Deploy prod
on: push: branches: [main]
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' - run: npm ci - run: npm run build - run: npx wrangler pages deploy dist --project-name=amn-prod5.2. Secrets CI/CD
Section titled “5.2. Secrets CI/CD”| Secret | Description |
|---|---|
CLOUDFLARE_ACCOUNT_ID |
ID du compte Cloudflare |
CLOUDFLARE_API_TOKEN |
Token API Cloudflare |
SANITY_PROJECT_ID |
ID du projet Sanity |
SANITY_API_READ_TOKEN |
Token lecture Sanity |
SANITY_API_WRITE_TOKEN |
Token écriture Sanity |
6. Configuration Astro initiale
Section titled “6. Configuration Astro initiale”6.1. Initialisation du projet
Section titled “6.1. Initialisation du projet”# Création du projetnpm create astro@latest
# Configuration# astro Launch sequence initiated.
# dir Where should we create your new project?# ./amn-astro
# tmpl How would you like to start your new project?# Use blog template
# deps Install dependencies?# Yes
# git Initialize a new git repository?# No# ◼ Sounds good! You can always run git init manually.
# ▲ error Error: Process exited with code 1# ▲ error Dependencies failed to install, please run npm install to install them manually after setup.# ✔ Project initialized!# ■ Template copied# ■ Dependencies installed
# next Liftoff confirmed. Explore your project!
# Enter your project directory using cd ./amn-astro# Run npm run dev to start the dev server. q + ENTER to stop.# Add frameworks like react or tailwind using astro add.
# Stuck? Join us at https://astro.build/chat
# Installation des dependancesnpm install @astrojs/cloudflare @sanity/astro @astrojs/react @astrojs/starlight tailwindcssnpm install @sanity/image-urlnpm install -D sanity6.2. Configuration astro.config.mjs (CONF INITIALE - NON MODIFIEE)
Section titled “6.2. Configuration astro.config.mjs (CONF INITIALE - NON MODIFIEE)”// @ts-check
import mdx from '@astrojs/mdx';import sitemap from '@astrojs/sitemap';import { defineConfig, fontProviders } from 'astro/config';
// https://astro.build/configexport default defineConfig({ site: 'https://example.com', integrations: [mdx(), sitemap()], fonts: [ { provider: fontProviders.local(), name: 'Atkinson', cssVariable: '--font-atkinson', fallbacks: ['sans-serif'], options: { variants: [ { src: ['./src/assets/fonts/atkinson-regular.woff'], weight: 400, style: 'normal', display: 'swap', }, { src: ['./src/assets/fonts/atkinson-bold.woff'], weight: 700, style: 'normal', display: 'swap', }, ], }, }, ],});6.3. Variables d’environnement (OU CREER CE FICHIER ET COMMENT LE NOMMER?)
Section titled “6.3. Variables d’environnement (OU CREER CE FICHIER ET COMMENT LE NOMMER?)”SANITY_PROJECT_ID=your-project-idSANITY_DATASET=productionSANITY_API_READ_TOKEN=your-read-tokenSANITY_API_WRITE_TOKEN=your-write-tokenSANITY_PREVIEW_SECRET=your-preview-secret
CLOUDFLARE_ACCOUNT_ID=your-account-id7. Configuration Wrangler initiale
Section titled “7. Configuration Wrangler initiale”7.1. Configuration wrangler.toml (OU CREER CE FICHIER?)
Section titled “7.1. Configuration wrangler.toml (OU CREER CE FICHIER?)”name = "amn"main = "src/entrypoint"compatibility_date = "2026-09-01"
[env.prod]vars = { ENVIRONMENT = "prod" }
[env.dev]vars = { ENVIRONMENT = "dev" }7.2. Injection des secrets (VIA CI/CD OU .ENV - CES CMD NE SONT PAS ENCORE EXECUTEES.)
Section titled “7.2. Injection des secrets (VIA CI/CD OU .ENV - CES CMD NE SONT PAS ENCORE EXECUTEES.)”# Prodwrangler secret put SANITY_PROJECT_IDwrangler secret put SANITY_DATASETwrangler secret put SANITY_API_READ_TOKENwrangler secret put SANITY_PREVIEW_SECRET
# devwrangler secret put SANITY_PROJECT_IDwrangler secret put SANITY_DATASETwrangler secret put SANITY_API_READ_TOKENwrangler secret put SANITY_PREVIEW_SECRET