feat: Ajout configuration et dépendances initiales

This commit is contained in:
Serreau Jovann
2025-07-16 11:29:00 +02:00
parent 9c9ff36c6f
commit 0b7f9cca89
20 changed files with 3317 additions and 8 deletions

8
.env
View File

@@ -39,3 +39,11 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
###> symfony/mailer ###
MAILER_DSN=null://null
###< symfony/mailer ###
###> nelmio/cors-bundle ###
CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
###< nelmio/cors-bundle ###
###> sentry/sentry-symfony ###
SENTRY_DSN=
###< sentry/sentry-symfony ###

View File

@@ -1,3 +1,6 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
APP_ENV=test
DATABASE_URL="postgresql://mainframe:mainframe@127.0.0.1:5432/mainframe?serverVersion=16&charset=utf8"
XDEBUG_MODE=coverage

10
.gitignore vendored
View File

@@ -21,3 +21,13 @@
.idea
node_modules
###> phpstan/phpstan ###
phpstan.neon
###< phpstan/phpstan ###
###> liip/imagine-bundle ###
/public/media/cache/
###< liip/imagine-bundle ###
.coverage
.phpunit.cache

View File

@@ -2,6 +2,9 @@
⚠️ **Confidentialité : ULTRA SECRÈTE**
Ce projet est strictement confidentiel. Aucune diffusion, reproduction ou utilisation non autorisée n'est permise.
[![Quality gate](https://sonarcloud.esy-web.dev/api/project_badges/quality_gate?project=mainframe_mainframe_AZgSDOOmCw8KjT0jogWd&token=sqb_2bb4a133b41388beccf89e6781d0dc384a48fea5)](https://sonarcloud.esy-web.dev/dashboard?id=mainframe_mainframe_AZgSDOOmCw8KjT0jogWd)
---
📌 **Description**

View File

@@ -11,8 +11,21 @@
"doctrine/doctrine-bundle": "^2.15",
"doctrine/doctrine-migrations-bundle": "^3.4.2",
"doctrine/orm": "^3.5",
"docusealco/docuseal-php": "^1.0",
"imagine/imagine": "^1.5",
"knplabs/knp-paginator-bundle": "^6.8",
"league/flysystem-aws-s3-v3": "^3.29",
"league/flysystem-bundle": "^3.4",
"liip/imagine-bundle": "^2.13",
"minishlink/web-push": "^9.0",
"mittwald/vault-php": "^3.0",
"nelmio/cors-bundle": "^2.5",
"phpdocumentor/reflection-docblock": "^5.6.2",
"phpstan/phpdoc-parser": "^2.2",
"presta/sitemap-bundle": "^4.1",
"sentry/sentry-symfony": "^5.3",
"setasign/fpdi": "^2.6",
"spatie/mjml-php": "^1.2",
"symfony/asset": "7.3.*",
"symfony/asset-mapper": "7.3.*",
"symfony/console": "7.3.*",
@@ -40,8 +53,11 @@
"symfony/validator": "7.3.*",
"symfony/web-link": "7.3.*",
"symfony/yaml": "7.3.*",
"twig/extra-bundle": "^2.12|^3.21",
"twig/twig": "^2.12|^3.21.1"
"tecnickcom/tcpdf": "^6.10",
"twig/extra-bundle": "^3.21",
"twig/intl-extra": "^3.21",
"twig/twig": "^3.21",
"vich/uploader-bundle": "^2.7"
},
"config": {
"allow-plugins": {
@@ -90,12 +106,14 @@
},
"extra": {
"symfony": {
"allow-contrib": false,
"allow-contrib": true,
"require": "7.3.*"
}
},
"require-dev": {
"fakerphp/faker": "^1.24",
"phpunit/phpunit": "^12.2.7",
"rector/rector": "^2.1",
"symfony/browser-kit": "7.3.*",
"symfony/css-selector": "7.3.*",
"symfony/debug-bundle": "7.3.*",

2952
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,4 +11,11 @@ return [
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true],
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
Presta\SitemapBundle\PrestaSitemapBundle::class => ['all' => true],
Sentry\SentryBundle\SentryBundle::class => ['prod' => true],
Vich\UploaderBundle\VichUploaderBundle::class => ['all' => true],
];

View File

@@ -0,0 +1,7 @@
# Read the documentation at https://github.com/thephpleague/flysystem-bundle/blob/master/docs/1-getting-started.md
flysystem:
storages:
default.storage:
adapter: 'local'
options:
directory: '%kernel.project_dir%/var/storage/default'

View File

@@ -0,0 +1,4 @@
# Documentation on how to configure the bundle can be found at: https://symfony.com/doc/current/bundles/LiipImagineBundle/basic-usage.html
liip_imagine:
# valid drivers options include "gd" or "gmagick" or "imagick"
driver: "gd"

View File

@@ -0,0 +1,10 @@
nelmio_cors:
defaults:
origin_regex: true
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
allow_headers: ['Content-Type', 'Authorization']
expose_headers: ['Link']
max_age: 3600
paths:
'^/': null

View File

@@ -0,0 +1,24 @@
when@prod:
sentry:
dsn: '%env(SENTRY_DSN)%'
options:
# Add request headers, cookies, IP address and the authenticated user
# see https://docs.sentry.io/platforms/php/data-management/data-collected/ for more info
# send_default_pii: true
ignore_exceptions:
- 'Symfony\Component\ErrorHandler\Error\FatalError'
- 'Symfony\Component\Debug\Exception\FatalErrorException'
# If you are using Monolog, you also need this additional configuration to log the errors correctly:
# https://docs.sentry.io/platforms/php/guides/symfony/#monolog-integration
# register_error_listener: false
# register_error_handler: false
# monolog:
# handlers:
# sentry:
# type: sentry
# level: !php/const Monolog\Logger::ERROR
# hub_id: Sentry\State\HubInterface
# fill_extra_context: true # Enables sending monolog context to Sentry
# process_psr_3_messages: false # Disables the resolution of PSR-3 placeholders

View File

@@ -0,0 +1,8 @@
vich_uploader:
db_driver: orm
#mappings:
# products:
# uri_prefix: /images/products
# upload_destination: '%kernel.project_dir%/public/images/products'
# namer: Vich\UploaderBundle\Naming\SmartUniqueNamer

View File

@@ -0,0 +1,2 @@
_liip_imagine:
resource: "@LiipImagineBundle/Resources/config/routing.yaml"

View File

@@ -1,5 +1,3 @@
# Makefile pour le projet Symfony e-cosplay-contest
# --- Configuration ---
PHP_EXEC = docker compose exec php
CONSOLE = $(PHP_EXEC) php bin/console
@@ -61,7 +59,7 @@ dbtest_remove: ## Crée la base de données
# --- Aide ---
.PHONY: help
help: ## Affiche cet écran d'aide
@echo "Commandes disponibles pour e-cosplay-contest :"
@echo "Commandes disponibles mainframe :"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help

8
phpstan.dist.neon Normal file
View File

@@ -0,0 +1,8 @@
parameters:
level: 6
paths:
- bin/
- config/
- public/
- src/
- tests/

View File

@@ -13,10 +13,20 @@
<php>
<ini name="display_errors" value="1" />
<ini name="error_reporting" value="-1" />
<server name="APP_ENV" value="test" force="true" />
<env name="APP_ENV" value="test"/>
<env name="MESSENGER_TRANSPORT_DSN" value="redis://localhost:6379/messages" force="true"/>
<server name="SHELL_VERBOSITY" value="-1" />
<env name="KERNEL_CLASS" value="App\Kernel" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak"/>
</php>
<coverage>
<report>
<clover outputFile=".coverage/clover.xml"/>
</report>
</coverage>
<testsuites>
<testsuite name="Project Test Suite">
<directory>tests</directory>
@@ -32,6 +42,7 @@
<directory>src</directory>
</include>
<deprecationTrigger>
<method>Doctrine\Deprecations\Deprecation::trigger</method>
<method>Doctrine\Deprecations\Deprecation::delegateTriggerToBackend</method>
@@ -40,5 +51,9 @@
</source>
<extensions>
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension">
<parameter name="clock-mock-namespaces" value="App" />
<parameter name="dns-mock-namespaces" value="App" />
</bootstrap>
</extensions>
</phpunit>

7
postcss.config.cjs Normal file
View File

@@ -0,0 +1,7 @@
module.exports = {
parser: 'postcss-scss',
plugins: {
'@tailwindcss/postcss': {},
'autoprefixer': {},
},
}

View File

@@ -35,6 +35,59 @@
"migrations/.gitignore"
]
},
"knplabs/knp-paginator-bundle": {
"version": "v6.8.1"
},
"league/flysystem-bundle": {
"version": "3.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "1.0",
"ref": "913dc3d7a5a1af0d2b044c5ac3a16e2f851d7380"
},
"files": [
"config/packages/flysystem.yaml",
"var/storage/.gitignore"
]
},
"liip/imagine-bundle": {
"version": "2.13",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
"version": "1.8",
"ref": "d1227d002b70d1a1f941d91845fcd7ac7fbfc929"
},
"files": [
"config/packages/liip_imagine.yaml",
"config/routes/liip_imagine.yaml"
]
},
"nelmio/cors-bundle": {
"version": "2.5",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "1.5",
"ref": "6bea22e6c564fba3a1391615cada1437d0bde39c"
},
"files": [
"config/packages/nelmio_cors.yaml"
]
},
"phpstan/phpstan": {
"version": "2.1",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
"version": "1.0",
"ref": "5e490cc197fb6bb1ae22e5abbc531ddc633b6767"
},
"files": [
"phpstan.dist.neon"
]
},
"phpunit/phpunit": {
"version": "12.2",
"recipe": {
@@ -50,6 +103,21 @@
"bin/phpunit"
]
},
"presta/sitemap-bundle": {
"version": "v4.1.3"
},
"sentry/sentry-symfony": {
"version": "5.3",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
"version": "5.0",
"ref": "f26c577142172082bb3aeef519af6b5944b86ac2"
},
"files": [
"config/packages/sentry.yaml"
]
},
"symfony/asset-mapper": {
"version": "7.3",
"recipe": {
@@ -294,5 +362,17 @@
},
"twig/extra-bundle": {
"version": "v3.21.0"
},
"vich/uploader-bundle": {
"version": "2.7",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
"version": "1.13",
"ref": "1b3064c2f6b255c2bc2f56461aaeb76b11e07e36"
},
"files": [
"config/packages/vich_uploader.yaml"
]
}
}

