diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cff0ddd..1494f6e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,7 +5,7 @@ on: branches-ignore: [ main, develop ] pull_request: - branches: [ develop ] + branches: [ main, develop ] jobs: @@ -132,7 +132,7 @@ jobs: deploy-staging: runs-on: ubuntu-latest - if: github.ref == 'refs/heads/develop' + if: github.event_name == 'pull_request' && github.base_ref == 'develop' steps: - name: Deploy to Staging uses: appleboy/ssh-action@v1.0.0 @@ -145,9 +145,11 @@ jobs: git pull origin develop docker-compose --env-file .env.staging -f docker-compose.staging.yml down docker-compose --env-file .env.staging -f docker-compose.staging.yml up -d --build + docker compose -f docker-compose.staging.yml restart nginx + deploy-production: runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' steps: - name: Deploy to Production uses: appleboy/ssh-action@v1.0.0 @@ -161,6 +163,7 @@ jobs: script: | cd /var/www/EcoNum git pull origin main - docker compose -f docker-compose.prod.yml down - docker compose -f docker-compose.prod.yml build - docker compose -f docker-compose.prod.yml up -d \ No newline at end of file + docker compose -f docker-compose.prod.yml --env-file .env.prod down + docker compose -f docker-compose.prod.yml --env-file .env.prod build + docker compose -f docker-compose.prod.yml --env-file .env.prod up -d + docker compose -f docker-compose.prod.yml restart nginx \ No newline at end of file diff --git a/frontend/app/calculator/page.tsx b/frontend/app/calculator/page.tsx index 6ba0be7..914d60b 100644 --- a/frontend/app/calculator/page.tsx +++ b/frontend/app/calculator/page.tsx @@ -1,6 +1,9 @@ "use client"; +import { Metadata } from "next"; import { useState, useEffect } from "react"; +import { useRouter } from "next/navigation"; + import { Card, CardBody, @@ -10,11 +13,10 @@ import { Radio, Spinner, } from "@heroui/react"; -import { useRouter } from "next/navigation"; -import { getToken } from "@/lib/auth"; +import { getToken } from "@/lib/auth"; import { calculateScore } from '@/lib/utils/scoreCalculator' - +import Head from "next/head"; interface Reponse { id: number; @@ -145,75 +147,87 @@ export default function CalculatorPage() { if (result) { return ( -
+ <> + + Questionnaire - ConsoNum + + +
+ + +

+ Votre Résultat +

+
+ +

{result.score}/30

+

{result.profil}

+

{result.message}

+
+ + +
+
+
+
+ + ); + } + + return ( + <> + + Questionnaire - ConsoNum + + +
-

- Votre Résultat +

+ Calculateur d'Empreinte Numérique

- -

{result.score}/30

-

{result.profil}

-

{result.message}

-
- - -
+ + {questions.map((question) => ( + + +

+ {question.categorie} +

+

{question.texte}

+ + handleAnswerChange(question.id, parseInt(val)) + } + > + {question.reponses.map((reponse) => ( + + {reponse.texte} + + ))} + +
+
+ ))} + +
- ); - } - - return ( -
- - -

- Calculateur d'Empreinte Numérique -

-
- - {questions.map((question) => ( - - -

- {question.categorie} -

-

{question.texte}

- - handleAnswerChange(question.id, parseInt(val)) - } - > - {question.reponses.map((reponse) => ( - - {reponse.texte} - - ))} - -
-
- ))} - - -
-
-
+ ); } diff --git a/frontend/app/layout.tsx b/frontend/app/layout.tsx index 946e062..fc93e56 100644 --- a/frontend/app/layout.tsx +++ b/frontend/app/layout.tsx @@ -9,8 +9,17 @@ import CookieBanner from "@/components/ui/CookieBanner"; const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { - title: "ConsoNum", - description: "Calculateur d'empreinte numérique", + title: "ConsoNum - Mesurez votre empreinte numérique", + description: "Découvrez l'impact environnemental de vos habitudes digitales en 5 minutes. Conseils personnalisés pour un numérique plus responsable et écoresponsable.", + keywords: ["empreinte numérique", "sobriété numérique", "impact environnemental", "digital responsable"], + openGraph: { + title: "ConsoNum - Mesurez votre empreinte numérique", + description: "Découvrez l'impact de vos habitudes digitales", + url: "https://consonum.fr", + siteName: "ConsoNum", + images: ['/images/og-home.jpg'], + type: 'website', + }, }; export default function RootLayout({ diff --git a/frontend/public/robots.txt b/frontend/public/robots.txt new file mode 100644 index 0000000..85dd3f6 --- /dev/null +++ b/frontend/public/robots.txt @@ -0,0 +1,29 @@ +User-agent: * + +# Allowed public pages +Allow: / +Allow: /privacy-policy + +# Private pages +Disallow: /dashboard +Disallow: /profile +Disallow: /history +Disallow: /login +Disallow: /register +Disallow: /verify + +# API and backend +Disallow: /api/ + +# Payment +Disallow: /payment + +# Calculator +Disallow: /calculator + +# Tech files +Disallow: /_next/ +Disallow: /static/ + +# Sitemap +Sitemap: https://consonum.fr/sitemap.xml \ No newline at end of file