2026-03-18 20:12:09 +01:00
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
|
|
|
|
|
|
## —— Help ————————————————————————————————————————
|
|
|
|
|
help: ## Affiche la liste des commandes disponibles
|
|
|
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
|
|
|
|
|
|
|
|
|
## —— Docker ——————————————————————————————————————
|
|
|
|
|
build_dev: ## Build les images Docker pour le dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml build
|
|
|
|
|
|
|
|
|
|
build_prod: ## Build les images Docker pour la prod
|
|
|
|
|
docker compose -f docker-compose-prod.yml build
|
|
|
|
|
|
|
|
|
|
start_dev: ## Lance les containers dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml up
|
|
|
|
|
|
|
|
|
|
start_prod: ## Lance les containers prod en background
|
|
|
|
|
docker compose -f docker-compose-prod.yml up -d
|
|
|
|
|
|
|
|
|
|
stop_dev: ## Arrete les containers dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml down
|
|
|
|
|
|
|
|
|
|
purge_dev: ## Arrete et purge les containers dev (volumes inclus)
|
2026-03-18 21:12:42 +01:00
|
|
|
docker compose -f docker-compose-dev.yml down -v
|
2026-03-18 20:12:09 +01:00
|
|
|
|
|
|
|
|
stop_prod: ## Arrete les containers prod
|
|
|
|
|
docker compose -f docker-compose-prod.yml down
|
2026-03-18 20:40:40 +01:00
|
|
|
|
2026-03-20 12:52:01 +01:00
|
|
|
## —— Git ——————————————————————————————————————————
|
2026-03-20 12:52:26 +01:00
|
|
|
pull_dev: ## Pull les images Docker dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml pull
|
2026-03-20 12:52:01 +01:00
|
|
|
|
2026-03-20 12:52:26 +01:00
|
|
|
pull_prod: ## Pull les images Docker prod
|
|
|
|
|
docker compose -f docker-compose-prod.yml pull
|
2026-03-20 12:52:01 +01:00
|
|
|
|
2026-03-20 13:01:32 +01:00
|
|
|
## —— Ansible —————————————————————————————————————
|
|
|
|
|
deploy_prod: ## Deploy en prod via Ansible (demande le vault password)
|
Simplify Ansible playbook: remove Cloudflare tasks, add git pull and direct dependency install
- Remove entire Cloudflare configuration play (DNS, SSL, HSTS, bot management)
- Replace make install_prod with direct git pull, composer install, bun install, bun run build
- Add Docker image pull step before container restart
- Keep server deployment: env, containers, migrations, cache, uploads, Caddy, Supervisor
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 13:05:07 +01:00
|
|
|
ansible-playbook ansible/deploy.yml -i ansible/hosts.ini --ask-vault-pass
|
2026-03-20 13:01:32 +01:00
|
|
|
|
2026-03-18 20:40:40 +01:00
|
|
|
## —— Install ——————————————————————————————————————
|
|
|
|
|
install_dev: ## Install les dependances dev via Docker
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php composer install
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec bun bun install
|
|
|
|
|
|
|
|
|
|
install_prod: ## Install les dependances et build les assets pour la prod
|
Update deployment pipeline, Makefile and README
- Makefile: add install_dev, install_prod, migrations, clear_prod, maintenance commands
- Playbook: full deploy flow (maintenance, stop, install, start, migrate, clear, caddy, messenger)
- Supervisor config for 2 messenger instances
- Workflow: SSH key setup with server IP
- hosts.ini: use IP instead of domain, sudo without password
- README: full documentation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 20:52:01 +01:00
|
|
|
docker compose -f docker-compose-prod.yml exec php composer install --no-dev --optimize-autoloader
|
2026-03-18 20:40:40 +01:00
|
|
|
bun install
|
|
|
|
|
bun run build
|
|
|
|
|
|
2026-03-19 08:55:53 +01:00
|
|
|
## —— Tests ————————————————————————————————————————
|
Complete TASK_CHECKUP: security, UX, tests, coverage, accessibility, config externalization
Billetterie:
- Partial refund support (STATUS_PARTIALLY_REFUNDED, refundedAmount field, migration)
- Race condition fix: PESSIMISTIC_WRITE lock on stock decrement in transaction
- Idempotency key on PaymentIntent::create, reuse existing PI if stripeSessionId set
- Disable checkout when event ended (server 400 + template hide)
- Webhook deduplication via cache (24h TTL on stripe event.id)
- Email validation (filter_var) in OrderController guest flow
- JSON cart validation (structure check before processing)
- Invitation expiration after 7 days (isExpired method + landing page message)
- Stripe Checkout fallback when JS fails to load (noscript + redirect)
Config externalization:
- Move Stripe fees (STRIPE_FEE_RATE, STRIPE_FEE_FIXED) and admin email (ADMIN_EMAIL) to .env/services.yaml
- Replace all hardcoded contact@e-cosplay.fr across 13 files
- MailerService: getAdminEmail()/getAdminFrom(), default $from=null resolves to admin
UX & Accessibility:
- ARIA tabs: role=tablist/tab/tabpanel, aria-selected, keyboard nav (arrows, Home, End)
- aria-label on cart +/- buttons and editor toolbar buttons
- tabindex=0 on editor toolbar buttons for keyboard access
- data-confirm handler in app.js (was only in admin.js)
- Cart error feedback on checkout failure
- Billet designer save feedback (loading/success/error states)
- Stock polling every 30s with rupture/low stock badges
- Back to event link on payment page
Security:
- HTML sanitizer: BLOCKED_TAGS list (script, style, iframe, svg, etc.) - content fully removed
- Stripe polling timeout (15s max) with fallback redirect
- Rate limiting on public order access (20/5min)
- .catch() on all fetch() calls (sortable, billet-designer)
Tests (92% PHP, 100% JS lines):
- PCOV added to dev Dockerfile
- Test DB setup: .env.test with DATABASE_URL, Redis auth, Meilisearch key
- Rate limiter disabled in test env
- Makefile: test_db_setup, test_db_reset, run_test_php, run_test_coverage_php/js
- New tests: InvitationFlowTest (21), AuditServiceTest (4), ExportServiceTest (9), InvoiceServiceTest (4)
- New tests: SuspendedUserSubscriberTest, RateLimiterSubscriberTest, MeilisearchServiceTest
- New tests: Stripe webhook payment_failed (6) + charge.refunded (6)
- New tests: BilletBuyer refund, User suspended, OrganizerInvitation expiration
- JS tests: stock polling (6), data-confirm (2), copy-url restore (1), editor ARIA (2), XSS (9), tabs keyboard (9)
- ESLint + PHP CS Fixer: 0 errors
- SonarQube exclusions aligned with vitest coverage config
Infra:
- Meilisearch consistency command (app:meilisearch:check-consistency --fix) + cron daily 3am
- MeilisearchService: getAllDocumentIds(), listIndexes()
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 11:14:06 +01:00
|
|
|
test_db_create: ## Cree la base de donnees de test
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec database psql -U app -d e_ticket -tc "SELECT 1 FROM pg_database WHERE datname = 'e_ticket_test'" | grep -q 1 || \
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec database psql -U app -d e_ticket -c "CREATE DATABASE e_ticket_test"
|
|
|
|
|
|
|
|
|
|
test_db_schema: ## Cree/met a jour le schema de la base de test
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php php bin/console doctrine:schema:update --force --env=test
|
|
|
|
|
|
|
|
|
|
test_db_migrate: ## Execute les migrations sur la base de test
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php php bin/console doctrine:migrations:migrate --no-interaction --env=test
|
|
|
|
|
|
|
|
|
|
test_db_reset: ## Supprime et recree la base de test depuis zero
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec database psql -U app -d e_ticket -c "DROP DATABASE IF EXISTS e_ticket_test"
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec database psql -U app -d e_ticket -c "CREATE DATABASE e_ticket_test"
|
|
|
|
|
$(MAKE) test_db_schema
|
|
|
|
|
|
|
|
|
|
test_db_setup: ## Setup complet de la base de test (cree si besoin + schema)
|
|
|
|
|
$(MAKE) test_db_create
|
|
|
|
|
$(MAKE) test_db_schema
|
|
|
|
|
|
2026-03-19 08:55:53 +01:00
|
|
|
run_test: ## Lance les tests PHP et JS via Docker dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php php bin/phpunit
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec bun bun run test
|
|
|
|
|
|
Complete TASK_CHECKUP: security, UX, tests, coverage, accessibility, config externalization
Billetterie:
- Partial refund support (STATUS_PARTIALLY_REFUNDED, refundedAmount field, migration)
- Race condition fix: PESSIMISTIC_WRITE lock on stock decrement in transaction
- Idempotency key on PaymentIntent::create, reuse existing PI if stripeSessionId set
- Disable checkout when event ended (server 400 + template hide)
- Webhook deduplication via cache (24h TTL on stripe event.id)
- Email validation (filter_var) in OrderController guest flow
- JSON cart validation (structure check before processing)
- Invitation expiration after 7 days (isExpired method + landing page message)
- Stripe Checkout fallback when JS fails to load (noscript + redirect)
Config externalization:
- Move Stripe fees (STRIPE_FEE_RATE, STRIPE_FEE_FIXED) and admin email (ADMIN_EMAIL) to .env/services.yaml
- Replace all hardcoded contact@e-cosplay.fr across 13 files
- MailerService: getAdminEmail()/getAdminFrom(), default $from=null resolves to admin
UX & Accessibility:
- ARIA tabs: role=tablist/tab/tabpanel, aria-selected, keyboard nav (arrows, Home, End)
- aria-label on cart +/- buttons and editor toolbar buttons
- tabindex=0 on editor toolbar buttons for keyboard access
- data-confirm handler in app.js (was only in admin.js)
- Cart error feedback on checkout failure
- Billet designer save feedback (loading/success/error states)
- Stock polling every 30s with rupture/low stock badges
- Back to event link on payment page
Security:
- HTML sanitizer: BLOCKED_TAGS list (script, style, iframe, svg, etc.) - content fully removed
- Stripe polling timeout (15s max) with fallback redirect
- Rate limiting on public order access (20/5min)
- .catch() on all fetch() calls (sortable, billet-designer)
Tests (92% PHP, 100% JS lines):
- PCOV added to dev Dockerfile
- Test DB setup: .env.test with DATABASE_URL, Redis auth, Meilisearch key
- Rate limiter disabled in test env
- Makefile: test_db_setup, test_db_reset, run_test_php, run_test_coverage_php/js
- New tests: InvitationFlowTest (21), AuditServiceTest (4), ExportServiceTest (9), InvoiceServiceTest (4)
- New tests: SuspendedUserSubscriberTest, RateLimiterSubscriberTest, MeilisearchServiceTest
- New tests: Stripe webhook payment_failed (6) + charge.refunded (6)
- New tests: BilletBuyer refund, User suspended, OrganizerInvitation expiration
- JS tests: stock polling (6), data-confirm (2), copy-url restore (1), editor ARIA (2), XSS (9), tabs keyboard (9)
- ESLint + PHP CS Fixer: 0 errors
- SonarQube exclusions aligned with vitest coverage config
Infra:
- Meilisearch consistency command (app:meilisearch:check-consistency --fix) + cron daily 3am
- MeilisearchService: getAllDocumentIds(), listIndexes()
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 11:14:06 +01:00
|
|
|
run_test_php: ## Lance uniquement les tests PHP via Docker dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php php bin/phpunit
|
|
|
|
|
|
|
|
|
|
run_test_js: ## Lance uniquement les tests JS via Docker dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec bun bun run test
|
|
|
|
|
|
|
|
|
|
run_test_coverage_php: ## Lance les tests PHP avec couverture via Docker dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php php bin/phpunit --coverage-text --coverage-html=coverage/php
|
|
|
|
|
|
|
|
|
|
run_test_coverage_js: ## Lance les tests JS avec couverture via Docker dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec bun bun run test -- --coverage
|
|
|
|
|
|
|
|
|
|
run_test_file: ## Lance un fichier de test PHP specifique (usage: make run_test_file FILE=tests/Service/AuditServiceTest.php)
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php php bin/phpunit $(FILE)
|
|
|
|
|
|
2026-03-20 19:22:28 +01:00
|
|
|
## —— PWA —————————————————————————————————————————
|
2026-03-20 20:09:10 +01:00
|
|
|
pwa_dev: ## Compile les assets PWA en dev via Docker
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php php bin/console pwa:compile
|
2026-03-20 19:22:28 +01:00
|
|
|
|
2026-03-20 20:09:10 +01:00
|
|
|
pwa_prod: ## Compile les assets PWA en prod via Docker
|
|
|
|
|
docker compose -f docker-compose-prod.yml exec php php bin/console pwa:compile --env=prod
|
2026-03-20 19:22:28 +01:00
|
|
|
|
2026-03-19 14:54:06 +01:00
|
|
|
## —— Qualite ——————————————————————————————————————
|
|
|
|
|
hadolint: ## Lance Hadolint sur les Dockerfiles
|
|
|
|
|
hadolint docker/php/dev/Dockerfile
|
|
|
|
|
hadolint docker/php/prod/Dockerfile
|
|
|
|
|
|
2026-03-18 21:43:10 +01:00
|
|
|
## —— Symfony ——————————————————————————————————————
|
|
|
|
|
entity: ## Creer ou modifier une entite via Docker dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php php bin/console make:entity
|
|
|
|
|
|
2026-03-18 20:40:40 +01:00
|
|
|
## —— Database ——————————————————————————————————————
|
|
|
|
|
migration_dev: ## Genere une migration via Docker dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php php bin/console make:migration
|
|
|
|
|
|
|
|
|
|
migrate_dev: ## Execute les migrations via Docker dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php php bin/console doctrine:migrations:migrate --no-interaction
|
|
|
|
|
|
Add Billet entity, BilletDesign, ticket designer, CRUD billets, commissions
- Create Billet entity: name, position, priceHT, quantity (nullable=unlimited),
isGeneratedBillet, hasDefinedExit, notBuyable, type (billet/reservation_brocante/vote),
stripeProductId, description, picture (VichUploader), category (ManyToOne CASCADE)
- Create BilletDesign entity (OneToOne Event): accentColor, invitationTitle, invitationColor
- Billet CRUD: add/edit/delete with access control, Stripe product sync on connected account
- Billet reorder: drag & drop with position field, refactored sortable.js for both categories and billets
- Ticket designer tab (custom offer only): accent color, invitation title/color, live iframe preview
- A4 ticket preview: 4 zones (HG infos+billet, HD affiche, BG association, BD sortie+invitation), fake QR code SVG
- Commission calculator JS: live breakdown of E-Ticket fee, Stripe fee (1.5%+0.25EUR), net amount
- Sales recap on categories tab: qty sold, total HT, total commissions, total net
- DisableProfilerSubscriber: disable web profiler toolbar on preview iframe
- CSP: allow self in frame-src and frame-ancestors for preview iframe
- Flysystem: dedicated billets.storage for billet images
- Upload accept restricted to png/jpeg/webp/gif (no HEIC)
- Makefile: add force_sql_dev command
- CLAUDE.md: add rule to never modify existing migrations
- Consolidate all migrations into single Version20260321111125
- Tests: BilletTest (20), BilletDesignTest (6), DisableProfilerSubscriberTest (5),
billet-designer.test.js (7), commission-calculator.test.js (7),
AccountControllerTest billet CRUD tests (11)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 12:19:46 +01:00
|
|
|
force_sql_dev: ## Force la mise a jour du schema de la base de donnees dev
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php php bin/console doctrine:schema:update --force
|
|
|
|
|
|
2026-03-18 20:40:40 +01:00
|
|
|
migrate_prod: ## Execute les migrations en prod via Docker
|
|
|
|
|
docker compose -f docker-compose-prod.yml exec php php bin/console doctrine:migrations:migrate --no-interaction --env=prod
|
Update deployment pipeline, Makefile and README
- Makefile: add install_dev, install_prod, migrations, clear_prod, maintenance commands
- Playbook: full deploy flow (maintenance, stop, install, start, migrate, clear, caddy, messenger)
- Supervisor config for 2 messenger instances
- Workflow: SSH key setup with server IP
- hosts.ini: use IP instead of domain, sudo without password
- README: full documentation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 20:52:01 +01:00
|
|
|
|
|
|
|
|
## —— Cache ————————————————————————————————————————
|
|
|
|
|
clear_prod: ## Clear le cache Symfony et le pool opcache en prod via Docker
|
|
|
|
|
docker compose -f docker-compose-prod.yml exec php php bin/console cache:clear --env=prod
|
|
|
|
|
docker compose -f docker-compose-prod.yml exec php php bin/console cache:pool:clear --all --env=prod
|
|
|
|
|
|
Add homepage, tarifs, legal pages, navbar, footer and full test coverage
- Homepage: hero, how it works (buyer/organizer), features, CTA
- Tarifs: 3 plans (Gratuit, Basique 10€, Sur-mesure), JSON-LD Product
- Legal pages: mentions legales, CGU (tabs buyer/organizer), CGV, RGPD, cookies, hosting
- Navbar: neubrutalism style, logo liip, mobile menu, SEO attributes
- Footer: contact, description, legal links, tarifs
- Sitemap: add /tarifs and /sitemap-orgas-{page}.xml
- Liip Imagine: remove S3, webp format on all filters
- Tests: full coverage for all controllers, services, repositories
- Fix CSP: replace inline onclick with data-tab JS
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 00:01:58 +01:00
|
|
|
purge_liip_dev: ## Purge le cache Liip Imagine en dev via Docker
|
|
|
|
|
docker compose -f docker-compose-dev.yml exec php php bin/console liip:imagine:cache:remove
|
|
|
|
|
|
|
|
|
|
purge_liip_prod: ## Purge le cache Liip Imagine en prod via Docker
|
|
|
|
|
docker compose -f docker-compose-prod.yml exec php php bin/console liip:imagine:cache:remove --env=prod
|
|
|
|
|
|
Update deployment pipeline, Makefile and README
- Makefile: add install_dev, install_prod, migrations, clear_prod, maintenance commands
- Playbook: full deploy flow (maintenance, stop, install, start, migrate, clear, caddy, messenger)
- Supervisor config for 2 messenger instances
- Workflow: SSH key setup with server IP
- hosts.ini: use IP instead of domain, sudo without password
- README: full documentation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 20:52:01 +01:00
|
|
|
## —— Maintenance ——————————————————————————————————
|
|
|
|
|
maintenance_on: ## Active le mode maintenance
|
|
|
|
|
touch public/.update
|
|
|
|
|
|
|
|
|
|
maintenance_off: ## Desactive le mode maintenance
|
|
|
|
|
rm -f public/.update
|