Compare commits

..

No commits in common. "ai-dev" and "master" have entirely different histories.

3 changed files with 1280 additions and 456 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
import * as icon from '@mdi/js'; import * as icon from '@mdi/js';
import Head from 'next/head' import Head from 'next/head'
import React, { useEffect } from 'react' import React from 'react'
import axios from 'axios';
import type { ReactElement } from 'react' import type { ReactElement } from 'react'
import LayoutAuthenticated from '../layouts/Authenticated' import LayoutAuthenticated from '../layouts/Authenticated'
import SectionMain from '../components/SectionMain' import SectionMain from '../components/SectionMain'
@ -8,166 +9,398 @@ import SectionTitleLineWithButton from '../components/SectionTitleLineWithButton
import BaseIcon from "../components/BaseIcon"; import BaseIcon from "../components/BaseIcon";
import { getPageTitle } from '../config' import { getPageTitle } from '../config'
import Link from "next/link"; import Link from "next/link";
import BaseButton from '../components/BaseButton';
import CardBox from '../components/CardBox'; import { hasPermission } from "../helpers/userPermissions";
import { fetchWidgets } from '../stores/roles/rolesSlice';
import { WidgetCreator } from '../components/WidgetCreator/WidgetCreator';
import { SmartWidget } from '../components/SmartWidget/SmartWidget';
import { useAppDispatch, useAppSelector } from '../stores/hooks'; import { useAppDispatch, useAppSelector } from '../stores/hooks';
import { fetch as fetchCourses } from '../stores/courses/coursesSlice';
import { fetch as fetchEnrollments, create as enrollInCourse } from '../stores/enrollments/enrollmentsSlice';
const Dashboard = () => { const Dashboard = () => {
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const iconsColor = useAppSelector((state) => state.style.iconsColor);
const corners = useAppSelector((state) => state.style.corners);
const cardsStyle = useAppSelector((state) => state.style.cardsStyle);
const loadingMessage = 'Loading...';
const [users, setUsers] = React.useState(loadingMessage);
const [roles, setRoles] = React.useState(loadingMessage);
const [permissions, setPermissions] = React.useState(loadingMessage);
const [courses, setCourses] = React.useState(loadingMessage);
const [lessons, setLessons] = React.useState(loadingMessage);
const [enrollments, setEnrollments] = React.useState(loadingMessage);
const [lesson_progress, setLesson_progress] = React.useState(loadingMessage);
const [course_announcements, setCourse_announcements] = React.useState(loadingMessage);
const [course_reviews, setCourse_reviews] = React.useState(loadingMessage);
const [widgetsRole, setWidgetsRole] = React.useState({
role: { value: '', label: '' },
});
const { currentUser } = useAppSelector((state) => state.auth); const { currentUser } = useAppSelector((state) => state.auth);
const { courses } = useAppSelector((state) => state.courses); const { isFetchingQuery } = useAppSelector((state) => state.openAi);
const { enrollments } = useAppSelector((state) => state.enrollments);
useEffect(() => { const { rolesWidgets, loading } = useAppSelector((state) => state.roles);
if (currentUser) {
dispatch(fetchCourses({ query: '' }));
dispatch(fetchEnrollments({ query: `?student=${currentUser.id}` }));
}
}, [currentUser, dispatch]);
const handleEnroll = async (courseId: string) => {
const data = {
course: courseId,
student: currentUser?.id,
status: 'active',
enrolled_at: new Date().toISOString()
};
await dispatch(enrollInCourse(data));
dispatch(fetchEnrollments({ query: `?student=${currentUser?.id}` }));
};
const isEnrolled = (courseId: string) => { async function loadData() {
return Array.isArray(enrollments) && enrollments.some((e: any) => e.courseId === courseId); const entities = ['users','roles','permissions','courses','lessons','enrollments','lesson_progress','course_announcements','course_reviews',];
}; const fns = [setUsers,setRoles,setPermissions,setCourses,setLessons,setEnrollments,setLesson_progress,setCourse_announcements,setCourse_reviews,];
const isLearner = currentUser?.app_role?.name === 'Learner'; const requests = entities.map((entity, index) => {
if (!isLearner) { if(hasPermission(currentUser, `READ_${entity.toUpperCase()}`)) {
return ( return axios.get(`/${entity.toLowerCase()}/count`);
<> } else {
<Head><title>{getPageTitle('Overview')}</title></Head> fns[index](null);
<SectionMain> return Promise.resolve({data: {count: null}});
<SectionTitleLineWithButton icon={icon.mdiChartTimelineVariant} title='Dashboard' main /> }
<div className='grid grid-cols-1 gap-6 lg:grid-cols-3 mb-6'>
<Link href='/courses/courses-list'> });
<CardBox className="cursor-pointer hover:shadow-lg transition-shadow">
<div className="flex items-center justify-between"> Promise.allSettled(requests).then((results) => {
<div> results.forEach((result, i) => {
<p className="text-gray-500">Total Courses</p> if (result.status === 'fulfilled') {
<p className="text-3xl font-bold">{courses.length || 0}</p> fns[i](result.value.data.count);
</div> } else {
<BaseIcon path={icon.mdiBookOpenVariant} size={48} className="text-indigo-600" /> fns[i](result.reason.message);
</div> }
</CardBox> });
</Link> });
<Link href='/users/users-list'>
<CardBox className="cursor-pointer hover:shadow-lg transition-shadow">
<div className="flex items-center justify-between">
<div>
<p className="text-gray-500">Total Users</p>
<p className="text-3xl font-bold">...</p>
</div>
<BaseIcon path={icon.mdiAccountGroup} size={48} className="text-blue-600" />
</div>
</CardBox>
</Link>
<Link href='/enrollments/enrollments-list'>
<CardBox className="cursor-pointer hover:shadow-lg transition-shadow">
<div className="flex items-center justify-between">
<div>
<p className="text-gray-500">Total Enrollments</p>
<p className="text-3xl font-bold">...</p>
</div>
<BaseIcon path={icon.mdiSchool} size={48} className="text-green-600" />
</div>
</CardBox>
</Link>
</div>
</SectionMain>
</>
);
} }
return ( async function getWidgets(roleId) {
<> await dispatch(fetchWidgets(roleId));
<Head><title>{getPageTitle('Student Dashboard')}</title></Head> }
<SectionMain> React.useEffect(() => {
<SectionTitleLineWithButton icon={icon.mdiSchool} title={`Welcome back, ${currentUser?.firstName}!`} main /> if (!currentUser) return;
loadData().then();
setWidgetsRole({ role: { value: currentUser?.app_role?.id, label: currentUser?.app_role?.name } });
}, [currentUser]);
<h2 className="text-2xl font-bold mb-6 mt-8">Your Enrolled Courses</h2> React.useEffect(() => {
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3 mb-12"> if (!currentUser || !widgetsRole?.role?.value) return;
{Array.isArray(enrollments) && enrollments.length > 0 ? ( getWidgets(widgetsRole?.role?.value || '').then();
enrollments.map((enrollment: any) => ( }, [widgetsRole?.role?.value]);
<CardBox key={enrollment.id} className="flex flex-col h-full border-t-4 border-indigo-500">
<div className="flex-grow"> return (
<h3 className="text-xl font-bold mb-2">{enrollment.course?.title}</h3> <>
<p className="text-gray-600 dark:text-gray-400 line-clamp-2 mb-4">{enrollment.course?.subtitle}</p> <Head>
<div className="flex items-center text-sm text-gray-500 mb-4"> <title>
<BaseIcon path={icon.mdiProgressClock} size={18} className="mr-2 text-amber-500" /> {getPageTitle('Overview')}
<span>Status: {enrollment.status}</span> </title>
</div> </Head>
</div> <SectionMain>
<BaseButton <SectionTitleLineWithButton
label="Continue Learning" icon={icon.mdiChartTimelineVariant}
color="info" title='Overview'
href={`/courses/courses-view/?id=${enrollment.courseId}`} main>
className="w-full" {''}
/> </SectionTitleLineWithButton>
</CardBox>
)) {hasPermission(currentUser, 'CREATE_ROLES') && <WidgetCreator
) : ( currentUser={currentUser}
<CardBox className="col-span-full py-12 text-center border-dashed border-2 border-gray-300"> isFetchingQuery={isFetchingQuery}
<BaseIcon path={icon.mdiBookOpenVariant} size={64} className="mx-auto text-gray-300 mb-4" /> setWidgetsRole={setWidgetsRole}
<p className="text-xl text-gray-500">You haven&apos;t enrolled in any courses yet.</p> widgetsRole={widgetsRole}
<p className="text-gray-400">Browse available courses below to get started!</p> />}
</CardBox> {!!rolesWidgets.length &&
)} hasPermission(currentUser, 'CREATE_ROLES') && (
<p className=' text-gray-500 dark:text-gray-400 mb-4'>
{`${widgetsRole?.role?.label || 'Users'}'s widgets`}
</p>
)}
<div className='grid grid-cols-1 gap-6 lg:grid-cols-4 mb-6 grid-flow-dense'>
{(isFetchingQuery || loading) && (
<div className={` ${corners !== 'rounded-full'? corners : 'rounded-3xl'} dark:bg-dark-900 text-lg leading-tight text-gray-500 flex items-center ${cardsStyle} dark:border-dark-700 p-6`}>
<BaseIcon
className={`${iconsColor} animate-spin mr-5`}
w='w-16'
h='h-16'
size={48}
path={icon.mdiLoading}
/>{' '}
Loading widgets...
</div> </div>
)}
<hr className="my-12 border-gray-200 dark:border-dark-700" /> { rolesWidgets &&
rolesWidgets.map((widget) => (
<SmartWidget
key={widget.id}
userId={currentUser?.id}
widget={widget}
roleId={widgetsRole?.role?.value || ''}
admin={hasPermission(currentUser, 'CREATE_ROLES')}
/>
))}
</div>
<h2 className="text-2xl font-bold mb-6">Explore Courses</h2> {!!rolesWidgets.length && <hr className='my-6 ' />}
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
{Array.isArray(courses) && courses.map((course: any) => ( <div id="dashboard" className='grid grid-cols-1 gap-6 lg:grid-cols-3 mb-6'>
<CardBox key={course.id} className="flex flex-col h-full hover:shadow-md transition-shadow">
<div className="flex-grow">
<div className="h-40 bg-indigo-50 dark:bg-dark-800 rounded-lg mb-4 flex items-center justify-center overflow-hidden"> {hasPermission(currentUser, 'READ_USERS') && <Link href={'/users/users-list'}>
{course.thumbnail && course.thumbnail[0] ? ( <div
<img src={course.thumbnail[0]?.publicUrl} alt={course.title} className="w-full h-full object-cover" /> className={`${corners !== 'rounded-full'? corners : 'rounded-3xl'} dark:bg-dark-900 ${cardsStyle} dark:border-dark-700 p-6`}
) : ( >
<BaseIcon path={icon.mdiBookOpenVariant} size={48} className="text-indigo-200" /> <div className="flex justify-between align-center">
)} <div>
</div> <div className="text-lg leading-tight text-gray-500 dark:text-gray-400">
<h3 className="text-lg font-bold mb-1 line-clamp-1">{course.title}</h3> Users
<p className="text-xs text-indigo-600 font-semibold uppercase tracking-wider mb-2">{course.category}</p>
<p className="text-gray-600 dark:text-gray-400 text-sm line-clamp-3 mb-4">{course.description?.replace(/<[^>]*>?/gm, '')}</p>
</div> </div>
<div className="mt-4"> <div className="text-3xl leading-tight font-semibold">
{isEnrolled(course.id) ? ( {users}
<BaseButton
label="Enrolled"
color="white"
className="w-full cursor-default opacity-70 border-gray-300"
disabled
/>
) : (
<BaseButton
label="Enroll Now"
color="info"
onClick={() => handleEnroll(course.id)}
className="w-full bg-indigo-600 hover:bg-indigo-700 border-none"
/>
)}
</div> </div>
</CardBox> </div>
))} <div>
<BaseIcon
className={`${iconsColor}`}
w="w-16"
h="h-16"
size={48}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
path={icon.mdiAccountGroup || icon.mdiTable}
/>
</div>
</div>
</div> </div>
</SectionMain> </Link>}
</>
); {hasPermission(currentUser, 'READ_ROLES') && <Link href={'/roles/roles-list'}>
<div
className={`${corners !== 'rounded-full'? corners : 'rounded-3xl'} dark:bg-dark-900 ${cardsStyle} dark:border-dark-700 p-6`}
>
<div className="flex justify-between align-center">
<div>
<div className="text-lg leading-tight text-gray-500 dark:text-gray-400">
Roles
</div>
<div className="text-3xl leading-tight font-semibold">
{roles}
</div>
</div>
<div>
<BaseIcon
className={`${iconsColor}`}
w="w-16"
h="h-16"
size={48}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
path={icon.mdiShieldAccountVariantOutline || icon.mdiTable}
/>
</div>
</div>
</div>
</Link>}
{hasPermission(currentUser, 'READ_PERMISSIONS') && <Link href={'/permissions/permissions-list'}>
<div
className={`${corners !== 'rounded-full'? corners : 'rounded-3xl'} dark:bg-dark-900 ${cardsStyle} dark:border-dark-700 p-6`}
>
<div className="flex justify-between align-center">
<div>
<div className="text-lg leading-tight text-gray-500 dark:text-gray-400">
Permissions
</div>
<div className="text-3xl leading-tight font-semibold">
{permissions}
</div>
</div>
<div>
<BaseIcon
className={`${iconsColor}`}
w="w-16"
h="h-16"
size={48}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
path={icon.mdiShieldAccountOutline || icon.mdiTable}
/>
</div>
</div>
</div>
</Link>}
{hasPermission(currentUser, 'READ_COURSES') && <Link href={'/courses/courses-list'}>
<div
className={`${corners !== 'rounded-full'? corners : 'rounded-3xl'} dark:bg-dark-900 ${cardsStyle} dark:border-dark-700 p-6`}
>
<div className="flex justify-between align-center">
<div>
<div className="text-lg leading-tight text-gray-500 dark:text-gray-400">
Courses
</div>
<div className="text-3xl leading-tight font-semibold">
{courses}
</div>
</div>
<div>
<BaseIcon
className={`${iconsColor}`}
w="w-16"
h="h-16"
size={48}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
path={'mdiBookOpenPageVariant' in icon ? icon['mdiBookOpenPageVariant' as keyof typeof icon] : icon.mdiTable || icon.mdiTable}
/>
</div>
</div>
</div>
</Link>}
{hasPermission(currentUser, 'READ_LESSONS') && <Link href={'/lessons/lessons-list'}>
<div
className={`${corners !== 'rounded-full'? corners : 'rounded-3xl'} dark:bg-dark-900 ${cardsStyle} dark:border-dark-700 p-6`}
>
<div className="flex justify-between align-center">
<div>
<div className="text-lg leading-tight text-gray-500 dark:text-gray-400">
Lessons
</div>
<div className="text-3xl leading-tight font-semibold">
{lessons}
</div>
</div>
<div>
<BaseIcon
className={`${iconsColor}`}
w="w-16"
h="h-16"
size={48}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
path={'mdiPlayBoxMultiple' in icon ? icon['mdiPlayBoxMultiple' as keyof typeof icon] : icon.mdiTable || icon.mdiTable}
/>
</div>
</div>
</div>
</Link>}
{hasPermission(currentUser, 'READ_ENROLLMENTS') && <Link href={'/enrollments/enrollments-list'}>
<div
className={`${corners !== 'rounded-full'? corners : 'rounded-3xl'} dark:bg-dark-900 ${cardsStyle} dark:border-dark-700 p-6`}
>
<div className="flex justify-between align-center">
<div>
<div className="text-lg leading-tight text-gray-500 dark:text-gray-400">
Enrollments
</div>
<div className="text-3xl leading-tight font-semibold">
{enrollments}
</div>
</div>
<div>
<BaseIcon
className={`${iconsColor}`}
w="w-16"
h="h-16"
size={48}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
path={'mdiSchool' in icon ? icon['mdiSchool' as keyof typeof icon] : icon.mdiTable || icon.mdiTable}
/>
</div>
</div>
</div>
</Link>}
{hasPermission(currentUser, 'READ_LESSON_PROGRESS') && <Link href={'/lesson_progress/lesson_progress-list'}>
<div
className={`${corners !== 'rounded-full'? corners : 'rounded-3xl'} dark:bg-dark-900 ${cardsStyle} dark:border-dark-700 p-6`}
>
<div className="flex justify-between align-center">
<div>
<div className="text-lg leading-tight text-gray-500 dark:text-gray-400">
Lesson progress
</div>
<div className="text-3xl leading-tight font-semibold">
{lesson_progress}
</div>
</div>
<div>
<BaseIcon
className={`${iconsColor}`}
w="w-16"
h="h-16"
size={48}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
path={'mdiProgressCheck' in icon ? icon['mdiProgressCheck' as keyof typeof icon] : icon.mdiTable || icon.mdiTable}
/>
</div>
</div>
</div>
</Link>}
{hasPermission(currentUser, 'READ_COURSE_ANNOUNCEMENTS') && <Link href={'/course_announcements/course_announcements-list'}>
<div
className={`${corners !== 'rounded-full'? corners : 'rounded-3xl'} dark:bg-dark-900 ${cardsStyle} dark:border-dark-700 p-6`}
>
<div className="flex justify-between align-center">
<div>
<div className="text-lg leading-tight text-gray-500 dark:text-gray-400">
Course announcements
</div>
<div className="text-3xl leading-tight font-semibold">
{course_announcements}
</div>
</div>
<div>
<BaseIcon
className={`${iconsColor}`}
w="w-16"
h="h-16"
size={48}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
path={'mdiBullhorn' in icon ? icon['mdiBullhorn' as keyof typeof icon] : icon.mdiTable || icon.mdiTable}
/>
</div>
</div>
</div>
</Link>}
{hasPermission(currentUser, 'READ_COURSE_REVIEWS') && <Link href={'/course_reviews/course_reviews-list'}>
<div
className={`${corners !== 'rounded-full'? corners : 'rounded-3xl'} dark:bg-dark-900 ${cardsStyle} dark:border-dark-700 p-6`}
>
<div className="flex justify-between align-center">
<div>
<div className="text-lg leading-tight text-gray-500 dark:text-gray-400">
Course reviews
</div>
<div className="text-3xl leading-tight font-semibold">
{course_reviews}
</div>
</div>
<div>
<BaseIcon
className={`${iconsColor}`}
w="w-16"
h="h-16"
size={48}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
path={'mdiStarCircle' in icon ? icon['mdiStarCircle' as keyof typeof icon] : icon.mdiTable || icon.mdiTable}
/>
</div>
</div>
</div>
</Link>}
</div>
</SectionMain>
</>
)
} }
Dashboard.getLayout = function getLayout(page: ReactElement) { Dashboard.getLayout = function getLayout(page: ReactElement) {

View File

@ -1,127 +1,166 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import type { ReactElement } from 'react'; import type { ReactElement } from 'react';
import Head from 'next/head'; import Head from 'next/head';
import Link from 'next/link'; import Link from 'next/link';
import BaseButton from '../components/BaseButton'; import BaseButton from '../components/BaseButton';
import CardBox from '../components/CardBox';
import SectionFullScreen from '../components/SectionFullScreen'; import SectionFullScreen from '../components/SectionFullScreen';
import LayoutGuest from '../layouts/Guest'; import LayoutGuest from '../layouts/Guest';
import BaseDivider from '../components/BaseDivider';
import BaseButtons from '../components/BaseButtons';
import { getPageTitle } from '../config'; import { getPageTitle } from '../config';
import { useAppSelector } from '../stores/hooks'; import { useAppSelector } from '../stores/hooks';
import { mdiSchool, mdiBookOpenVariant, mdiAccountGroup, mdiCheckDecagram } from '@mdi/js'; import CardBoxComponentTitle from "../components/CardBoxComponentTitle";
import BaseIcon from '../components/BaseIcon'; import { getPexelsImage, getPexelsVideo } from '../helpers/pexels';
export default function LandingPage() {
export default function Starter() {
const [illustrationImage, setIllustrationImage] = useState({
src: undefined,
photographer: undefined,
photographer_url: undefined,
})
const [illustrationVideo, setIllustrationVideo] = useState({video_files: []})
const [contentType, setContentType] = useState('video');
const [contentPosition, setContentPosition] = useState('left');
const textColor = useAppSelector((state) => state.style.linkColor); const textColor = useAppSelector((state) => state.style.linkColor);
const title = 'Course LMS' const title = 'Course LMS'
// Fetch Pexels image/video
useEffect(() => {
async function fetchData() {
const image = await getPexelsImage();
const video = await getPexelsVideo();
setIllustrationImage(image);
setIllustrationVideo(video);
}
fetchData();
}, []);
const imageBlock = (image) => (
<div
className='hidden md:flex flex-col justify-end relative flex-grow-0 flex-shrink-0 w-1/3'
style={{
backgroundImage: `${
image
? `url(${image?.src?.original})`
: 'linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5))'
}`,
backgroundSize: 'cover',
backgroundPosition: 'left center',
backgroundRepeat: 'no-repeat',
}}
>
<div className='flex justify-center w-full bg-blue-300/20'>
<a
className='text-[8px]'
href={image?.photographer_url}
target='_blank'
rel='noreferrer'
>
Photo by {image?.photographer} on Pexels
</a>
</div>
</div>
);
const videoBlock = (video) => {
if (video?.video_files?.length > 0) {
return (
<div className='hidden md:flex flex-col justify-end relative flex-grow-0 flex-shrink-0 w-1/3'>
<video
className='absolute top-0 left-0 w-full h-full object-cover'
autoPlay
loop
muted
>
<source src={video?.video_files[0]?.link} type='video/mp4'/>
Your browser does not support the video tag.
</video>
<div className='flex justify-center w-full bg-blue-300/20 z-10'>
<a
className='text-[8px]'
href={video?.user?.url}
target='_blank'
rel='noreferrer'
>
Video by {video.user.name} on Pexels
</a>
</div>
</div>)
}
};
return ( return (
<div className="bg-white dark:bg-dark-900"> <div
style={
contentPosition === 'background'
? {
backgroundImage: `${
illustrationImage
? `url(${illustrationImage.src?.original})`
: 'linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5))'
}`,
backgroundSize: 'cover',
backgroundPosition: 'left center',
backgroundRepeat: 'no-repeat',
}
: {}
}
>
<Head> <Head>
<title>{getPageTitle('Welcome to Course LMS')}</title> <title>{getPageTitle('Starter Page')}</title>
</Head> </Head>
{/* Hero Section */} <SectionFullScreen bg='violet'>
<section className="relative overflow-hidden bg-indigo-900 py-24 sm:py-32"> <div
<div className="mx-auto max-w-7xl px-6 lg:px-8 relative z-10"> className={`flex ${
<div className="mx-auto max-w-2xl lg:mx-0 lg:max-w-xl"> contentPosition === 'right' ? 'flex-row-reverse' : 'flex-row'
<h1 className="text-4xl font-bold tracking-tight text-white sm:text-6xl"> } min-h-screen w-full`}
Master New Skills with Our Expert-Led Courses >
</h1> {contentType === 'image' && contentPosition !== 'background'
<p className="mt-6 text-lg leading-8 text-indigo-100"> ? imageBlock(illustrationImage)
Access high-quality education from anywhere in the world. Start your journey today with our comprehensive library of lessons. : null}
</p> {contentType === 'video' && contentPosition !== 'background'
<div className="mt-10 flex items-center gap-x-6"> ? videoBlock(illustrationVideo)
<Link href="/login"> : null}
<span className="rounded-md bg-indigo-500 px-6 py-3 text-lg font-semibold text-white shadow-sm hover:bg-indigo-400 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-400 cursor-pointer"> <div className='flex items-center justify-center flex-col space-y-4 w-full lg:w-full'>
Get Started <CardBox className='w-full md:w-3/5 lg:w-2/3'>
</span> <CardBoxComponentTitle title="Welcome to your Course LMS app!"/>
</Link>
<Link href="/login" className="text-sm font-semibold leading-6 text-white cursor-pointer"> <div className="space-y-3">
Browse Courses <span aria-hidden="true"></span> <p className='text-center text-gray-500'>This is a React.js/Node.js app generated by the <a className={`${textColor}`} href="https://flatlogic.com/generator">Flatlogic Web App Generator</a></p>
</Link> <p className='text-center text-gray-500'>For guides and documentation please check
your local README.md and the <a className={`${textColor}`} href="https://flatlogic.com/documentation">Flatlogic documentation</a></p>
</div> </div>
</div>
</div>
{/* Background Decorative Elements */}
<div className="absolute inset-y-0 right-0 hidden lg:block w-1/2 opacity-20 translate-x-1/4">
<BaseIcon path={mdiSchool} size={600} className="text-white" />
</div>
</section>
{/* Features Section */} <BaseButtons>
<section className="py-24 bg-gray-50 dark:bg-dark-800"> <BaseButton
<div className="mx-auto max-w-7xl px-6 lg:px-8"> href='/login'
<div className="mx-auto max-w-2xl lg:text-center"> label='Login'
<h2 className="text-base font-semibold leading-7 text-indigo-600">Learn Faster</h2> color='info'
<p className="mt-2 text-3xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-4xl"> className='w-full'
Everything you need to succeed />
</p>
</div>
<div className="mx-auto mt-16 max-w-2xl sm:mt-20 lg:mt-24 lg:max-w-none">
<dl className="grid max-w-xl grid-cols-1 gap-x-8 gap-y-16 lg:max-w-none lg:grid-cols-4">
<div className="flex flex-col items-center text-center">
<div className="mb-6 flex h-10 w-10 items-center justify-center rounded-lg bg-indigo-600">
<BaseIcon path={mdiBookOpenVariant} size={24} className="text-white" />
</div>
<dt className="text-base font-semibold leading-7 text-gray-900 dark:text-white">Structured Lessons</dt>
<dd className="mt-1 flex flex-auto flex-col text-base leading-7 text-gray-600 dark:text-gray-400">
<p>Well-organized content that guides you step-by-step through complex topics.</p>
</dd>
</div>
<div className="flex flex-col items-center text-center">
<div className="mb-6 flex h-10 w-10 items-center justify-center rounded-lg bg-indigo-600">
<BaseIcon path={mdiAccountGroup} size={24} className="text-white" />
</div>
<dt className="text-base font-semibold leading-7 text-gray-900 dark:text-white">Expert Instructors</dt>
<dd className="mt-1 flex flex-auto flex-col text-base leading-7 text-gray-600 dark:text-gray-400">
<p>Learn from industry professionals with years of real-world experience.</p>
</dd>
</div>
<div className="flex flex-col items-center text-center">
<div className="mb-6 flex h-10 w-10 items-center justify-center rounded-lg bg-indigo-600">
<BaseIcon path={mdiCheckDecagram} size={24} className="text-white" />
</div>
<dt className="text-base font-semibold leading-7 text-gray-900 dark:text-white">Track Progress</dt>
<dd className="mt-1 flex flex-auto flex-col text-base leading-7 text-gray-600 dark:text-gray-400">
<p>Keep track of your learning milestones and completed lessons easily.</p>
</dd>
</div>
<div className="flex flex-col items-center text-center">
<div className="mb-6 flex h-10 w-10 items-center justify-center rounded-lg bg-indigo-600">
<BaseIcon path={mdiSchool} size={24} className="text-white" />
</div>
<dt className="text-base font-semibold leading-7 text-gray-900 dark:text-white">Certificates</dt>
<dd className="mt-1 flex flex-auto flex-col text-base leading-7 text-gray-600 dark:text-gray-400">
<p>Earn recognition for your hard work upon course completion.</p>
</dd>
</div>
</dl>
</div>
</div>
</section>
{/* Footer */} </BaseButtons>
<footer className="bg-white dark:bg-dark-900 border-t border-gray-200 dark:border-dark-800"> </CardBox>
<div className="mx-auto max-w-7xl px-6 py-12 md:flex md:items-center md:justify-between lg:px-8">
<div className="flex justify-center space-x-6 md:order-2">
<Link href="/privacy-policy" className="text-gray-400 hover:text-gray-500">
Privacy Policy
</Link>
<Link href="/terms-of-use" className="text-gray-400 hover:text-gray-500">
Terms of Use
</Link>
</div>
<div className="mt-8 md:order-1 md:mt-0">
<p className="text-center text-xs leading-5 text-gray-500">
&copy; 2026 {title}. All rights reserved. Built with Flatlogic.
</p>
</div>
</div> </div>
</footer> </div>
</SectionFullScreen>
<div className='bg-black text-white flex flex-col text-center justify-center md:flex-row'>
<p className='py-6 text-sm'>© 2026 <span>{title}</span>. All rights reserved</p>
<Link className='py-6 ml-4 text-sm' href='/privacy-policy/'>
Privacy Policy
</Link>
</div>
</div> </div>
); );
} }
LandingPage.getLayout = function getLayout(page: ReactElement) { Starter.getLayout = function getLayout(page: ReactElement) {
return <LayoutGuest>{page}</LayoutGuest>; return <LayoutGuest>{page}</LayoutGuest>;
}; };