Réalisation finale

This commit is contained in:
Logshiro
2025-10-24 16:13:37 +02:00
parent 6585fef404
commit 7e4cdedf3d
73 changed files with 6154 additions and 14 deletions

View File

@@ -0,0 +1,2 @@
INSERT INTO membre (nom, prenom, email, roles, password) VALUES
('Admin', 'System', 'admin@system.com', '["ROLE_ADMIN"]', '$2y$13$QJ7LSDls6TRywbxLOtRz9uMeNS0IlEAJ8IDy4o7hnZ1.9RSdKX5Ee');

View File

@@ -16,9 +16,6 @@ TRUNCATE TABLE projet;
TRUNCATE TABLE membre;
SET FOREIGN_KEY_CHECKS = 1;
-- ============================================
-- Insertion des membres (10 développeurs)
-- ============================================
INSERT INTO membre (nom, prenom, email) VALUES
('Dupont', 'Alice', 'alice.dupont@tech-corp.fr'),
('Martin', 'Bob', 'bob.martin@tech-corp.fr'),
@@ -30,6 +27,8 @@ INSERT INTO membre (nom, prenom, email) VALUES
('Michel', 'Hugo', 'hugo.michel@tech-corp.fr'),
('Laurent', 'Iris', 'iris.laurent@tech-corp.fr'),
('Garcia', 'Jean', 'jean.garcia@tech-corp.fr');
-- Ajout des rôles et mots de passe si nécessaire
-- Préparation pour l'ajout d'un administrateur via commande console
-- ============================================
-- Insertion des projets (3 projets)

View File

