diff --git a/backend/controllers/statisticsController.js b/backend/controllers/statisticsController.js
index 40a9906..8686905 100644
--- a/backend/controllers/statisticsController.js
+++ b/backend/controllers/statisticsController.js
@@ -35,7 +35,6 @@ exports.getStatistics = async (req, res) => {
const statistics = {
totalMails: mails.length,
mailsByStatus: countMailsByStatus(mails),
- threatsByCategory: countThreatsByCategory(mails),
topSenders: getTopSenders(mails, 5),
detectRatio: calculateDetectRatio(mails)
};
@@ -176,40 +175,6 @@ function countMailsByStatus(mails) {
return statusCounts;
}
-/**
- * Compte les menaces par catégorie
- * @param {Array} mails - Liste des mails
- * @returns {Object} Comptage par catégorie de menace
- */
-function countThreatsByCategory(mails) {
- const threatCounts = {
- 'Phishing': 0,
- 'Malware': 0,
- 'Spam': 0,
- 'Other': 0
- };
-
- // Pour cette démo, nous attribuons des catégories en fonction du sujet
- // En production, il faudrait se baser sur des analyses plus précises
- mails.forEach(mail => {
- if (mail.Statut !== 'QUARANTINE' && mail.Statut !== 'ERROR') return;
-
- const subject = (mail.Sujet || '').toLowerCase();
-
- if (subject.includes('account') || subject.includes('password') || subject.includes('login')) {
- threatCounts['Phishing']++;
- } else if (subject.includes('virus') || subject.includes('malware')) {
- threatCounts['Malware']++;
- } else if (subject.includes('offer') || subject.includes('discount') || subject.includes('sale')) {
- threatCounts['Spam']++;
- } else {
- threatCounts['Other']++;
- }
- });
-
- return threatCounts;
-}
-
/**
* Identifie les principaux expéditeurs
* @param {Array} mails - Liste des mails
diff --git a/docker-compose.yml b/docker-compose.yml
index f59e1f9..4873a69 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,6 +1,9 @@
services:
detectish:
image: matthl2002/detectish:latest
+ # build:
+ # context: .
+ # dockerfile: Dockerfile
container_name: detectish
depends_on:
mysql:
@@ -22,6 +25,7 @@ services:
DB_PORT: 3306
CLAMAV_HOST: clamav
CLAMAV_PORT: 3310
+ MISTRAL_API_KEY: your_mistral_api_key # Replace with your actual Mistral API key
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:6969/health || exit 1"]
interval: 30s
@@ -32,6 +36,9 @@ services:
backend:
image: matthl2002/detectish-backend:latest
+ # build:
+ # context: ./backend
+ # dockerfile: Dockerfile
container_name: detectish-backend
depends_on:
mysql:
@@ -62,6 +69,9 @@ services:
frontend:
image: matthl2002/detectish-frontend:latest
+ # build:
+ # context: ./frontend
+ # dockerfile: Dockerfile
container_name: detectish-frontend
depends_on:
backend:
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index 5ad73a9..5f7fe1d 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -16,9 +16,11 @@
"chart.js": "^4.4.8",
"express-validator": "^7.2.1",
"jsonwebtoken": "^9.0.2",
+ "marked": "^15.0.8",
"pinia": "^3.0.1",
"postcss": "^8.5.3",
"primeicons": "^7.0.0",
+ "primevue": "^4.3.3",
"tailwindcss": "^4.0.12",
"vue": "^3.5.13",
"vue-router": "^4.5.0",
@@ -1304,6 +1306,65 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@primeuix/styled": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/@primeuix/styled/-/styled-0.5.1.tgz",
+ "integrity": "sha512-5Ftw/KSauDPClQ8F2qCyCUF7cIUEY4yLNikf0rKV7Vsb8zGYNK0dahQe7CChaR6M2Kn+NA2DSBSk76ZXqj6Uog==",
+ "license": "MIT",
+ "dependencies": {
+ "@primeuix/utils": "^0.5.3"
+ },
+ "engines": {
+ "node": ">=12.11.0"
+ }
+ },
+ "node_modules/@primeuix/styles": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@primeuix/styles/-/styles-1.0.3.tgz",
+ "integrity": "sha512-yHj/Q+fosJ1736Ty5lRbpqhKa9piou+xZPPppNHUDshq0+XhrFwDGggvPGmDAJyUIM+ChM/Nj8lPY/AwTNXAkg==",
+ "license": "MIT",
+ "dependencies": {
+ "@primeuix/styled": "^0.5.1"
+ }
+ },
+ "node_modules/@primeuix/utils": {
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/@primeuix/utils/-/utils-0.5.3.tgz",
+ "integrity": "sha512-7SGh7734wcF1/uK6RzO6Z6CBjGQ97GDHfpyl2F1G/c7R0z9hkT/V72ypDo82AWcCS7Ta07oIjDpOCTkSVZuEGQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.11.0"
+ }
+ },
+ "node_modules/@primevue/core": {
+ "version": "4.3.3",
+ "resolved": "https://registry.npmjs.org/@primevue/core/-/core-4.3.3.tgz",
+ "integrity": "sha512-kSkN5oourG7eueoFPIqiNX3oDT/f0I5IRK3uOY/ytz+VzTZp5yuaCN0Nt42ZQpVXjDxMxDvUhIdaXVrjr58NhQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@primeuix/styled": "^0.5.0",
+ "@primeuix/utils": "^0.5.1"
+ },
+ "engines": {
+ "node": ">=12.11.0"
+ },
+ "peerDependencies": {
+ "vue": "^3.5.0"
+ }
+ },
+ "node_modules/@primevue/icons": {
+ "version": "4.3.3",
+ "resolved": "https://registry.npmjs.org/@primevue/icons/-/icons-4.3.3.tgz",
+ "integrity": "sha512-ouQaxHyeFB6MSfEGGbjaK5Qv9efS1xZGetZoU5jcPm090MSYLFtroP1CuK3lZZAQals06TZ6T6qcoNukSHpK5w==",
+ "license": "MIT",
+ "dependencies": {
+ "@primeuix/utils": "^0.5.1",
+ "@primevue/core": "4.3.3"
+ },
+ "engines": {
+ "node": ">=12.11.0"
+ }
+ },
"node_modules/@rollup/pluginutils": {
"version": "5.1.4",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz",
@@ -4163,6 +4224,18 @@
"integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
"license": "MIT"
},
+ "node_modules/marked": {
+ "version": "15.0.8",
+ "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.8.tgz",
+ "integrity": "sha512-rli4l2LyZqpQuRve5C0rkn6pj3hT8EWPC+zkAxFTAJLxRbENfTAhEQq9itrmf1Y81QtAX5D/MYlGlIomNgj9lA==",
+ "license": "MIT",
+ "bin": {
+ "marked": "bin/marked.js"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
"node_modules/math-intrinsics": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
@@ -4806,6 +4879,22 @@
"integrity": "sha512-jK3Et9UzwzTsd6tzl2RmwrVY/b8raJ3QZLzoDACj+oTJ0oX7L9Hy+XnVwgo4QVKlKpnP/Ur13SXV/pVh4LzaDw==",
"license": "MIT"
},
+ "node_modules/primevue": {
+ "version": "4.3.3",
+ "resolved": "https://registry.npmjs.org/primevue/-/primevue-4.3.3.tgz",
+ "integrity": "sha512-nooYVoEz5CdP3EhUkD6c3qTdRmpLHZh75fBynkUkl46K8y5rksHTjdSISiDijwTA5STQIOkyqLb+RM+HQ6nC1Q==",
+ "license": "MIT",
+ "dependencies": {
+ "@primeuix/styled": "^0.5.0",
+ "@primeuix/styles": "^1.0.0",
+ "@primeuix/utils": "^0.5.1",
+ "@primevue/core": "4.3.3",
+ "@primevue/icons": "4.3.3"
+ },
+ "engines": {
+ "node": ">=12.11.0"
+ }
+ },
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
@@ -5342,9 +5431,9 @@
}
},
"node_modules/vite": {
- "version": "6.2.3",
- "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.3.tgz",
- "integrity": "sha512-IzwM54g4y9JA/xAeBPNaDXiBF8Jsgl3VBQ2YQ/wOY6fyW3xMdSoltIV3Bo59DErdqdE6RxUfv8W69DvUorE4Eg==",
+ "version": "6.2.6",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.6.tgz",
+ "integrity": "sha512-9xpjNl3kR4rVDZgPNdTL0/c6ao4km69a/2ihNQbcANz8RuCOK3hQBmLSJf3bRKVQjVMda+YvizNE8AwvogcPbw==",
"license": "MIT",
"dependencies": {
"esbuild": "^0.25.0",
diff --git a/frontend/package.json b/frontend/package.json
index e79ee3c..3ebaeb8 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -21,9 +21,11 @@
"chart.js": "^4.4.8",
"express-validator": "^7.2.1",
"jsonwebtoken": "^9.0.2",
+ "marked": "^15.0.8",
"pinia": "^3.0.1",
"postcss": "^8.5.3",
"primeicons": "^7.0.0",
+ "primevue": "^4.3.3",
"tailwindcss": "^4.0.12",
"vue": "^3.5.13",
"vue-router": "^4.5.0",
diff --git a/frontend/src/components/MailComponent.vue b/frontend/src/components/MailComponent.vue
index bccc061..792dbb3 100644
--- a/frontend/src/components/MailComponent.vue
+++ b/frontend/src/components/MailComponent.vue
@@ -32,7 +32,7 @@ const loadMailDetails = async () => {
const response = await api.get(`/mails/${props.mail.ID_Mail}/complete`);
mailDetails.value = response.data;
} catch (error) {
- console.error('Erreur lors du chargement des détails du mail:', error);
+ console.error('Error loading email details:', error);
} finally {
loading.value = false;
}
@@ -85,7 +85,7 @@ onMounted(() => {
-
+
{
/>
-
+
@@ -112,7 +112,7 @@ onMounted(() => {
-
+
Email Content
@@ -130,31 +130,31 @@ onMounted(() => {
-
+
Secure View: Links and forms are disabled
-
+
-
+
{{ mailDetails.content || "The content of this email is not available or is empty." }}
-
+
Warning: This email may contain unsafe content
-
+