Skip to content

Commit

Permalink
feat: add needed of seo
Browse files Browse the repository at this point in the history
  • Loading branch information
khabzox committed Aug 28, 2024
1 parent 1ad1a09 commit d5ada2d
Show file tree
Hide file tree
Showing 20 changed files with 431 additions and 282 deletions.
3 changes: 3 additions & 0 deletions apps/nextjs-app/app/(pages)/about-us/layout.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import CTA from "@/components/landing-page/cta";
import Footer from "@/components/landing-page/footer";
import Navbar from "@/components/landing-page/navbar";
import { AboutUsPage } from "@/config/metadata";
import React from "react";

export const metadata = AboutUsPage;

const AboutUsLayout = ({ children }) => {
return (
<>
Expand Down
3 changes: 3 additions & 0 deletions apps/nextjs-app/app/(pages)/contact-us/layout.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import CTA from "@/components/landing-page/cta";
import Footer from "@/components/landing-page/footer";
import Navbar from "@/components/landing-page/navbar";
import { ContactUsPage } from "@/config/metadata";
import React from "react";

export const metadata = ContactUsPage;

const ContactUsLayout = ({ children }) => {
return (
<>
Expand Down
3 changes: 3 additions & 0 deletions apps/nextjs-app/app/(pages)/faqs/layout.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import CTA from "@/components/landing-page/cta";
import Footer from "@/components/landing-page/footer";
import Navbar from "@/components/landing-page/navbar";
import { FAQSPage } from "@/config/metadata";
import React from "react";

export const metadata = FAQSPage;

const FaqsLayout = ({ children }) => {
return (
<>
Expand Down
41 changes: 27 additions & 14 deletions apps/nextjs-app/app/api/tutorial/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from "firebase/firestore";
import { v4 as uuidv4 } from "uuid";
import { NextResponse } from "next/server";
import { auth } from "@clerk/nextjs/server";

export async function GET() {
// Utility function to handle errors
Expand Down Expand Up @@ -175,21 +176,33 @@ export async function GET() {
}

export async function POST(req) {
const sectionTitles = {
cours: "Cours",
course_powerpoint: "Cours PowerPoint",
corrected_exercises: "Exercices corrigés",
supervised_homework: "Devoirs surveillés",
educational_sheets: "Fiches pédagogiques",
diagnostic_assessments: "Évaluations diagnostiques",
videos: "Vidéos",
};

const subjectTitles = {
physics: "Physique",
chemistry: "Chimie",
};
try {
const { sessionClaims } = auth();

if (sessionClaims === null) {
return NextResponse.json({ message: "Unauthorized" }, { status: 401 });
} else if (sessionClaims?.metadata?.role !== "admin") {
return NextResponse.json(
{ message: "You don't have permission to access this resource" },
{ status: 403 }
);
}

const sectionTitles = {
cours: "Cours",
course_powerpoint: "Cours PowerPoint",
corrected_exercises: "Exercices corrigés",
supervised_homework: "Devoirs surveillés",
educational_sheets: "Fiches pédagogiques",
diagnostic_assessments: "Évaluations diagnostiques",
videos: "Vidéos",
};

const subjectTitles = {
physics: "Physique",
chemistry: "Chimie",
};

// Parse the request body
const body = await req.json();
const timestamp = new Date().toISOString();
Expand Down
14 changes: 14 additions & 0 deletions apps/nextjs-app/app/auth/sign-in/[[...sign-in]]/layout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Navbar from "@/components/landing-page/navbar";
import Footer from "@/components/landing-page/footer";

// export const metadata = SignInPage;

export default function SignInLayout({ children }) {
return (
<>
<Navbar />
<main className="pt-20">{children}</main>
<Footer />
</>
);
}
163 changes: 47 additions & 116 deletions apps/nextjs-app/app/auth/sign-in/[[...sign-in]]/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,148 +8,79 @@ import Link from 'next/link';
import { ArrowRight } from 'lucide-react';


import Image from "next/image";

export default function SignInPage() {
return (
<section className="bg-white">
<div className="lg:grid lg:min-h-screen lg:grid-cols-12">
<aside className="relative block h-16 lg:order-last lg:col-span-5 lg:h-full xl:col-span-6">
<Image
alt=""
src="/images/bg-sign-in-up-page.jpg"
className="absolute inset-0 h-full w-full object-cover "
fill
/>
</aside>

<main className="flex items-center justify-center px-8 py-8 sm:px-12 lg:col-span-7 lg:px-16 lg:py-12 xl:col-span-6">
<div className="max-w-xl lg:max-w-3xl">
<SignIn.Root>
<SignIn.Root>
<div className="flex flex-col justify-center items-center mx-auto my-8 max-w-md w-full">
<SignIn.Step name="start" className="w-full p-4 rounded-lg">
<div className="text-start pb-3">
<h1 className="text-accent text-2xl text-black"><b>Sign In to Your Account</b></h1>
<p className="pt-2">No account? <Link href={"/sign-up"} className="underline font-medium text-secondary">Create one</Link>
<div className="text-start pb-3 font-bold">
<h1 className="text-primary text-2xl">Connectez-vous à votre compte</h1>
<p className="pt-2">Pas de compte? <Link href={"/auth/sign-up"} className="underline font-medium text-secondary">Créer un</Link>
</p>
</div>

<Clerk.Connection
name="google"
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
fontWeight: '500',
gap: '0.75rem',
margin: '1rem 0',
width: '100%',
padding: '0.5rem 0',
textAlign: 'center',
borderWidth: '2.5px',
borderColor: '#5800FF',
borderRadius: '0.8rem',
transition: 'all 0.3s ease',
backgroundColor: 'transparent', // Initial background
color: '#5800FF', // Initial text color
position: 'relative',
overflow: 'hidden',
}}
onMouseOver={(e) => {
e.currentTarget.style.backgroundColor = '#5800FF'; // Change to your move color
e.currentTarget.style.color = 'white';
e.currentTarget.style.transform = 'scale(1.05)';
}}
onMouseOut={(e) => {
e.currentTarget.style.backgroundColor = 'transparent'; // Reset to initial
e.currentTarget.style.color = 'black';
e.currentTarget.style.transform = 'scale(1)';
}}
>
<GoogleIcon height="20" width="22" /> Continue with Google
</Clerk.Connection>


<div className="flex justify-center items-center my-2">
<div className="border-2 rounded-xl border-primary grow"></div>
<div className="px-5">or</div>
<div className="border-2 rounded-xl border-primary grow"></div>
</div>


<Clerk.Field name="identifier">
<Clerk.Label>Email:</Clerk.Label>
<Clerk.Input
className="w-full my-1 p-2 border-2 border-primary rounded-lg bg- placeholder:text-[#312f35] placeholder:opacity-70 focus:border-[#5800FF] focus:outline-none"
placeholder="example@gmail.com"
/>
<Clerk.FieldError className="text-red-400 opacity-100" />
</Clerk.Field>


<SignIn.Action
submit
className="relative flex justify-center items-center gap-2 w-full mt-5 py-2 bg-[#5800FF] text-white border-2 border-[#5800FF] rounded-lg transition-all duration-300 hover:bg-secondary/90 hover:text-white /50 hover:gap-2 group"
>
<span className="transition-all duration-300 group-hover:font-bold">
Continue
</span>
<ArrowRight
size={20}
className="transition-transform duration-300 group-hover:translate-x-2"
/>
</SignIn.Action>
<Clerk.Connection name="google" className="flex justify-center items-center font-medium gap-3 my-4 w-full py-2 text-center border-2 border-primary rounded-lg">
<GoogleIcon height="18" width="22" /> Continuer avec Google
</Clerk.Connection>

<div className="flex justify-center items-center my-2">
<div className="border rounded-xl border-primary grow"></div>
<div className="px-5">or</div>
<div className="border rounded-xl border-primary grow"></div>
</div>




<div className="flex items-center py-3 px-5 text-sm text-center">

<label htmlFor="terms-conditions" className="ml-1">
By clicking Continue, you agree to {" "}
<Link href={"/sign-up"} className="underline font-medium text-secondary" >Terms of Conditions</Link>
{" "} and {" "}
<Link href={"/sign-up"} className="underline font-medium text-secondary ">Privacy Policy</Link>
</label>
</div>

<Clerk.Field name="identifier">
<Clerk.Label>Email:</Clerk.Label>
<Clerk.Input
className="w-full my-1 p-2 border-2 border-primary rounded-lg bg-white placeholder:text-primary placeholder:opacity-70 focus:border-primary focus:outline-none"
placeholder="example@gmail.com"
/>
<Clerk.FieldError className="text-red-400 opacity-100" />
</Clerk.Field>

<SignIn.Action
submit
className="flex justify-center items-center gap-2 w-full mt-5 py-2 bg-primary text-white rounded-lg hover:opacity-95"
>
Continuer <ArrowRight size={20} />
</SignIn.Action>
<p className="py-3 px-5 text-sm text-center">En cliquant sur Continuer ou Se connecter, vous acceptez {" "}
<Link href={"/sign-up"} className="underline font-medium text-secondary">Conditions Générales</Link>
{" "} et {" "}
<Link href={"/sign-up"} className="underline font-medium text-secondary">Politique de Confidentialité</Link>
</p>
</SignIn.Step>

<SignIn.Step name="verifications">
<SignIn.Strategy name="email_code">
<h1>Check Your Email</h1>
<p>We sent a code to <SignIn.SafeIdentifier />.</p>
<h1>Vérifiez votre courrier électronique</h1>
<p>Nous avons envoyé un code à <SignIn.SafeIdentifier />.</p>

<Clerk.Field name="code" className="mt-5">
<Clerk.Label>Email code:</Clerk.Label>
<Clerk.Label>Code e-mail:</Clerk.Label>
<Clerk.Input
className="w-full my-1 p-2 border-2 border-accent rounded-lg bg-primary placeholder:text-accent placeholder:opacity-70 focus:border-accent focus:outline-none"
className="w-full my-1 p-2 border-2 border-primary rounded-lg bg-white placeholder:text-primary placeholder:opacity-70 focus:border-primary focus:outline-none"
/>
<Clerk.FieldError className="text-red-400 opacity-100" />
</Clerk.Field>

<SignIn.Action
submit
className="flex justify-center items-center gap-2 w-full mt-5 py-2 bg-accent text-white rounded-lg hover:opacity-95"
>Continue</SignIn.Action>
className="flex justify-center items-center gap-2 w-full mt-5 py-2 bg-primary text-white rounded-lg hover:opacity-95"
>Continuer</SignIn.Action>
</SignIn.Strategy>
</SignIn.Step>
</div>
</SignIn.Root>
</div>
</main>
</div>
</section>
);
}
function GoogleIcon(props) {
return (
<svg width={props.width || 31} height={props.height || 31} viewBox="0 0 31 31" fill="none" xmlns="http://www.w3.org/2000/svg" className={props.className} {...props}>
<path d="M30.6985 12.4643H29.45V12.4H15.5V18.6H24.2598C22.9818 22.2092 19.5478 24.8 15.5 24.8C10.3641 24.8 6.2 20.6359 6.2 15.5C6.2 10.3641 10.3641 6.2 15.5 6.2C17.8707 6.2 20.0275 7.09435 21.6698 8.55522L26.0539 4.17105C23.2856 1.59107 19.5827 0 15.5 0C6.94012 0 0 6.94012 0 15.5C0 24.0599 6.94012 31 15.5 31C24.0599 31 31 24.0599 31 15.5C31 14.4607 30.893 13.4462 30.6985 12.4643Z" fill="#FFC107" />
<path d="M1.78711 8.28553L6.87963 12.0203C8.25758 8.6087 11.5947 6.2 15.5 6.2C17.8707 6.2 20.0275 7.09435 21.6697 8.55523L26.0539 4.17105C23.2856 1.59108 19.5827 0 15.5 0C9.54641 0 4.38336 3.36118 1.78711 8.28553Z" fill="#FF3D00" />
<path d="M15.5 31C19.5037 31 23.1415 29.4678 25.892 26.9762L21.0948 22.9167C19.5386 24.0955 17.6042 24.8 15.5 24.8C11.4685 24.8 8.04532 22.2293 6.75572 18.6418L1.70117 22.5362C4.26642 27.5559 9.47597 31 15.5 31Z" fill="#4CAF50" />
<path d="M30.6985 12.4643H29.45V12.4H15.5V18.6H24.2598C23.646 20.3337 22.5308 21.8286 21.0924 22.9175L21.0947 22.916L25.892 26.9754C25.5525 27.2839 31 23.25 31 15.5C31 14.4607 30.893 13.4462 30.6985 12.4643Z" fill="#1976D2" />
</svg>
)
}
return (
<svg width={props.width || 31} height={props.height || 31} viewBox="0 0 31 31" fill="none" xmlns="http://www.w3.org/2000/svg" className={props.className} {...props}>
<path d="M30.6985 12.4643H29.45V12.4H15.5V18.6H24.2598C22.9818 22.2092 19.5478 24.8 15.5 24.8C10.3641 24.8 6.2 20.6359 6.2 15.5C6.2 10.3641 10.3641 6.2 15.5 6.2C17.8707 6.2 20.0275 7.09435 21.6698 8.55522L26.0539 4.17105C23.2856 1.59107 19.5827 0 15.5 0C6.94012 0 0 6.94012 0 15.5C0 24.0599 6.94012 31 15.5 31C24.0599 31 31 24.0599 31 15.5C31 14.4607 30.893 13.4462 30.6985 12.4643Z" fill="#FFC107" />
<path d="M1.78711 8.28553L6.87963 12.0203C8.25758 8.6087 11.5947 6.2 15.5 6.2C17.8707 6.2 20.0275 7.09435 21.6697 8.55523L26.0539 4.17105C23.2856 1.59108 19.5827 0 15.5 0C9.54641 0 4.38336 3.36118 1.78711 8.28553Z" fill="#FF3D00" />
<path d="M15.5 31C19.5037 31 23.1415 29.4678 25.892 26.9762L21.0948 22.9167C19.5386 24.0955 17.6042 24.8 15.5 24.8C11.4685 24.8 8.04532 22.2293 6.75572 18.6418L1.70117 22.5362C4.26642 27.5559 9.47597 31 15.5 31Z" fill="#4CAF50" />
<path d="M30.6985 12.4643H29.45V12.4H15.5V18.6H24.2598C23.646 20.3337 22.5308 21.8286 21.0924 22.9175L21.0947 22.916L25.892 26.9754C25.5525 27.2839 31 23.25 31 15.5C31 14.4607 30.893 13.4462 30.6985 12.4643Z" fill="#1976D2" />
</svg>
)
}
14 changes: 14 additions & 0 deletions apps/nextjs-app/app/auth/sign-up/[[...sign-up]]/layout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Navbar from "@/components/landing-page/navbar";
import Footer from "@/components/landing-page/footer";

// export const metadata = MetadataSignUp;

export default function AdminLayout({ children }) {
return (
<>
<Navbar />
<main className="pt-20">{children}</main>
<Footer />
</>
);
}
Loading

0 comments on commit d5ada2d

Please sign in to comment.