@@ -0,0 +1,160 @@
DROP DATABASE IF EXISTS ContribV2;
CREATE DATABASE IF NOT EXISTS ContribV2;
USE ContribV2;
-- ============================================
-- Création d'une base de données sécurisée : contribV2
-- ============================================
DROP DATABASE IF EXISTS contribV2;
CREATE DATABASE contribV2 CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
USE contribV2;
-- ============================================
-- Création des tables
-- ============================================
CREATE TABLE membre (
id INT AUTO_INCREMENT PRIMARY KEY,
nom VARCHAR(50) NOT NULL,
prenom VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
roles JSON NOT NULL DEFAULT '[]',
password VARCHAR(255) DEFAULT NULL
);
CREATE TABLE projet (
id INT AUTO_INCREMENT PRIMARY KEY,
nom VARCHAR(50) NOT NULL,
commentaire TEXT,
date_lancement DATE,
date_cloture DATE,
statut VARCHAR(20) NOT NULL
);
CREATE TABLE contribution (
id INT AUTO_INCREMENT PRIMARY KEY,
membre_id INT NOT NULL,
projet_id INT NOT NULL,
date_contribution DATE NOT NULL,
commentaire TEXT,
duree INT DEFAULT 0,
FOREIGN KEY (membre_id) REFERENCES membre(id),
FOREIGN KEY (projet_id) REFERENCES projet(id)
);
CREATE TABLE assistant_ia (
id INT AUTO_INCREMENT PRIMARY KEY,
nom VARCHAR(50) NOT NULL
);
CREATE TABLE contrib_ia (
id INT AUTO_INCREMENT PRIMARY KEY,
assistant_ia_id INT NOT NULL,
contribution_id INT NOT NULL,
evaluation_pertinence INT CHECK (evaluation_pertinence >= 1 AND evaluation_pertinence <= 5),
evaluation_temps INT CHECK (evaluation_temps >= 1 AND evaluation_temps <= 5),
commentaire TEXT,
FOREIGN KEY (assistant_ia_id) REFERENCES assistant_ia(id),
FOREIGN KEY (contribution_id) REFERENCES contribution(id)
);
-- ============================================
-- Configuration de la sécurité et des utilisateurs
-- ============================================
-- Supprimer lutilisateur existant sil existe déjà
DROP USER IF EXISTS 'appcontrib'@'%';
DROP USER IF EXISTS 'admincontrib'@'%';
-- Création dun utilisateur applicatif avec accès restreint
CREATE USER 'appcontrib'@'%' IDENTIFIED BY '123abc';
-- Création dun utilisateur administrateur (pour la maintenance)
CREATE USER 'admincontrib'@'%' IDENTIFIED BY 'Adm!nStrongPass2025';
-- Droits : lutilisateur applicatif peut uniquement lire/écrire/modifier les données
GRANT SELECT, INSERT, UPDATE, DELETE ON contribV2.* TO 'appcontrib'@'%';
-- Droits : ladministrateur a tous les privilèges
GRANT ALL PRIVILEGES ON contribV2.* TO 'admincontrib'@'%';
FLUSH PRIVILEGES;
-- ============================================
-- Jeu dessai
-- ============================================
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE contrib_ia;
TRUNCATE TABLE contribution;
TRUNCATE TABLE assistant_ia;
TRUNCATE TABLE projet;
TRUNCATE TABLE membre;
SET FOREIGN_KEY_CHECKS = 1;
-- Membres (10)
INSERT INTO membre (nom, prenom, email) VALUES
('Dupont', 'Alice', 'alice.dupont@tech-corp.fr'),
('Martin', 'Bob', 'bob.martin@tech-corp.fr'),
('Bernard', 'Claire', 'claire.bernard@tech-corp.fr'),
('Durand', 'David', 'david.durand@tech-corp.fr'),
('Leroy', 'Emma', 'emma.leroy@tech-corp.fr'),
('Moreau', 'Frank', 'frank.moreau@tech-corp.fr'),
('Simon', 'Grace', 'grace.simon@tech-corp.fr'),
('Michel', 'Hugo', 'hugo.michel@tech-corp.fr'),
('Laurent', 'Iris', 'iris.laurent@tech-corp.fr'),
('Garcia', 'Jean', 'jean.garcia@tech-corp.fr');
-- Projets (3)
INSERT INTO projet (nom, commentaire, date_lancement, date_cloture, statut) VALUES
('E-Commerce Platform', 'Développement d''une nouvelle plateforme e-commerce avec microservices', '2024-09-01', NULL, 'en_cours'),
('Mobile Banking App', 'Application mobile de gestion bancaire pour iOS et Android', '2024-10-15', '2025-03-31', 'en_cours'),
('Data Analytics Dashboard', 'Tableau de bord analytique temps réel pour le département marketing', '2024-08-01', '2024-12-20', 'termine');
-- Assistants IA (5)
INSERT INTO assistant_ia (nom) VALUES
('GitHub Copilot'),
('Claude 3.5'),
('ChatGPT-4'),
('Cursor AI'),
('Amazon CodeWhisperer');
-- Contributions
INSERT INTO contribution (membre_id, projet_id, date_contribution, commentaire, duree) VALUES
(1, 1, '2024-09-05', 'Architecture initiale et setup du projet', 480),
(2, 1, '2024-09-08', 'Configuration Docker et environnement de développement', 360),
(3, 1, '2024-09-12', 'Développement du service authentification', 420),
(1, 1, '2024-09-15', 'API Gateway et routing', 300),
(4, 1, '2024-09-20', 'Service de gestion des produits', 540),
(5, 1, '2024-09-25', 'Intégration système de paiement Stripe', 480),
(2, 1, '2024-10-02', 'Tests unitaires service authentification', 240),
(3, 1, '2024-10-10', 'Optimisation des requêtes base de données', 360),
(6, 2, '2024-10-16', 'Setup React Native et architecture mobile', 420),
(7, 2, '2024-10-18', 'Interface utilisateur - écrans de connexion', 360),
(8, 2, '2024-10-22', 'Système de notifications push', 300),
(9, 2, '2024-10-25', 'Module de virement bancaire', 480),
(10, 2, '2024-10-28', 'Sécurisation avec biométrie', 420),
(6, 2, '2024-11-02', 'Intégration API bancaire', 540),
(7, 2, '2024-11-05', 'Tests d''interface utilisateur', 240),
(1, 3, '2024-08-05', 'Architecture backend Node.js et Express', 480),
(3, 3, '2024-08-10', 'Configuration base de données PostgreSQL', 360),
(6, 3, '2024-08-15', 'Dashboard React avec graphiques D3.js', 540),
(8, 3, '2024-08-22', 'WebSocket pour données temps réel', 420),
(1, 3, '2024-09-01', 'Optimisation des performances', 300),
(3, 3, '2024-09-10', 'Documentation et déploiement', 240);
-- Contributions avec IA
INSERT INTO contrib_ia (assistant_ia_id, contribution_id, evaluation_pertinence, evaluation_temps, commentaire) VALUES
(1, 1, 4, 5, 'Copilot très utile pour générer la structure de base du projet'),
(2, 3, 5, 4, 'Claude excellent pour implémenter la logique d''authentification JWT'),
(3, 5, 3, 3, 'ChatGPT-4 a aidé mais nécessitait des ajustements pour le service produits'),
(1, 7, 4, 4, 'Bonne génération des tests unitaires avec Copilot'),
(4, 9, 5, 5, 'Cursor AI excellent pour le développement React Native'),
(2, 11, 4, 4, 'Claude très pertinent pour les algorithmes de chiffrement'),
(5, 13, 3, 4, 'CodeWhisperer rapide mais code nécessitant refactoring'),
(1, 15, 4, 5, 'Copilot efficace pour le setup Node.js'),
(3, 17, 5, 3, 'ChatGPT-4 excellent pour les visualisations D3.js mais un peu lent'),
(2, 19, 4, 4, 'Claude bon pour l''optimisation des requêtes SQL');