27
tsconfig.json Normal file
View File

@@ -0,0 +1,27 @@
{
"compilerOptions": {
// Enable latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,
// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}

120
vite.config.js Normal file
View File

@@ -0,0 +1,120 @@
// vite.config.js
import { defineConfig } from 'vite';
import { resolve } from 'path';
import JavaScriptObfuscator from 'rollup-plugin-javascript-obfuscator';
import tailwindcss from '@tailwindcss/vite'
// Si vous utilisez un framework comme Vue ou React, importez son plugin ici
// import vue from '@vitejs/plugin-vue';
// import react from '@vitejs/plugin-react';
export default defineConfig({
// La racine de votre projet frontend. Tous les chemins seront résolus par rapport à ce dossier.
root: './assets',
// Base publique de l'URL lorsque l'application est déployée.
base: '/assets/',
// --- Options du serveur de développement (vite dev) ---
server: {
// Écoute sur toutes les interfaces réseau locales
host: "0.0.0.0",
// Autorise l'accès depuis ces hôtes
allowedHosts: ["esyweb.local"],
// Port du serveur de développement Vite
port: 5173,
// Ne pas ouvrir automatiquement le navigateur
open: false,
// Configuration CORS pour autoriser les requêtes depuis votre backend Symfony
cors: {
origin: ['http://esyweb.local']
},
},
// --- Options de build (vite build) ---
build: {
// Chemin de sortie des fichiers compilés, relatif à la racine du projet
outDir: resolve(__dirname, 'public/build'),
// Les assets compilés iront dans public/build/assets
assetsDir: '',
// Vide le répertoire de sortie avant chaque build
emptyOutDir: true,
// Génère un fichier manifest.json pour l'intégration avec Symfony
manifest: true,
// Désactive les sourcemaps pour la production
sourcemap: false,
// Minification du code avec esbuild (rapide et efficace)
minify: 'esbuild',
// Configuration avancée de Rollup (utilisé par Vite pour le build)
rollupOptions: {
// Points d'entrée de votre application
input: {
administration: resolve(__dirname, 'assets/administration.js'),
// Exemple : 'styles': resolve(__dirname, 'assets/styles/main.scss'),
}
},
},
// --- Résolution des modules ---
resolve: {
// Alias pour simplifier les importations
alias: {
'@': resolve(__dirname, 'assets'),
},
// Extensions de fichiers à résoudre automatiquement
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue', '.scss', '.css'],
},
// --- Plugins Vite ---
plugins: [
// Ajoutez ici les plugins de framework (ex: vue(), react())
tailwindcss(),
// --- PLUGIN D'OBSCURCISSEMENT JAVASCRIPT ---
// Doit être l'un des derniers plugins pour s'appliquer au code final.
// ATTENTION : Ces options sont très agressives et peuvent casser votre code.
JavaScriptObfuscator({
// Options d'obscurcissement
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 1,
deadCodeInjection: true,
deadCodeInjectionThreshold: 1,
debugProtection: true,
debugProtectionInterval: 4000,
disableConsoleOutput: true,
identifierNamesGenerator: 'hexadecimal',
log: false,
numbersToExpressions: true,
renameGlobals: true, // Peut casser le code si des bibliothèques externes sont utilisées
selfDefending: true,
shuffleStringArray: true,
simplify: true,
splitStrings: true,
splitStringsChunkLength: 5,
stringArray: true,
stringArrayEncoding: ['base64'],
stringArrayIndexShift: true,
stringArrayRotate: true,
stringArrayShuffle: true,
stringArrayThreshold: 1,
transformObjectKeys: true, // Peut casser l'accès aux propriétés des objets
unicodeEscapeSequence: true,
}),
],
// Définition de variables d'environnement globales (si nécessaire)
define: {},
});