View File

@@ -2,7 +2,9 @@ create table membre(
id int auto_increment primary key,
nom varchar(50) not null,
prenom varchar(50) not null,
email varchar(100) not null unique
email varchar(100) not null unique,
roles json not null default '[]',
password varchar(255) default null
);
create table projet(

View File

@@ -0,0 +1,143 @@
DROP DATABASE IF EXISTS ContribV2;
CREATE DATABASE IF NOT EXISTS ContribV2;
USE ContribV2;
-- ============================================
-- Base sécurisée pour gestion de contributions
-- ============================================
-- Réinitialisation
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS contrib_ia, contribution, assistant_ia, projet, membre;
SET FOREIGN_KEY_CHECKS = 1;
-- ============================================
-- Table des membres (utilisateurs sécurisés)
-- ============================================
CREATE TABLE membre (
id INT AUTO_INCREMENT PRIMARY KEY,
nom VARCHAR(50) NOT NULL,
prenom VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
roles JSON NOT NULL, -- Colonne requise par Symfony Security
password VARCHAR(255) DEFAULT NULL, -- Colonne requise par Symfony Security
date_creation TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
actif BOOLEAN DEFAULT TRUE,
CONSTRAINT chk_email_format CHECK (email LIKE '%@%.%')
);
-- ============================================
-- Table des projets
-- ============================================
CREATE TABLE projet (
id INT AUTO_INCREMENT PRIMARY KEY,
nom VARCHAR(50) NOT NULL,
commentaire TEXT,
date_lancement DATE,
date_cloture DATE,
statut ENUM('en_cours', 'termine', 'annule') NOT NULL DEFAULT 'en_cours'
);
-- ============================================
-- Table des contributions
-- ============================================
CREATE TABLE contribution (
id INT AUTO_INCREMENT PRIMARY KEY,
membre_id INT NOT NULL,
projet_id INT NOT NULL,
date_contribution DATE NOT NULL,
commentaire TEXT,
duree INT DEFAULT 0 CHECK (duree >= 0),
FOREIGN KEY (membre_id) REFERENCES membre(id) ON DELETE CASCADE,
FOREIGN KEY (projet_id) REFERENCES projet(id) ON DELETE CASCADE
);
-- ============================================
-- Table des assistants IA
-- ============================================
CREATE TABLE assistant_ia (
id INT AUTO_INCREMENT PRIMARY KEY,
nom VARCHAR(50) NOT NULL UNIQUE
);
-- ============================================
-- Table des interactions IA / contributions
-- ============================================
CREATE TABLE contrib_ia (
id INT AUTO_INCREMENT PRIMARY KEY,
assistant_ia_id INT NOT NULL,
contribution_id INT NOT NULL,
evaluation_pertinence INT CHECK (evaluation_pertinence BETWEEN 1 AND 5),
evaluation_temps INT CHECK (evaluation_temps BETWEEN 1 AND 5),
commentaire TEXT,
FOREIGN KEY (assistant_ia_id) REFERENCES assistant_ia(id) ON DELETE CASCADE,
FOREIGN KEY (contribution_id) REFERENCES contribution(id) ON DELETE CASCADE
);
-- ============================================
-- Jeu d'essai
-- ============================================
-- Membres avec mots de passe hachés (mot de passe: "password")
INSERT INTO membre (nom, prenom, email, roles, password) VALUES
('Dupont', 'Alice', 'alice.dupont@tech-corp.fr', '["ROLE_ADMIN"]', '$2y$13$G5y.TE7Vfw.7tGEOfYpCgeqC4zxlzhrBb6TViUINyZC0hYtSXaWeu'),
('Martin', 'Bob', 'bob.martin@tech-corp.fr', '["ROLE_DEV"]', '$2y$13$G5y.TE7Vfw.7tGEOfYpCgeqC4zxlzhrBb6TViUINyZC0hYtSXaWeu'),
('Bernard', 'Claire', 'claire.bernard@tech-corp.fr', '["ROLE_DEV"]', '$2y$13$G5y.TE7Vfw.7tGEOfYpCgeqC4zxlzhrBb6TViUINyZC0hYtSXaWeu'),
('Durand', 'David', 'david.durand@tech-corp.fr', '["ROLE_DEV"]', '$2y$13$G5y.TE7Vfw.7tGEOfYpCgeqC4zxlzhrBb6TViUINyZC0hYtSXaWeu'),
('Leroy', 'Emma', 'emma.leroy@tech-corp.fr', '["ROLE_DEV"]', '$2y$13$G5y.TE7Vfw.7tGEOfYpCgeqC4zxlzhrBb6TViUINyZC0hYtSXaWeu'),
('Moreau', 'Frank', 'frank.moreau@tech-corp.fr', '["ROLE_DEV"]', '$2y$13$G5y.TE7Vfw.7tGEOfYpCgeqC4zxlzhrBb6TViUINyZC0hYtSXaWeu'),
('Simon', 'Grace', 'grace.simon@tech-corp.fr', '["ROLE_DEV"]', '$2y$13$G5y.TE7Vfw.7tGEOfYpCgeqC4zxlzhrBb6TViUINyZC0hYtSXaWeu'),
('Michel', 'Hugo', 'hugo.michel@tech-corp.fr', '["ROLE_DEV"]', '$2y$13$G5y.TE7Vfw.7tGEOfYpCgeqC4zxlzhrBb6TViUINyZC0hYtSXaWeu'),
('Laurent', 'Iris', 'iris.laurent@tech-corp.fr', '["ROLE_DEV"]', '$2y$13$G5y.TE7Vfw.7tGEOfYpCgeqC4zxlzhrBb6TViUINyZC0hYtSXaWeu'),
('Garcia', 'Jean', 'jean.garcia@tech-corp.fr', '["ROLE_DEV"]', '$2y$13$G5y.TE7Vfw.7tGEOfYpCgeqC4zxlzhrBb6TViUINyZC0hYtSXaWeu');
-- R!d93xT#pWq7Zb2@
-- Projets
INSERT INTO projet (nom, commentaire, date_lancement, date_cloture, statut) VALUES
('E-Commerce Platform', 'Développement d''une nouvelle plateforme e-commerce avec microservices', '2024-09-01', NULL, 'en_cours'),
('Mobile Banking App', 'Application mobile de gestion bancaire pour iOS et Android', '2024-10-15', '2025-03-31', 'en_cours'),
('Data Analytics Dashboard', 'Tableau de bord analytique temps réel pour le département marketing', '2024-08-01', '2024-12-20', 'termine');
-- Assistants IA
INSERT INTO assistant_ia (nom) VALUES
('GitHub Copilot'),
('Claude 3.5'),
('ChatGPT-4'),
('Cursor AI'),
('Amazon CodeWhisperer');
-- Contributions
INSERT INTO contribution (membre_id, projet_id, date_contribution, commentaire, duree) VALUES
(1, 1, '2024-09-05', 'Architecture initiale et setup du projet', 480),
(2, 1, '2024-09-08', 'Configuration Docker et environnement de développement', 360),
(3, 1, '2024-09-12', 'Développement du service authentification', 420),
(1, 1, '2024-09-15', 'API Gateway et routing', 300),
(4, 1, '2024-09-20', 'Service de gestion des produits', 540),
(5, 1, '2024-09-25', 'Intégration système de paiement Stripe', 480),
(2, 1, '2024-10-02', 'Tests unitaires service authentification', 240),
(3, 1, '2024-10-10', 'Optimisation des requêtes base de données', 360),
(6, 2, '2024-10-16', 'Setup React Native et architecture mobile', 420),
(7, 2, '2024-10-18', 'Interface utilisateur - écrans de connexion', 360),
(8, 2, '2024-10-22', 'Système de notifications push', 300),
(9, 2, '2024-10-25', 'Module de virement bancaire', 480),
(10, 2, '2024-10-28', 'Sécurisation avec biométrie', 420),
(6, 2, '2024-11-02', 'Intégration API bancaire', 540),
(7, 2, '2024-11-05', 'Tests d''interface utilisateur', 240),
(1, 3, '2024-08-05', 'Architecture backend Node.js et Express', 480),
(3, 3, '2024-08-10', 'Configuration base de données PostgreSQL', 360),
(6, 3, '2024-08-15', 'Dashboard React avec graphiques D3.js', 540),
(8, 3, '2024-08-22', 'WebSocket pour données temps réel', 420),
(1, 3, '2024-09-01', 'Optimisation des performances', 300),
(3, 3, '2024-09-10', 'Documentation et déploiement', 240);
-- Contributions IA (~50%)
INSERT INTO contrib_ia (assistant_ia_id, contribution_id, evaluation_pertinence, evaluation_temps, commentaire) VALUES
(1, 1, 4, 5, 'Copilot très utile pour générer la structure de base du projet'),
(2, 3, 5, 4, 'Claude excellent pour implémenter la logique d''authentification JWT'),
(3, 5, 3, 3, 'ChatGPT-4 a aidé mais nécessitait des ajustements pour le service produits'),
(1, 7, 4, 4, 'Bonne génération des tests unitaires avec Copilot'),
(4, 9, 5, 5, 'Cursor AI excellent pour le développement React Native'),
(2, 11, 4, 4, 'Claude très pertinent pour les algorithmes de chiffrement'),
(5, 13, 3, 4, 'CodeWhisperer rapide mais code nécessitant refactoring'),
(1, 15, 4, 5, 'Copilot efficace pour le setup Node.js'),
(3, 17, 5, 3, 'ChatGPT-4 excellent pour les visualisations D3.js mais un peu lent'),
(2, 19, 4, 4, 'Claude bon pour l''optimisation des requêtes SQL');