From a733ce6bc82fa5f0284467913d60ff64522d92a3 Mon Sep 17 00:00:00 2001 From: Sanika Joshi Date: Thu, 17 Apr 2025 23:40:28 +0530 Subject: [PATCH 01/12] Create README.md --- Team116-EduQuest/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Team116-EduQuest/README.md diff --git a/Team116-EduQuest/README.md b/Team116-EduQuest/README.md new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Team116-EduQuest/README.md @@ -0,0 +1 @@ + From ec7a98db0658b45c4ef83edc60b5d36f589fe337 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Apr 2025 23:48:46 +0530 Subject: [PATCH 02/12] Initial commit --- .gitattributes | 2 + .gitignore | 33 ++ .mvn/wrapper/maven-wrapper.properties | 19 + mvnw | 259 ++++++++++++++ mvnw.cmd | 149 ++++++++ pom.xml | 58 ++++ .../example/demo/CourseMatchApplication.java | 12 + .../demo/Courseservice/CourseService.java.txt | 0 .../demo/controller/CourseController.java | 105 ++++++ .../controller/PathFinderApplication.java | 13 + .../demo/controller/UserController.java | 21 ++ .../com/example/demo/model/CourseInfo.java | 100 ++++++ .../java/com/example/demo/model/User.java | 23 ++ .../example/demo/service/CourseSearcher.java | 290 ++++++++++++++++ .../example/demo/service/CourseService.java | 129 +++++++ src/main/resources/application.properties | 1 + .../static/admin/manage-courses.html | 324 ++++++++++++++++++ .../resources/static/admin_dashboard.html | 68 ++++ src/main/resources/static/css/style.css | 209 +++++++++++ src/main/resources/static/js/app.js | 92 +++++ src/main/resources/static/js/script.js | 105 ++++++ src/main/resources/static/login.html | 97 ++++++ .../resources/static/student_dashboard.html | 209 +++++++++++ src/main/resources/templates/index.html | 65 ++++ .../demo/PathFinderApplicationTests.java | 13 + 25 files changed, 2396 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .mvn/wrapper/maven-wrapper.properties create mode 100644 mvnw create mode 100644 mvnw.cmd create mode 100644 pom.xml create mode 100644 src/main/java/com/example/demo/CourseMatchApplication.java create mode 100644 src/main/java/com/example/demo/Courseservice/CourseService.java.txt create mode 100644 src/main/java/com/example/demo/controller/CourseController.java create mode 100644 src/main/java/com/example/demo/controller/PathFinderApplication.java create mode 100644 src/main/java/com/example/demo/controller/UserController.java create mode 100644 src/main/java/com/example/demo/model/CourseInfo.java create mode 100644 src/main/java/com/example/demo/model/User.java create mode 100644 src/main/java/com/example/demo/service/CourseSearcher.java create mode 100644 src/main/java/com/example/demo/service/CourseService.java create mode 100644 src/main/resources/application.properties create mode 100644 src/main/resources/static/admin/manage-courses.html create mode 100644 src/main/resources/static/admin_dashboard.html create mode 100644 src/main/resources/static/css/style.css create mode 100644 src/main/resources/static/js/app.js create mode 100644 src/main/resources/static/js/script.js create mode 100644 src/main/resources/static/login.html create mode 100644 src/main/resources/static/student_dashboard.html create mode 100644 src/main/resources/templates/index.html create mode 100644 src/test/java/com/example/demo/PathFinderApplicationTests.java diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..3b41682a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +/mvnw text eol=lf +*.cmd text eol=crlf diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..549e00a2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 00000000..d58dfb70 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +wrapperVersion=3.3.2 +distributionType=only-script +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip diff --git a/mvnw b/mvnw new file mode 100644 index 00000000..19529ddf --- /dev/null +++ b/mvnw @@ -0,0 +1,259 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.2 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 00000000..249bdf38 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,149 @@ +<# : batch portion +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.2 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +if ($env:MAVEN_USER_HOME) { + $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" +} +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..013f83f1 --- /dev/null +++ b/pom.xml @@ -0,0 +1,58 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.4.4 + + + com.pathfinders + PathFinder + 0.0.1-SNAPSHOT + PathFinder + Demo project for Spring Boot + + + + + + + + + + + + + + + 17 + + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/src/main/java/com/example/demo/CourseMatchApplication.java b/src/main/java/com/example/demo/CourseMatchApplication.java new file mode 100644 index 00000000..9d9f1e1c --- /dev/null +++ b/src/main/java/com/example/demo/CourseMatchApplication.java @@ -0,0 +1,12 @@ +package com.example.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication // This annotation marks the main entry point of the Spring Boot application +public class CourseMatchApplication { + + public static void main(String[] args) { + SpringApplication.run(CourseMatchApplication.class, args); // This starts the Spring Boot application + } +} diff --git a/src/main/java/com/example/demo/Courseservice/CourseService.java.txt b/src/main/java/com/example/demo/Courseservice/CourseService.java.txt new file mode 100644 index 00000000..e69de29b diff --git a/src/main/java/com/example/demo/controller/CourseController.java b/src/main/java/com/example/demo/controller/CourseController.java new file mode 100644 index 00000000..7010905c --- /dev/null +++ b/src/main/java/com/example/demo/controller/CourseController.java @@ -0,0 +1,105 @@ +package com.example.demo.controller; + +import com.example.demo.service.CourseSearcher; +import com.example.demo.model.CourseInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.example.demo.service.CourseService; + +import java.util.List; + +@RestController +@RequestMapping("/api/courses") + + +public class CourseController { + @Autowired + private CourseService courseService; + + @Autowired + private CourseSearcher courseSearcher; + + + + // Endpoint to get all courses + @GetMapping("/all") + public List getAllCourses() { + return courseSearcher.getAllCourses(); + } + + // Endpoint to search courses by name using Trie + + + // Endpoint to get ranked courses by rating (Ranking) + @GetMapping("/ranked") + public List getRankedCourses() { + return courseSearcher.getRankedCourses(); + } + + // Endpoint to get sorted courses by duration (Sorting) + @GetMapping("/sorted") + public List getSortedCoursesByDuration() { + return courseSearcher.getSortedCoursesByDuration(); + } + + // Endpoint to get courses that have prerequisites + @GetMapping("/prerequisites") + public List getCoursesWithPrerequisites() { + return courseSearcher.getCoursesWithPrerequisites(); + } + + // Endpoint to add prerequisites for a course + @PostMapping("/prerequisite") + public String addPrerequisite(@RequestParam String courseId, @RequestParam String prerequisiteId) { + courseSearcher.addPrerequisite(courseId, prerequisiteId); + return "Prerequisite added!"; + } + + // Admin Endpoint to add a new course + @PostMapping("/add") + public String addCourse(@RequestBody CourseInfo course) { + boolean success = courseSearcher.addCourse(course); + if(success) { + return "Course added successfully!"; + } else { + return "Error adding course!"; + } + } + + // Admin Endpoint to update an existing course + @PutMapping("/update/{courseId}") + public String updateCourse(@PathVariable String courseId, @RequestBody CourseInfo course) { + boolean success = courseSearcher.updateCourse(courseId, course); + if(success) { + return "Course updated successfully!"; + } else { + return "Error updating course!"; + } + } + + // Admin Endpoint to delete a course + @DeleteMapping("/delete/{courseId}") + public String deleteCourse(@PathVariable String courseId) { + boolean success = courseSearcher.deleteCourse(courseId); + if(success) { + return "Course deleted successfully!"; + } else { + return "Error deleting course!"; + } + } + + // Endpoint to get courses sorted by duration + @GetMapping("/sortedByDuration") + public List getCoursegetSortedCoursesByDuration() { + return courseSearcher.getSortedCoursesByDuration(); + } + + @GetMapping("/search") + public List search( + @RequestParam(required = false) String title, + @RequestParam(required = false) String minRating, + @RequestParam(required = false) String maxRating + ) { + return courseService.searchAndFilterCourses(title, minRating, maxRating); + } +} diff --git a/src/main/java/com/example/demo/controller/PathFinderApplication.java b/src/main/java/com/example/demo/controller/PathFinderApplication.java new file mode 100644 index 00000000..ae760468 --- /dev/null +++ b/src/main/java/com/example/demo/controller/PathFinderApplication.java @@ -0,0 +1,13 @@ +package com.example.demo.controller; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class PathFinderApplication { + + public static void main(String[] args) { + SpringApplication.run(PathFinderApplication.class, args); + } + +} diff --git a/src/main/java/com/example/demo/controller/UserController.java b/src/main/java/com/example/demo/controller/UserController.java new file mode 100644 index 00000000..74353b93 --- /dev/null +++ b/src/main/java/com/example/demo/controller/UserController.java @@ -0,0 +1,21 @@ +package com.example.demo.controller; + +import com.example.demo.model.User; // Import the User model +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/api/auth") +public class UserController { + + @PostMapping("/login") + public String login(@RequestBody User user) { + // Hardcoded credentials for student and admin (to be replaced with a database later) + if (user.getId().equals("student") && user.getPassword().equals("student123")) { + return "student"; // For student + } else if (user.getId().equals("admin") && user.getPassword().equals("admin123")) { + return "admin"; // For admin + } else { + return "invalid"; // Invalid login credentials + } + } +} diff --git a/src/main/java/com/example/demo/model/CourseInfo.java b/src/main/java/com/example/demo/model/CourseInfo.java new file mode 100644 index 00000000..0d01a067 --- /dev/null +++ b/src/main/java/com/example/demo/model/CourseInfo.java @@ -0,0 +1,100 @@ +package com.example.demo.model; +public class CourseInfo { + private String courseId; + private String courseName; + private String duration; + private String validity; + private String costStatus; // This might be the 'price' in your front-end + private String level; + private boolean certification; + private double rating; + private String review; // This might be the 'description' in your front-end + + // Constructor + public CourseInfo(String courseId, String courseName, String duration, String validity, + String costStatus, String level, boolean certification, double rating, String review) { + this.courseId = courseId; + this.courseName = courseName; + this.duration = duration; + this.validity = validity; + this.costStatus = costStatus; + this.level = level; + this.certification = certification; + this.rating = rating; + this.review = review; + } + + // Getters and Setters + public String getCourseId() { + return courseId; + } + + public void setCourseId(String courseId) { + this.courseId = courseId; + } + + public String getCourseName() { + return courseName; + } + + public void setCourseName(String courseName) { + this.courseName = courseName; + } + + public String getDuration() { + return duration; + } + + public void setDuration(String duration) { + this.duration = duration; + } + + public String getValidity() { + return validity; + } + + public void setValidity(String validity) { + this.validity = validity; + } + + public String getCostStatus() { + return costStatus; + } + + public void setCostStatus(String costStatus) { + this.costStatus = costStatus; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public boolean isCertification() { + return certification; + } + + public void setCertification(boolean certification) { + this.certification = certification; + } + + public double getRating() { + return rating; + } + + public void setRating(double rating) { + this.rating = rating; + } + + public String getReview() { + return review; + } + + public void setReview(String review) { + this.review = review; + } + +} diff --git a/src/main/java/com/example/demo/model/User.java b/src/main/java/com/example/demo/model/User.java new file mode 100644 index 00000000..07beae07 --- /dev/null +++ b/src/main/java/com/example/demo/model/User.java @@ -0,0 +1,23 @@ +package com.example.demo.model; + +public class User { + private String id; + private String password; + + // Getters and setters + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/src/main/java/com/example/demo/service/CourseSearcher.java b/src/main/java/com/example/demo/service/CourseSearcher.java new file mode 100644 index 00000000..2de26309 --- /dev/null +++ b/src/main/java/com/example/demo/service/CourseSearcher.java @@ -0,0 +1,290 @@ +package com.example.demo.service; + +import com.example.demo.model.CourseInfo; +import java.util.*; +import java.util.stream.Collectors; +import org.springframework.stereotype.Service; + +// Trie Data Structure +class TrieNode { + TrieNode[] children = new TrieNode[26]; // for each letter a-z + boolean isEndOfWord; + List courseInfos = new ArrayList<>(); // Store courses at this node +} + +@Service +public class CourseSearcher { + private static Trie courseTrie = new Trie(); + private static Map> prerequisitesMap = new HashMap<>(); + + private static List courseList = List.of( + new CourseInfo("C101", "Java for Beginners", "6 weeks", "1 year", "Free", "Basic", true, 4.5, "Great for newbies!"), + new CourseInfo("C102", "Advanced DSA", "8 weeks", "1 year", "Paid (Rs. 999)", "Advanced", true, 4.7, "Challenging but worth it"), + new CourseInfo("C103", "Web Dev Bootcamp", "10 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Best full-stack course"), + new CourseInfo("C104", "UI/UX Design Fundamentals", "4 weeks", "6 months", "Free", "Basic", true, 4.6, "Good start for designers"), + new CourseInfo("C105", "Python for Data Science", "7 weeks", "1 year", "Paid (Rs. 799)", "Intermediate", true, 4.7, "Very informative and practical"), + new CourseInfo("C106", "Machine Learning A-Z", "12 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Hands-on and in-depth"), + new CourseInfo("C107", "DBMS Essentials", "5 weeks", "1 year", "Free", "Intermediate", true, 4.4, "Clear explanations with examples"), + new CourseInfo("C108", "Operating Systems", "6 weeks", "6 months", "Free", "Advanced", true, 4.3, "Great for CS students"), + new CourseInfo("C109", "Cybersecurity Basics", "4 weeks", "1 year", "Free", "Basic", false, 4.2, "Short and secure!"), + new CourseInfo("C110", "React Frontend Mastery", "9 weeks", "Lifetime", "Paid (Rs. 1299)", "Advanced", true, 4.8, "Modern UI development explained well"), + new CourseInfo("C111", "Agile & Scrum Training", "3 weeks", "3 months", "Free", "Intermediate", true, 4.5, "Very helpful for team leads"), + new CourseInfo("C112", "Cloud Computing with AWS", "6 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.6, "Well structured and real-world use cases"), + new CourseInfo("C113", "AI for Everyone", "5 weeks", "6 months", "Free", "Basic", true, 4.5, "Perfect for non-tech learners curious about AI"), + new CourseInfo("C114", "Kotlin for Android Development", "8 weeks", "1 year", "Paid (Rs. 1099)", "Intermediate", true, 4.6, "Covers all Android fundamentals"), + new CourseInfo("C115", "DevOps Masterclass", "10 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.8, "Great for CI/CD & deployment"), + new CourseInfo("C116", "Soft Skills & Communication", "3 weeks", "3 months", "Free", "Basic", false, 4.3, "Helpful for interviews and teamwork"), + new CourseInfo("C117", "Blockchain Basics", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.4, "Clear and conceptual course"), + new CourseInfo("C118", "Intro to Git & GitHub", "2 weeks", "1 year", "Free", "Basic", true, 4.6, "Essential for developers"), + new CourseInfo("C119", "Data Visualization with Tableau", "5 weeks", "6 months", "Paid (Rs. 899)", "Intermediate", true, 4.5, "Clean dashboards and use cases"), + new CourseInfo("C120", "Natural Language Processing", "8 weeks", "1 year", "Paid (Rs. 1499)", "Advanced", true, 4.7, "Very hands-on with real NLP tasks"), + new CourseInfo("C121", "Intro to Game Development", "6 weeks", "6 months", "Paid (Rs. 999)", "Basic", false, 4.2, "Fun and creative starting point"), + new CourseInfo("C122", "Excel & Google Sheets Mastery", "4 weeks", "1 year", "Free", "Basic", true, 4.4, "Very practical and work-friendly"), + new CourseInfo("C123", "Core Java Essentials", "5 weeks", "6 months", "Free", "Basic", true, 4.4, "Concise and beginner-friendly"), + new CourseInfo("C124", "Learn Java with Projects", "7 weeks", "1 year", "Paid (Rs. 799)", "Basic", true, 4.6, "Good hands-on experience"), + new CourseInfo("C125", "Mastering DSA in Java", "10 weeks", "Lifetime", "Paid (Rs. 1199)", "Advanced", true, 4.9, "Best for interviews"), + new CourseInfo("C126", "Competitive Programming Bootcamp", "9 weeks", "1 year", "Free", "Advanced", false, 4.3, "Great for contests"), + new CourseInfo("C127", "Full-Stack Web Development", "12 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Covers frontend + backend thoroughly"), + new CourseInfo("C128", "Responsive Web Design", "6 weeks", "1 year", "Free", "Intermediate", true, 4.5, "Excellent for UI/UX lovers"), + new CourseInfo("C129", "AI Foundations", "4 weeks", "6 months", "Free", "Basic", true, 4.4, "Simple explanations and case studies"), + new CourseInfo("C130", "Beginner’s Guide to Machine Learning", "6 weeks", "1 year", "Paid (Rs. 999)", "Basic", true, 4.6, "Visual approach to ML"), + new CourseInfo("C131", "CI/CD Pipeline with Jenkins", "8 weeks", "1 year", "Paid (Rs. 1399)", "Advanced", true, 4.7, "Practical DevOps guide"), + new CourseInfo("C132", "Docker & Kubernetes Bootcamp", "10 weeks", "Lifetime", "Paid (Rs. 1699)", "Advanced", true, 4.9, "Excellent for real-world DevOps"), + new CourseInfo("C133", "Git Essentials", "2 weeks", "6 months", "Free", "Basic", false, 4.3, "Short and effective"), + new CourseInfo("C134", "Version Control using Git", "3 weeks", "1 year", "Paid (Rs. 499)", "Basic", true, 4.5, "Perfect for beginners"), + new CourseInfo("C135", "Applied NLP with Python", "8 weeks", "1 year", "Paid (Rs. 1499)", "Advanced", true, 4.7, "Real-world use cases"), + new CourseInfo("C136", "NLP for Beginners", "5 weeks", "6 months", "Free", "Intermediate", true, 4.4, "Clear introduction to NLP techniques"), + new CourseInfo("C137", "Business Communication Skills", "4 weeks", "3 months", "Free", "Basic", true, 4.2, "Good for workplace etiquette"), + new CourseInfo("C138", "Public Speaking Mastery", "6 weeks", "1 year", "Paid (Rs. 599)", "Intermediate", true, 4.6, "Builds confidence and clarity"), + new CourseInfo("C139", "Java OOP Mastery", "6 weeks", "1 year", "Paid (Rs. 899)", "Intermediate", true, 4.6, "Solid OOP concepts in Java"), + new CourseInfo("C140", "Java Multithreading & Concurrency", "5 weeks", "6 months", "Free", "Advanced", false, 4.4, "In-depth and hands-on"), + new CourseInfo("C141", "DSA Crash Course", "4 weeks", "3 months", "Free", "Intermediate", false, 4.3, "Quick revision for interviews"), + new CourseInfo("C142", "DSA with C++", "8 weeks", "1 year", "Paid (Rs. 1199)", "Advanced", true, 4.7, "Perfect for competitive programmers"), + new CourseInfo("C143", "React for Beginners", "6 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Simple UI building blocks"), + new CourseInfo("C144", "Backend with Node.js", "7 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Practical REST API creation"), + new CourseInfo("C145", "Deep Learning with TensorFlow", "9 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.9, "In-depth neural networks training"), + new CourseInfo("C146", "Intro to Web Scraping with Python", "5 weeks", "6 months", "Free", "Basic", false, 4.4, "Scrape real-time data!"), + new CourseInfo("C147", "Python for Automation", "6 weeks", "Lifetime", "Free", "Intermediate", true, 4.5, "Automate your daily tasks"), + new CourseInfo("C148", "Data Science with R", "8 weeks", "1 year", "Paid (Rs. 1199)", "Intermediate", true, 4.7, "Great for stats & analysis"), + new CourseInfo("C149", "Swift for iOS Development", "7 weeks", "6 months", "Paid (Rs. 1099)", "Intermediate", true, 4.8, "Create amazing iOS apps"), + new CourseInfo("C150", "Introduction to Data Science", "10 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Good starter for aspiring data scientists"), + new CourseInfo("C151", "C++ for Beginners", "5 weeks", "6 months", "Free", "Basic", true, 4.5, "Master basic C++ concepts"), + new CourseInfo("C152", "Advanced SQL Queries", "6 weeks", "1 year", "Paid (Rs. 999)", "Advanced", true, 4.7, "Master complex queries"), + new CourseInfo("C153", "Web App Security", "6 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.8, "Focus on security best practices"), + new CourseInfo("C154", "Intro to Swift Programming", "5 weeks", "1 year", "Paid (Rs. 799)", "Intermediate", true, 4.6, "Great for iOS development"), + new CourseInfo("C155", "SQL for Data Science", "8 weeks", "1 year", "Free", "Basic", true, 4.5, "Strong foundation in SQL"), + new CourseInfo("C156", "Digital Marketing Fundamentals", "5 weeks", "Lifetime", "Paid (Rs. 1299)", "Basic", false, 4.4, "Introduction to digital strategies"), + new CourseInfo("C157", "SEO for Beginners", "4 weeks", "1 year", "Free", "Basic", true, 4.5, "Optimize your website for Google"), + new CourseInfo("C158", "Introduction to Docker", "5 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Perfect for containerizing apps"), + new CourseInfo("C159", "Introduction to Cloud Computing", "7 weeks", "1 year", "Paid (Rs. 999)", "Basic", true, 4.7, "Understand cloud fundamentals"), + new CourseInfo("C160", "Networking Basics", "6 weeks", "1 year", "Free", "Basic", true, 4.4, "Learn about network protocols"), + new CourseInfo("C161", "JavaScript: The Definitive Guide", "8 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.9, "Master the JavaScript language"), + new CourseInfo("C162", "React Native Basics", "7 weeks", "6 months", "Free", "Intermediate", true, 4.6, "Mobile app development with React Native"), + new CourseInfo("C163", "Advanced CSS Techniques", "6 weeks", "1 year", "Paid (Rs. 999)", "Advanced", true, 4.7, "CSS mastery for modern websites"), + new CourseInfo("C164", "Advanced Data Science with Python", "9 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.8, "Work on complex data problems"), + new CourseInfo("C165", "Intro to Mobile Game Development", "8 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.5, "Start building games for mobile"), + new CourseInfo("C166", "GraphQL Masterclass", "5 weeks", "Lifetime", "Paid (Rs. 999)", "Advanced", true, 4.6, "Master the modern query language"), + new CourseInfo("C167", "Building APIs with Flask", "6 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Flask for building REST APIs"), + new CourseInfo("C168", "Python for Cybersecurity", "8 weeks", "1 year", "Paid (Rs. 1599)", "Intermediate", true, 4.9, "Learn cybersecurity with Python"), + new CourseInfo("C169", "Android App Development", "10 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Build Android apps from scratch"), + new CourseInfo("C170", "Intro to Augmented Reality", "6 weeks", "Lifetime", "Paid (Rs. 1799)", "Intermediate", true, 4.6, "Get hands-on with AR development"),new CourseInfo("C170", "Intro to Augmented Reality", "6 weeks", "Lifetime", "Paid (Rs. 1799)", "Intermediate", true, 4.6, "Get hands-on with AR development"), + new CourseInfo("C171", "Introduction to Quantum Computing", "7 weeks", "1 year", "Free", "Advanced", true, 4.8, "Cutting-edge technology for future computing"), + new CourseInfo("C172", "Building Chatbots with Python", "8 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Create your own conversational agents"), + new CourseInfo("C173", "Intro to Data Structures with Python", "6 weeks", "1 year", "Free", "Basic", true, 4.5, "Understanding basic data structures"), + new CourseInfo("C174", "Intro to Deep Learning with Python", "7 weeks", "Lifetime", "Paid (Rs. 1699)", "Intermediate", true, 4.8, "Deep dive into neural networks"), + new CourseInfo("C175", "UI/UX Design with Figma", "8 weeks", "1 year", "Paid (Rs. 999)", "Intermediate", true, 4.6, "Create beautiful UI/UX designs"), + new CourseInfo("C176", "Responsive Web Design with CSS Grid", "6 weeks", "Lifetime", "Free", "Intermediate", true, 4.7, "Master responsive layouts with Grid"), + new CourseInfo("C177", "R for Data Science", "8 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.8, "A hands-on approach to data science with R"), + new CourseInfo("C178", "iOS Development with Swift", "10 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Build iOS apps from scratch using Swift"), + new CourseInfo("C179", "Blockchain for Developers", "7 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Learn to build blockchain applications"), + new CourseInfo("C180", "React Native with Expo", "6 weeks", "Lifetime", "Paid (Rs. 1199)", "Intermediate", true, 4.6, "Cross-platform app development with React Native"), + new CourseInfo("C181", "Advanced CSS Layouts", "5 weeks", "6 months", "Paid (Rs. 999)", "Advanced", true, 4.8, "Master layouts using Flexbox and Grid"), + new CourseInfo("C182", "Intro to Functional Programming in JavaScript", "6 weeks", "1 year", "Free", "Intermediate", true, 4.5, "Get started with functional programming"), + new CourseInfo("C183", "Digital Illustration with Adobe Illustrator", "8 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn how to create vector art and illustrations"), + new CourseInfo("C184", "Intro to Python for Data Science", "7 weeks", "1 year", "Free", "Basic", true, 4.6, "Start your journey with Python in Data Science"), + new CourseInfo("C185", "Automated Testing with Selenium", "6 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Learn to automate web app testing with Selenium"), + new CourseInfo("C186", "Advanced Git Techniques", "5 weeks", "6 months", "Free", "Advanced", true, 4.7, "Master Git for version control"), + new CourseInfo("C187", "Intro to Software Engineering", "9 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.6, "Learn software development best practices"), + new CourseInfo("C188", "Advanced Python Programming", "8 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Become a Python expert with advanced concepts"), + new CourseInfo("C189", "Intro to Ethical Hacking", "7 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.7, "Learn ethical hacking and cybersecurity practices"), + new CourseInfo("C190", "TensorFlow for Deep Learning", "9 weeks", "1 year", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Deep dive into TensorFlow for deep learning models"), + new CourseInfo("C191", "Intro to Game Design", "5 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Understand the basics of game mechanics and design"), + new CourseInfo("C192", "Web Performance Optimization", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Speed up your websites for better performance"), + new CourseInfo("C193", "Graph Databases with Neo4j", "7 weeks", "Lifetime", "Paid (Rs. 1399)", "Advanced", true, 4.8, "Learn graph databases with Neo4j"), + new CourseInfo("C194", "Angular Advanced Techniques", "9 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.9, "Master Angular with advanced features"), + new CourseInfo("C195", "Data Science with SQL", "6 weeks", "1 year", "Paid (Rs. 999)", "Intermediate", true, 4.7, "Combine SQL with data science techniques"), + new CourseInfo("C196", "Creating APIs with Django", "8 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Learn API development with Django framework"), + new CourseInfo("C197", "Python for Web Development", "7 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Build dynamic web apps using Python"), + new CourseInfo("C198", "Cloud Engineering with Google Cloud", "10 weeks", "1 year", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Learn how to build and manage cloud applications"), + new CourseInfo("C199", "Machine Learning with Scikit-Learn", "8 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Learn machine learning techniques using Scikit-learn"), + new CourseInfo("C200", "Building Scalable Web Applications", "9 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Learn to scale and optimize your web apps"), + new CourseInfo("C201", "Complete Digital Marketing", "12 weeks", "Lifetime", "Paid (Rs. 1499)", "Basic", false, 4.7, "Covering all aspects of digital marketing strategies"), + new CourseInfo("C202", "Advanced SQL for Data Analysis", "7 weeks", "1 year", "Paid (Rs. 1299)", "Advanced", true, 4.8, "Deep dive into SQL for data analysis"), + new CourseInfo("C203", "Intro to Cloud-Native Development", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.6, "Develop cloud-native apps using modern frameworks"), + new CourseInfo("C204", "Intro to Kubernetes", "5 weeks", "Lifetime", "Free", "Intermediate", true, 4.7, "Learn container orchestration with Kubernetes"), + new CourseInfo("C205", "AI-Powered Data Analytics", "10 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Learn AI and analytics for advanced business insights"), + new CourseInfo("C206", "Vue.js Essentials", "6 weeks", "1 year", "Paid (Rs. 1199)", "Intermediate", true, 4.7, "A complete guide to mastering Vue.js framework"), + new CourseInfo("C207", "Creating Web Applications with Flask", "7 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Build scalable web apps with Flask"), + new CourseInfo("C208", "Advanced JavaScript ES6+", "6 weeks", "1 year", "Paid (Rs. 1299)", "Advanced", true, 4.9, "Master the latest features of JavaScript"), + new CourseInfo("C209", "Data Engineering with Python", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Learn how to manage and process large data sets"), + new CourseInfo("C210", "DevOps Automation with Ansible", "9 weeks", "1 year", "Paid (Rs. 1799)", "Advanced", true, 4.7, "Automate your infrastructure management with Ansible"), + new CourseInfo("C211", "Design Thinking for Developers", "6 weeks", "Lifetime", "Free", "Intermediate", true, 4.7, "Learn how to approach problem-solving like a designer"), + new CourseInfo("C212", "Deep Learning with Keras", "8 weeks", "1 year", "Paid (Rs. 1699)", "Advanced", true, 4.9, "Create neural networks with Keras and TensorFlow"), + new CourseInfo("C213", "Introduction to 3D Modeling", "7 weeks", "Lifetime", "Paid (Rs. 1399)", "Basic", true, 4.5, "Learn the basics of 3D design and modeling"), + new CourseInfo("C214", "Augmented Reality with Unity", "10 weeks", "1 year", "Paid (Rs. 1999)", "Intermediate", true, 4.8, "Create AR experiences using Unity"), + new CourseInfo("C215", "Docker for Developers", "6 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn to containerize your applications with Docker"), + new CourseInfo("C216", "Natural Language Processing with Python", "8 weeks", "1 year", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Work on real-world NLP problems using Python"), + new CourseInfo("C217", "Advanced React Concepts", "6 weeks", "Lifetime", "Paid (Rs. 1399)", "Advanced", true, 4.9, "Level up your React skills with advanced concepts"), + new CourseInfo("C218", "Python for Data Visualization", "5 weeks", "Lifetime", "Free", "Intermediate", true, 4.6, "Visualize data using libraries like Matplotlib"), + new CourseInfo("C219", "Introduction to Financial Modeling", "7 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Learn financial modeling techniques for business"), + new CourseInfo("C220", "Advanced Ethical Hacking", "8 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.8, "Dive deep into penetration testing and security"), + new CourseInfo("C221", "Intro to Mobile Web Development", "6 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Develop mobile-friendly websites with modern techniques"), + new CourseInfo("C222", "Building Scalable Databases with MongoDB", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Learn how to design and scale MongoDB databases"), + new CourseInfo("C223", "AWS Certified Solutions Architect", "10 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Prepare for AWS Solutions Architect certification"), + new CourseInfo("C224", "API Development with Node.js", "7 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn how to build APIs using Node.js and Express"), + new CourseInfo("C225", "Creating Cross-Platform Apps with Flutter", "8 weeks", "Lifetime", "Paid (Rs. 1699)", "Intermediate", true, 4.8, "Develop native cross-platform apps with Flutter"), + new CourseInfo("C226", "Mastering Python for Machine Learning", "9 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Deep dive into Python for advanced machine learning"), + new CourseInfo("C227", "Deep Learning with PyTorch", "8 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Work on real-world deep learning projects using PyTorch"), + new CourseInfo("C228", "Understanding Big Data", "6 weeks", "Lifetime", "Paid (Rs. 999)", "Intermediate", true, 4.7, "Learn how to handle and process big data systems"), + new CourseInfo("C229", "UX/UI Research and Testing", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.6, "Conduct research and usability testing for UI/UX"), + new CourseInfo("C230", "Advanced Node.js", "7 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.9, "Master Node.js and build scalable applications"), + new CourseInfo("C231", "Building Mobile Apps with Kotlin", "9 weeks", "Lifetime", "Paid (Rs. 1799)", "Intermediate", true, 4.8, "Learn Android development with Kotlin"), + new CourseInfo("C232", "Intro to WebAssembly", "6 weeks", "1 year", "Paid (Rs. 1199)", "Intermediate", true, 4.7, "Explore high-performance applications with WebAssembly"), + new CourseInfo("C233", "Intro to Digital Art Creation", "5 weeks", "Lifetime", "Paid (Rs. 999)", "Basic", true, 4.6, "Start creating digital art and illustrations"), + new CourseInfo("C234", "Developing with Angular", "8 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Learn Angular for modern web applications"), + new CourseInfo("C235", "Intro to Data Visualization with D3.js", "7 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Master data visualization techniques with D3.js"), + new CourseInfo("C236", "Introduction to Scala for Data Science", "6 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Leverage Scala for data science applications"), + new CourseInfo("C237", "Getting Started with SwiftUI", "8 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn modern iOS development with SwiftUI"), + new CourseInfo("C238", "AI in Healthcare", "9 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Explore AI applications in the healthcare industry"), + new CourseInfo("C239", "Intro to Arduino Programming", "6 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Learn how to create hardware projects with Arduino"), + new CourseInfo("C240", "Automation with Python Scripts", "7 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.8, "Automate tasks and processes with Python scripting"), + new CourseInfo("C241", "Security for Web Developers", "6 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Understand security concepts for web applications"), + new CourseInfo("C242", "Deep Learning for NLP", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.9, "Build deep learning models for NLP tasks"), + new CourseInfo("C243", "React Redux for State Management", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.8, "Master state management with Redux in React"), + new CourseInfo("C244", "Mastering GitHub for Developers", "5 weeks", "Lifetime", "Free", "Basic", true, 4.7, "Learn version control and collaboration with GitHub"), + new CourseInfo("C245", "Introduction to Web Design with HTML & CSS", "5 weeks", "Lifetime", "Free", "Basic", true, 4.5, "Learn the fundamentals of web design with HTML & CSS"), + new CourseInfo("C246", "Serverless Architecture with AWS Lambda", "8 weeks", "Lifetime", "Paid (Rs. 1499)", "Advanced", true, 4.8, "Build scalable serverless applications with AWS Lambda"), + new CourseInfo("C247", "Mastering API Security", "9 weeks", "1 year", "Paid (Rs. 1699)", "Advanced", true, 4.9, "Learn to secure your APIs with modern techniques"), + new CourseInfo("C248", "Building Real-time Applications with Node.js", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Learn to build real-time apps using Node.js"), + new CourseInfo("C249", "Business Intelligence with Power BI", "7 weeks", "1 year", "Paid (Rs. 1399)", "Intermediate", true, 4.7, "Leverage Power BI for creating business intelligence solutions"), + new CourseInfo("C250", "Deep Learning for Computer Vision", "10 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Create advanced computer vision models with deep learning") + ); + + static { + // Insert all courses into the Trie for efficient search + for (CourseInfo course : courseList) { + courseTrie.insert(course.getCourseName(), course); + } + } + + // Get all courses + public List getAllCourses() { + return courseList; + } + + // Search courses by name using Trie + public List searchCourses(String courseName) { + return courseTrie.search(courseName); + } + + // Get courses ranked by rating (Ranking) + public List getRankedCourses() { + return courseList.stream() + .sorted(Comparator.comparingDouble(CourseInfo::getRating).reversed()) + .collect(Collectors.toList()); + } + + // Get courses sorted by duration (Sorting) + public List getSortedCoursesByDuration() { + return courseList.stream() + .sorted(Comparator.comparingInt(course -> Integer.parseInt(course.getDuration().split(" ")[0]))) // Sorting by numeric value of duration + .collect(Collectors.toList()); + } + + + // Get courses with prerequisites + public List getCoursesWithPrerequisites() { + List coursesWithPrerequisites = new ArrayList<>(); + for (CourseInfo course : courseList) { + if (prerequisitesMap.containsKey(course.getCourseId())) { + coursesWithPrerequisites.add(course); + } + } + return coursesWithPrerequisites; + } + + // Add prerequisites to a course + public void addPrerequisite(String courseId, String prerequisiteId) { + prerequisitesMap.computeIfAbsent(courseId, k -> new ArrayList<>()).add(prerequisiteId); + } + + // Add a course + public boolean addCourse(CourseInfo course) { + return courseList.add(course); + } + + // Update an existing course + public boolean updateCourse(String courseId, CourseInfo updatedCourse) { + for (int i = 0; i < courseList.size(); i++) { + CourseInfo course = courseList.get(i); + if (course.getCourseId().equals(courseId)) { + courseList.set(i, updatedCourse); + return true; + } + } + return false; + } + + // Delete a course + public boolean deleteCourse(String courseId) { + return courseList.removeIf(course -> course.getCourseId().equals(courseId)); + } + + // Trie class for efficient course search + static class Trie { + private TrieNode root; + + public Trie() { + root = new TrieNode(); + } + + public void insert(String courseName, CourseInfo courseInfo) { + TrieNode node = root; + for (char c : courseName.toLowerCase().toCharArray()) { + if (Character.isAlphabetic(c)) { // Only process alphabetic characters + int index = c - 'a'; // Calculate index for alphabetic characters + if (node.children[index] == null) { + node.children[index] = new TrieNode(); + } + node = node.children[index]; + } + } + node.isEndOfWord = true; + node.courseInfos.add(courseInfo); + } + + public List search(String prefix) { + TrieNode node = root; + for (char c : prefix.toLowerCase().toCharArray()) { + if (node.children[c - 'a'] == null) { + return new ArrayList<>(); // Return empty if no match + } + node = node.children[c - 'a']; + } + return collectCourses(node); + } + + private List collectCourses(TrieNode node) { + List courses = new ArrayList<>(); + if (node.isEndOfWord) { + courses.addAll(node.courseInfos); + } + for (TrieNode child : node.children) { + if (child != null) { + courses.addAll(collectCourses(child)); + } + } + return courses; + } + } +} diff --git a/src/main/java/com/example/demo/service/CourseService.java b/src/main/java/com/example/demo/service/CourseService.java new file mode 100644 index 00000000..cfee1807 --- /dev/null +++ b/src/main/java/com/example/demo/service/CourseService.java @@ -0,0 +1,129 @@ +package com.example.demo.service; + +import com.example.demo.model.CourseInfo; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class CourseService { + + // Fetch courses from the CourseSearcher class + + List allCourses = getAllCourses(); + // Method to search and filter courses + + // Method to search and filter courses + public List searchAndFilterCourses(String name, String minDuration, String maxDuration) { + List filteredCourses = new ArrayList<>(); + + // If the user provided no filters, return all courses + if ((minDuration == null || minDuration.isEmpty() || Integer.parseInt(minDuration) == 0) && + (maxDuration == null || maxDuration.isEmpty() || Integer.parseInt(maxDuration) == 0)) { + + // If no valid duration filters, just filter by name if given + return searchAndFilterCourses(name); + } + + // Filter based on name and duration if provided + for (CourseInfo course : allCourses) { + boolean matches = true; + + // Filter by course name if provided + if (name != null && !name.isEmpty() && !course.getCourseName().toLowerCase().contains(name.toLowerCase())) { + matches = false; + } + + // If minDuration is provided and valid, filter by duration + if (minDuration != null && !minDuration.isEmpty() && Integer.parseInt(minDuration) > 0) { + try { + int minDur = Integer.parseInt(minDuration); + if (Integer.parseInt(course.getDuration()) < minDur) { + matches = false; + } + } catch (NumberFormatException e) { + matches = false; + } + } + + // If maxDuration is provided and valid, filter by duration + if (maxDuration != null && !maxDuration.isEmpty() && Integer.parseInt(maxDuration) > 0) { + try { + int maxDur = Integer.parseInt(maxDuration); + if (Integer.parseInt(course.getDuration()) > maxDur) { + matches = false; + } + } catch (NumberFormatException e) { + matches = false; + } + } + + // If the course matches all filters, add it to the result + if (matches) { + filteredCourses.add(course); + } + } + + return filteredCourses; + } + + // Function to handle searching only by name (overloading) + public List searchAndFilterCourses(String name) { + List filteredCourses = new ArrayList<>(); + for (CourseInfo course : allCourses) { + if (name != null && !name.isEmpty() && course.getCourseName().toLowerCase().contains(name.toLowerCase())) { + filteredCourses.add(course); + } + } + return filteredCourses; + } + + + + private List courseList = new ArrayList<>(); + + // Fetch all courses + public List getAllCourses() { + return courseList; + } + + // Add a new course + public void addCourse(CourseInfo course) { + courseList.add(course); + } + + // Update an existing course + public void updateCourse(CourseInfo updatedCourse) { + for (CourseInfo course : courseList) { + if (course.getCourseId().equals(updatedCourse.getCourseId())) { + course.setCourseName(updatedCourse.getCourseName()); + course.setDuration(updatedCourse.getDuration()); + course.setCostStatus(updatedCourse.getCostStatus()); + course.setLevel(updatedCourse.getLevel()); + course.setRating(updatedCourse.getRating()); + course.setReview(updatedCourse.getReview()); + } + } + } + + // Delete a course by ID + public void deleteCourse(String courseId) { + courseList.removeIf(course -> course.getCourseId().equals(courseId)); + } + + // Rank courses by rating + public List getRankedCourses() { + return courseList.stream() + .sorted((course1, course2) -> Double.compare(course2.getRating(), course1.getRating())) // Sort by rating in descending order + .collect(Collectors.toList()); + } + + // Sort courses by duration + public List getCoursesSortedByDuration() { + return courseList.stream() + .sorted((course1, course2) -> Integer.compare(Integer.parseInt(course1.getDuration()), Integer.parseInt(course2.getDuration()))) + .collect(Collectors.toList()); + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 00000000..0fb8e821 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.application.name=PathFinder diff --git a/src/main/resources/static/admin/manage-courses.html b/src/main/resources/static/admin/manage-courses.html new file mode 100644 index 00000000..151de35e --- /dev/null +++ b/src/main/resources/static/admin/manage-courses.html @@ -0,0 +1,324 @@ + + + + + + Manage Courses - Admin Dashboard + + + + +
+ + + + +
+
+ +
+ +
+
+ +

Manage Courses

+ + + + + + + + + + + + + + + + + + +
Course NameDurationPriceRatingActions
+
+
+ + + + + + diff --git a/src/main/resources/static/admin_dashboard.html b/src/main/resources/static/admin_dashboard.html new file mode 100644 index 00000000..2a5f943d --- /dev/null +++ b/src/main/resources/static/admin_dashboard.html @@ -0,0 +1,68 @@ + + + + + + Admin Dashboard + + + +
+
+ +
+ +
+
+ + + +
+

Admin Overview

+
Admin-specific information will go here.
+
+
+ + + + + + diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css new file mode 100644 index 00000000..e55ef9a8 --- /dev/null +++ b/src/main/resources/static/css/style.css @@ -0,0 +1,209 @@ +/* Global Reset */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +/* Body styles */ +body { + font-family: 'Arial', sans-serif; + background-color: #f5f5f5; + color: #333; +} + +/* Main container */ +.dashboard-container { + display: flex; + min-height: 100vh; +} + +/* Header */ +.header { + width: 100%; + background-color: #4CAF50; + color: white; + padding: 20px; + display: flex; + justify-content: space-between; + align-items: center; +} + +.header-logo h1 { + margin-left: 20px; +} + +.header-nav button { + background-color: #45a049; + color: white; + border: none; + padding: 10px 20px; + border-radius: 5px; + cursor: pointer; + font-size: 16px; +} + +.header-nav button:hover { + background-color: #3e8e41; +} + +/* Sidebar */ +.sidebar { + width: 250px; + background-color: #2f4f4f; + color: white; + padding: 20px; + display: flex; + flex-direction: column; + justify-content: flex-start; + height: 100vh; +} + +.sidebar h3 { + margin-bottom: 20px; + font-size: 1.5rem; +} + +.sidebar button { + background-color: #4CAF50; + color: white; + border: none; + padding: 12px 20px; + margin: 10px 0; + border-radius: 5px; + font-size: 16px; + cursor: pointer; +} + +.sidebar button:hover { + background-color: #45a049; +} + +/* Course Section */ +.course-section { + flex: 1; + padding: 20px; + margin-left: 250px; + background-color: #fff; +} + +.course-section h2 { + font-size: 2rem; + color: #333; + margin-bottom: 20px; +} + +/* Course List */ +.course-list { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + gap: 20px; +} + +.course-card { + background-color: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); + transition: transform 0.3s ease; +} + +.course-card:hover { + transform: translateY(-10px); +} + +.course-card h4 { + font-size: 1.2rem; + color: #333; + margin-bottom: 10px; +} + +.course-card p { + font-size: 1rem; + color: #777; +} + +.course-card .rating { + color: #f39c12; + font-weight: bold; +} + +button { + background-color: #4CAF50; + color: white; + padding: 12px; + border: none; + border-radius: 5px; + cursor: pointer; + font-size: 16px; + margin-top: 20px; +} + +button:hover { + background-color: #45a049; +} + +/* Login Form */ +.login-container { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + background-color: #e0f7fa; +} + +.login-box { + background-color: white; + padding: 30px; + border-radius: 15px; + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); + width: 100%; + max-width: 400px; + text-align: center; +} + +.login-box h2 { + color: #4CAF50; +} + +.login-box input { + width: 100%; + padding: 14px; + margin: 10px 0; + border-radius: 5px; + border: 1px solid #ccc; + font-size: 16px; +} + +.login-box button { + width: 100%; + padding: 14px; + background-color: #4CAF50; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; +} + +.login-box button:hover { + background-color: #45a049; +} + +#error-msg { + color: red; + margin-top: 10px; +} + +/* Animations */ +@keyframes slideIn { + from { + transform: translateX(-100%); + } + to { + transform: translateX(0); + } +} + +.sidebar { + animation: slideIn 0.5s ease-out; +} diff --git a/src/main/resources/static/js/app.js b/src/main/resources/static/js/app.js new file mode 100644 index 00000000..29b23944 --- /dev/null +++ b/src/main/resources/static/js/app.js @@ -0,0 +1,92 @@ +let role = ''; // Track if the user is an 'admin' or 'student' + +document.addEventListener("DOMContentLoaded", function() { + setRole('student'); // Default to student view on page load +}); + +function setRole(selectedRole) { + role = selectedRole; + + if (role === 'student') { + // Show student view, hide admin view + document.getElementById('studentView').style.display = 'block'; + document.getElementById('adminView').style.display = 'none'; + loadCourses(); // Load courses for student view + } else if (role === 'admin') { + // Show admin view, hide student view + document.getElementById('studentView').style.display = 'none'; + document.getElementById('adminView').style.display = 'block'; + } +} + +function loadCourses() { + fetch('http://localhost:8081/api/courses/all') + .then(response => response.json()) + .then(courses => { + displayCourses(courses); + }) + .catch(error => console.error("Error loading courses:", error)); +} + +function displayCourses(courses) { + const courseList = document.getElementById('courseList'); + courseList.innerHTML = ''; // Clear previous list + + if (courses.length === 0) { + courseList.innerHTML = '

No courses available.

'; + return; + } + + courses.forEach(course => { + const courseCard = document.createElement('div'); + courseCard.classList.add('course-card'); + + courseCard.innerHTML = ` +

${course.courseName}

+

Duration: ${course.duration}

+

Validity: ${course.validity}

+

Cost: ${course.costStatus}

+

Level: ${course.level}

+

Rating: ${course.rating}

+

Review: ${course.review}

+ `; + + courseList.appendChild(courseCard); + }); +} + +function searchCourses() { + const query = document.getElementById('courseSearch').value; + + if (query.length < 3) { + loadCourses(); // If query is too short, load all courses + return; + } + + fetch(`http://localhost:8081/api/courses/search?courseName=${query}`) + .then(response => response.json()) + .then(courses => { + displayCourses(courses); + }) + .catch(error => console.error("Error searching courses:", error)); +} + +// Fetch ranked courses by rating +function getRankedCourses() { + fetch('http://localhost:8081/api/courses/ranked') + .then(response => response.json()) + .then(courses => { + displayCourses(courses); + }) + .catch(error => console.error("Error fetching ranked courses:", error)); +} + +// Fetch sorted courses by duration +function getSortedCourses() { + fetch('http://localhost:8081/api/courses/sorted') + .then(response => response.json()) + .then(courses => { + displayCourses(courses); + }) + .catch(error => console.error("Error fetching sorted courses:", error)); +} diff --git a/src/main/resources/static/js/script.js b/src/main/resources/static/js/script.js new file mode 100644 index 00000000..79ecbeee --- /dev/null +++ b/src/main/resources/static/js/script.js @@ -0,0 +1,105 @@ +function login() { + const userId = document.getElementById('userId').value; + const password = document.getElementById('password').value; + + const loginData = { + id: userId, + password: password + }; + + fetch('http://localhost:8080/api/auth/login', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(loginData) + }) + .then(response => response.text()) + .then(data => { + if (data === 'student') { + localStorage.setItem('userType', 'student'); + window.location.href = "student_dashboard.html"; + } else if (data === 'admin') { + localStorage.setItem('userType', 'admin'); + window.location.href = "admin_dashboard.html"; + } else { + document.getElementById('error-msg').textContent = 'Invalid credentials, please try again.'; + } + }) + .catch(error => console.error('Error:', error)); +} + +function logout() { + localStorage.removeItem('userType'); + window.location.href = 'login.html'; +} + +window.onload = function() { + const userType = localStorage.getItem('userType'); + if (userType !== 'student' && userType !== 'admin') { + window.location.href = 'login.html'; + return; + } + + fetch(`http://localhost:8080/api/auth/courses?userType=${userType}`) + .then(response => response.json()) + .then(courses => { + const courseList = document.getElementById('course-list'); + courses.forEach(course => { + const courseCard = document.createElement('div'); + courseCard.classList.add('course-card'); + courseCard.innerHTML = ` +

${course.courseName}

+

${course.description}

+

Rating: ${course.rating}

+

Duration: ${course.duration}

+

Price: ${course.price}

+ `; + courseList.appendChild(courseCard); + }); + }) + .catch(error => console.error('Error:', error)); +} +function fetchCourses() { + fetch('/api/courses/all') + .then(response => response.json()) + .then(data => displayCourses(data)); +} + +function searchCourses() { + const courseName = document.getElementById('searchName').value; + const minDuration = parseInt(document.getElementById('minDuration').value); + const maxDuration = parseInt(document.getElementById('maxDuration').value); + const sortByRating = document.getElementById('sortByRating').checked ? 'yes' : 'no'; + + fetch(`/api/courses/search?courseName=${courseName}&minDuration=${minDuration}&maxDuration=${maxDuration}&sortByRating=${sortByRating}`) + .then(response => response.json()) + .then(data => displayCourses(data)); +} + +function getRankedCourses() { + fetch('/api/courses/ranked') + .then(response => response.json()) + .then(data => displayCourses(data)); +} + +function getSortedCourses() { + fetch('/api/courses/sorted') + .then(response => response.json()) + .then(data => displayCourses(data)); +} + +function displayCourses(courses) { + const tableBody = document.getElementById('courseTableBody'); + tableBody.innerHTML = ''; + + courses.forEach(course => { + const row = ` + ${course.courseName} + ${course.instructor} + ${course.duration} + ${course.rating} + `; + tableBody.innerHTML += row; + }); +}; diff --git a/src/main/resources/static/login.html b/src/main/resources/static/login.html new file mode 100644 index 00000000..b87d99db --- /dev/null +++ b/src/main/resources/static/login.html @@ -0,0 +1,97 @@ + + + + + + Login - Course Finder + + + + + + + + + + diff --git a/src/main/resources/static/student_dashboard.html b/src/main/resources/static/student_dashboard.html new file mode 100644 index 00000000..20d143b8 --- /dev/null +++ b/src/main/resources/static/student_dashboard.html @@ -0,0 +1,209 @@ + + + + + + Course Dashboard + + + + + + + +
+ Student Course Dashboard +
+ +
+ + + + + + +
+ +
+ + + + + + diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html new file mode 100644 index 00000000..686a6caa --- /dev/null +++ b/src/main/resources/templates/index.html @@ -0,0 +1,65 @@ + + + + + + Welcome to Course Finder + + + + +
+

Welcome to Course Finder

+ + +
+ + + + + diff --git a/src/test/java/com/example/demo/PathFinderApplicationTests.java b/src/test/java/com/example/demo/PathFinderApplicationTests.java new file mode 100644 index 00000000..30a21184 --- /dev/null +++ b/src/test/java/com/example/demo/PathFinderApplicationTests.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class PathFinderApplicationTests { + + @Test + void contextLoads() { + } + +} From 4a6f3e45879e7c05a8a554ac47d0a05d60147eb6 Mon Sep 17 00:00:00 2001 From: nidhib08 Date: Thu, 17 Apr 2025 23:49:58 +0530 Subject: [PATCH 03/12] Update README.md --- Team116-EduQuest/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Team116-EduQuest/README.md b/Team116-EduQuest/README.md index 8b137891..0e1d4583 100644 --- a/Team116-EduQuest/README.md +++ b/Team116-EduQuest/README.md @@ -1 +1,10 @@ +Problem Statement: With the growing demand for continuous learning and skill development, individuals often turn to online courses(MOOKs platforms) to advance their knowledge. However, the sheer volume of available courses makes it difficult to identify the ones that truly align with a learner’s specific needs. Traditional course discovery methods are often generic and lack personalization, resulting in time-consuming searches and courses that may not match the user’s goals, prior experience, available time, or budget. +To address this challenge,we have derived a solution that simplifies the course selection process by providing personalized recommendations. By considering user inputs such as time commitment, financial constraints, current knowledge level, and learning objectives, the platform can help optimize the learning journey and enhance overall user satisfaction. + +Data structures & Algorithms used: +1. List : Stores all courses for filtering, searching, and sorting operations. +2. HashMap: Maps each courseId to its corresponding CourseInfo object. +3. Priority queue : Maintains a priority-based ordering of courses by rating (highest to lowest) +4. Regex (Pattern & Matcher) Algorithm: Keyword highlighting + From 966bf5be2d77e93559c521f54056df81435816cb Mon Sep 17 00:00:00 2001 From: Ishanvi-14 Date: Fri, 18 Apr 2025 00:23:43 +0530 Subject: [PATCH 04/12] Update README.md --- Team116-EduQuest/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Team116-EduQuest/README.md b/Team116-EduQuest/README.md index 0e1d4583..e78d9535 100644 --- a/Team116-EduQuest/README.md +++ b/Team116-EduQuest/README.md @@ -7,4 +7,4 @@ Data structures & Algorithms used: 3. Priority queue : Maintains a priority-based ordering of courses by rating (highest to lowest) 4. Regex (Pattern & Matcher) Algorithm: Keyword highlighting - +Video link:https://drive.google.com/file/d/1fncFvNRGg9BiybZTaVhQWsYIbZ9OWqzg/view?usp=sharing From 74dc71b1f0696d72bcdf7f4b2256bcb3a9a8e143 Mon Sep 17 00:00:00 2001 From: Ishanvi-14 Date: Fri, 18 Apr 2025 00:52:36 +0530 Subject: [PATCH 05/12] Add files via upload --- Team116-EduQuest/CourseController.java | 105 ++++++ Team116-EduQuest/CourseMatchApplication.java | 12 + Team116-EduQuest/CourseSearcher.java | 290 +++++++++++++++++ Team116-EduQuest/CourseService.java | 129 ++++++++ Team116-EduQuest/CourseService.java.txt | 0 Team116-EduQuest/UserController.java | 21 ++ Team116-EduQuest/admin_dashboard.html | 68 ++++ Team116-EduQuest/app.js | 92 ++++++ Team116-EduQuest/login.html | 97 ++++++ Team116-EduQuest/manage-courses.html | 324 +++++++++++++++++++ Team116-EduQuest/script.js | 105 ++++++ Team116-EduQuest/student_dashboard.html | 209 ++++++++++++ Team116-EduQuest/style.css | 209 ++++++++++++ 13 files changed, 1661 insertions(+) create mode 100644 Team116-EduQuest/CourseController.java create mode 100644 Team116-EduQuest/CourseMatchApplication.java create mode 100644 Team116-EduQuest/CourseSearcher.java create mode 100644 Team116-EduQuest/CourseService.java create mode 100644 Team116-EduQuest/CourseService.java.txt create mode 100644 Team116-EduQuest/UserController.java create mode 100644 Team116-EduQuest/admin_dashboard.html create mode 100644 Team116-EduQuest/app.js create mode 100644 Team116-EduQuest/login.html create mode 100644 Team116-EduQuest/manage-courses.html create mode 100644 Team116-EduQuest/script.js create mode 100644 Team116-EduQuest/student_dashboard.html create mode 100644 Team116-EduQuest/style.css diff --git a/Team116-EduQuest/CourseController.java b/Team116-EduQuest/CourseController.java new file mode 100644 index 00000000..222f241e --- /dev/null +++ b/Team116-EduQuest/CourseController.java @@ -0,0 +1,105 @@ +package com.example.demo.controller; + +import com.example.demo.service.CourseSearcher; +import com.example.demo.model.CourseInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.example.demo.service.CourseService; + +import java.util.List; + +@RestController +@RequestMapping("/api/courses") + + +public class CourseController { + @Autowired + private CourseService courseService; + + @Autowired + private CourseSearcher courseSearcher; + + + + // Endpoint to get all courses + @GetMapping("/all") + public List getAllCourses() { + return courseSearcher.getAllCourses(); + } + + // Endpoint to search courses by name using Trie + + + // Endpoint to get ranked courses by rating (Ranking) + @GetMapping("/ranked") + public List getRankedCourses() { + return courseSearcher.getRankedCourses(); + } + + // Endpoint to get sorted courses by duration (Sorting) + @GetMapping("/sorted") + public List getSortedCoursesByDuration() { + return courseSearcher.getSortedCoursesByDuration(); + } + + // Endpoint to get courses that have prerequisites + @GetMapping("/prerequisites") + public List getCoursesWithPrerequisites() { + return courseSearcher.getCoursesWithPrerequisites(); + } + + // Endpoint to add prerequisites for a course + @PostMapping("/prerequisite") + public String addPrerequisite(@RequestParam String courseId, @RequestParam String prerequisiteId) { + courseSearcher.addPrerequisite(courseId, prerequisiteId); + return "Prerequisite added!"; + } + + // Admin Endpoint to add a new course + @PostMapping("/add") + public String addCourse(@RequestBody CourseInfo course) { + boolean success = courseSearcher.addCourse(course); + if(success) { + return "Course added successfully!"; + } else { + return "Error adding course!"; + } + } + + // Admin Endpoint to update an existing course + @PutMapping("/update/{courseId}") + public String updateCourse(@PathVariable String courseId, @RequestBody CourseInfo course) { + boolean success = courseSearcher.updateCourse(courseId, course); + if(success) { + return "Course updated successfully!"; + } else { + return "Error updating course!"; + } + } + + // Admin Endpoint to delete a course + @DeleteMapping("/delete/{courseId}") + public String deleteCourse(@PathVariable String courseId) { + boolean success = courseSearcher.deleteCourse(courseId); + if(success) { + return "Course deleted successfully!"; + } else { + return "Error deleting course!"; + } + } + + // Endpoint to get courses sorted by duration + @GetMapping("/sortedByDuration") + public List getCoursegetSortedCoursesByDuration() { + return courseSearcher.getSortedCoursesByDuration(); + } + + @GetMapping("/search") + public List search( + @RequestParam(required = false) String title, + @RequestParam(required = false) String minRating, + @RequestParam(required = false) String maxRating + ) { + return courseService.searchAndFilterCourses(title, minRating, maxRating); + } +} diff --git a/Team116-EduQuest/CourseMatchApplication.java b/Team116-EduQuest/CourseMatchApplication.java new file mode 100644 index 00000000..2065258f --- /dev/null +++ b/Team116-EduQuest/CourseMatchApplication.java @@ -0,0 +1,12 @@ +package com.example.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication // This annotation marks the main entry point of the Spring Boot application +public class CourseMatchApplication { + + public static void main(String[] args) { + SpringApplication.run(CourseMatchApplication.class, args); // This starts the Spring Boot application + } +} diff --git a/Team116-EduQuest/CourseSearcher.java b/Team116-EduQuest/CourseSearcher.java new file mode 100644 index 00000000..2ac203eb --- /dev/null +++ b/Team116-EduQuest/CourseSearcher.java @@ -0,0 +1,290 @@ +package com.example.demo.service; + +import com.example.demo.model.CourseInfo; +import java.util.*; +import java.util.stream.Collectors; +import org.springframework.stereotype.Service; + +// Trie Data Structure +class TrieNode { + TrieNode[] children = new TrieNode[26]; // for each letter a-z + boolean isEndOfWord; + List courseInfos = new ArrayList<>(); // Store courses at this node +} + +@Service +public class CourseSearcher { + private static Trie courseTrie = new Trie(); + private static Map> prerequisitesMap = new HashMap<>(); + + private static List courseList = List.of( + new CourseInfo("C101", "Java for Beginners", "6 weeks", "1 year", "Free", "Basic", true, 4.5, "Great for newbies!"), + new CourseInfo("C102", "Advanced DSA", "8 weeks", "1 year", "Paid (Rs. 999)", "Advanced", true, 4.7, "Challenging but worth it"), + new CourseInfo("C103", "Web Dev Bootcamp", "10 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Best full-stack course"), + new CourseInfo("C104", "UI/UX Design Fundamentals", "4 weeks", "6 months", "Free", "Basic", true, 4.6, "Good start for designers"), + new CourseInfo("C105", "Python for Data Science", "7 weeks", "1 year", "Paid (Rs. 799)", "Intermediate", true, 4.7, "Very informative and practical"), + new CourseInfo("C106", "Machine Learning A-Z", "12 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Hands-on and in-depth"), + new CourseInfo("C107", "DBMS Essentials", "5 weeks", "1 year", "Free", "Intermediate", true, 4.4, "Clear explanations with examples"), + new CourseInfo("C108", "Operating Systems", "6 weeks", "6 months", "Free", "Advanced", true, 4.3, "Great for CS students"), + new CourseInfo("C109", "Cybersecurity Basics", "4 weeks", "1 year", "Free", "Basic", false, 4.2, "Short and secure!"), + new CourseInfo("C110", "React Frontend Mastery", "9 weeks", "Lifetime", "Paid (Rs. 1299)", "Advanced", true, 4.8, "Modern UI development explained well"), + new CourseInfo("C111", "Agile & Scrum Training", "3 weeks", "3 months", "Free", "Intermediate", true, 4.5, "Very helpful for team leads"), + new CourseInfo("C112", "Cloud Computing with AWS", "6 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.6, "Well structured and real-world use cases"), + new CourseInfo("C113", "AI for Everyone", "5 weeks", "6 months", "Free", "Basic", true, 4.5, "Perfect for non-tech learners curious about AI"), + new CourseInfo("C114", "Kotlin for Android Development", "8 weeks", "1 year", "Paid (Rs. 1099)", "Intermediate", true, 4.6, "Covers all Android fundamentals"), + new CourseInfo("C115", "DevOps Masterclass", "10 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.8, "Great for CI/CD & deployment"), + new CourseInfo("C116", "Soft Skills & Communication", "3 weeks", "3 months", "Free", "Basic", false, 4.3, "Helpful for interviews and teamwork"), + new CourseInfo("C117", "Blockchain Basics", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.4, "Clear and conceptual course"), + new CourseInfo("C118", "Intro to Git & GitHub", "2 weeks", "1 year", "Free", "Basic", true, 4.6, "Essential for developers"), + new CourseInfo("C119", "Data Visualization with Tableau", "5 weeks", "6 months", "Paid (Rs. 899)", "Intermediate", true, 4.5, "Clean dashboards and use cases"), + new CourseInfo("C120", "Natural Language Processing", "8 weeks", "1 year", "Paid (Rs. 1499)", "Advanced", true, 4.7, "Very hands-on with real NLP tasks"), + new CourseInfo("C121", "Intro to Game Development", "6 weeks", "6 months", "Paid (Rs. 999)", "Basic", false, 4.2, "Fun and creative starting point"), + new CourseInfo("C122", "Excel & Google Sheets Mastery", "4 weeks", "1 year", "Free", "Basic", true, 4.4, "Very practical and work-friendly"), + new CourseInfo("C123", "Core Java Essentials", "5 weeks", "6 months", "Free", "Basic", true, 4.4, "Concise and beginner-friendly"), + new CourseInfo("C124", "Learn Java with Projects", "7 weeks", "1 year", "Paid (Rs. 799)", "Basic", true, 4.6, "Good hands-on experience"), + new CourseInfo("C125", "Mastering DSA in Java", "10 weeks", "Lifetime", "Paid (Rs. 1199)", "Advanced", true, 4.9, "Best for interviews"), + new CourseInfo("C126", "Competitive Programming Bootcamp", "9 weeks", "1 year", "Free", "Advanced", false, 4.3, "Great for contests"), + new CourseInfo("C127", "Full-Stack Web Development", "12 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Covers frontend + backend thoroughly"), + new CourseInfo("C128", "Responsive Web Design", "6 weeks", "1 year", "Free", "Intermediate", true, 4.5, "Excellent for UI/UX lovers"), + new CourseInfo("C129", "AI Foundations", "4 weeks", "6 months", "Free", "Basic", true, 4.4, "Simple explanations and case studies"), + new CourseInfo("C130", "Beginner’s Guide to Machine Learning", "6 weeks", "1 year", "Paid (Rs. 999)", "Basic", true, 4.6, "Visual approach to ML"), + new CourseInfo("C131", "CI/CD Pipeline with Jenkins", "8 weeks", "1 year", "Paid (Rs. 1399)", "Advanced", true, 4.7, "Practical DevOps guide"), + new CourseInfo("C132", "Docker & Kubernetes Bootcamp", "10 weeks", "Lifetime", "Paid (Rs. 1699)", "Advanced", true, 4.9, "Excellent for real-world DevOps"), + new CourseInfo("C133", "Git Essentials", "2 weeks", "6 months", "Free", "Basic", false, 4.3, "Short and effective"), + new CourseInfo("C134", "Version Control using Git", "3 weeks", "1 year", "Paid (Rs. 499)", "Basic", true, 4.5, "Perfect for beginners"), + new CourseInfo("C135", "Applied NLP with Python", "8 weeks", "1 year", "Paid (Rs. 1499)", "Advanced", true, 4.7, "Real-world use cases"), + new CourseInfo("C136", "NLP for Beginners", "5 weeks", "6 months", "Free", "Intermediate", true, 4.4, "Clear introduction to NLP techniques"), + new CourseInfo("C137", "Business Communication Skills", "4 weeks", "3 months", "Free", "Basic", true, 4.2, "Good for workplace etiquette"), + new CourseInfo("C138", "Public Speaking Mastery", "6 weeks", "1 year", "Paid (Rs. 599)", "Intermediate", true, 4.6, "Builds confidence and clarity"), + new CourseInfo("C139", "Java OOP Mastery", "6 weeks", "1 year", "Paid (Rs. 899)", "Intermediate", true, 4.6, "Solid OOP concepts in Java"), + new CourseInfo("C140", "Java Multithreading & Concurrency", "5 weeks", "6 months", "Free", "Advanced", false, 4.4, "In-depth and hands-on"), + new CourseInfo("C141", "DSA Crash Course", "4 weeks", "3 months", "Free", "Intermediate", false, 4.3, "Quick revision for interviews"), + new CourseInfo("C142", "DSA with C++", "8 weeks", "1 year", "Paid (Rs. 1199)", "Advanced", true, 4.7, "Perfect for competitive programmers"), + new CourseInfo("C143", "React for Beginners", "6 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Simple UI building blocks"), + new CourseInfo("C144", "Backend with Node.js", "7 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Practical REST API creation"), + new CourseInfo("C145", "Deep Learning with TensorFlow", "9 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.9, "In-depth neural networks training"), + new CourseInfo("C146", "Intro to Web Scraping with Python", "5 weeks", "6 months", "Free", "Basic", false, 4.4, "Scrape real-time data!"), + new CourseInfo("C147", "Python for Automation", "6 weeks", "Lifetime", "Free", "Intermediate", true, 4.5, "Automate your daily tasks"), + new CourseInfo("C148", "Data Science with R", "8 weeks", "1 year", "Paid (Rs. 1199)", "Intermediate", true, 4.7, "Great for stats & analysis"), + new CourseInfo("C149", "Swift for iOS Development", "7 weeks", "6 months", "Paid (Rs. 1099)", "Intermediate", true, 4.8, "Create amazing iOS apps"), + new CourseInfo("C150", "Introduction to Data Science", "10 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Good starter for aspiring data scientists"), + new CourseInfo("C151", "C++ for Beginners", "5 weeks", "6 months", "Free", "Basic", true, 4.5, "Master basic C++ concepts"), + new CourseInfo("C152", "Advanced SQL Queries", "6 weeks", "1 year", "Paid (Rs. 999)", "Advanced", true, 4.7, "Master complex queries"), + new CourseInfo("C153", "Web App Security", "6 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.8, "Focus on security best practices"), + new CourseInfo("C154", "Intro to Swift Programming", "5 weeks", "1 year", "Paid (Rs. 799)", "Intermediate", true, 4.6, "Great for iOS development"), + new CourseInfo("C155", "SQL for Data Science", "8 weeks", "1 year", "Free", "Basic", true, 4.5, "Strong foundation in SQL"), + new CourseInfo("C156", "Digital Marketing Fundamentals", "5 weeks", "Lifetime", "Paid (Rs. 1299)", "Basic", false, 4.4, "Introduction to digital strategies"), + new CourseInfo("C157", "SEO for Beginners", "4 weeks", "1 year", "Free", "Basic", true, 4.5, "Optimize your website for Google"), + new CourseInfo("C158", "Introduction to Docker", "5 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Perfect for containerizing apps"), + new CourseInfo("C159", "Introduction to Cloud Computing", "7 weeks", "1 year", "Paid (Rs. 999)", "Basic", true, 4.7, "Understand cloud fundamentals"), + new CourseInfo("C160", "Networking Basics", "6 weeks", "1 year", "Free", "Basic", true, 4.4, "Learn about network protocols"), + new CourseInfo("C161", "JavaScript: The Definitive Guide", "8 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.9, "Master the JavaScript language"), + new CourseInfo("C162", "React Native Basics", "7 weeks", "6 months", "Free", "Intermediate", true, 4.6, "Mobile app development with React Native"), + new CourseInfo("C163", "Advanced CSS Techniques", "6 weeks", "1 year", "Paid (Rs. 999)", "Advanced", true, 4.7, "CSS mastery for modern websites"), + new CourseInfo("C164", "Advanced Data Science with Python", "9 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.8, "Work on complex data problems"), + new CourseInfo("C165", "Intro to Mobile Game Development", "8 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.5, "Start building games for mobile"), + new CourseInfo("C166", "GraphQL Masterclass", "5 weeks", "Lifetime", "Paid (Rs. 999)", "Advanced", true, 4.6, "Master the modern query language"), + new CourseInfo("C167", "Building APIs with Flask", "6 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Flask for building REST APIs"), + new CourseInfo("C168", "Python for Cybersecurity", "8 weeks", "1 year", "Paid (Rs. 1599)", "Intermediate", true, 4.9, "Learn cybersecurity with Python"), + new CourseInfo("C169", "Android App Development", "10 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Build Android apps from scratch"), + new CourseInfo("C170", "Intro to Augmented Reality", "6 weeks", "Lifetime", "Paid (Rs. 1799)", "Intermediate", true, 4.6, "Get hands-on with AR development"),new CourseInfo("C170", "Intro to Augmented Reality", "6 weeks", "Lifetime", "Paid (Rs. 1799)", "Intermediate", true, 4.6, "Get hands-on with AR development"), + new CourseInfo("C171", "Introduction to Quantum Computing", "7 weeks", "1 year", "Free", "Advanced", true, 4.8, "Cutting-edge technology for future computing"), + new CourseInfo("C172", "Building Chatbots with Python", "8 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Create your own conversational agents"), + new CourseInfo("C173", "Intro to Data Structures with Python", "6 weeks", "1 year", "Free", "Basic", true, 4.5, "Understanding basic data structures"), + new CourseInfo("C174", "Intro to Deep Learning with Python", "7 weeks", "Lifetime", "Paid (Rs. 1699)", "Intermediate", true, 4.8, "Deep dive into neural networks"), + new CourseInfo("C175", "UI/UX Design with Figma", "8 weeks", "1 year", "Paid (Rs. 999)", "Intermediate", true, 4.6, "Create beautiful UI/UX designs"), + new CourseInfo("C176", "Responsive Web Design with CSS Grid", "6 weeks", "Lifetime", "Free", "Intermediate", true, 4.7, "Master responsive layouts with Grid"), + new CourseInfo("C177", "R for Data Science", "8 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.8, "A hands-on approach to data science with R"), + new CourseInfo("C178", "iOS Development with Swift", "10 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Build iOS apps from scratch using Swift"), + new CourseInfo("C179", "Blockchain for Developers", "7 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Learn to build blockchain applications"), + new CourseInfo("C180", "React Native with Expo", "6 weeks", "Lifetime", "Paid (Rs. 1199)", "Intermediate", true, 4.6, "Cross-platform app development with React Native"), + new CourseInfo("C181", "Advanced CSS Layouts", "5 weeks", "6 months", "Paid (Rs. 999)", "Advanced", true, 4.8, "Master layouts using Flexbox and Grid"), + new CourseInfo("C182", "Intro to Functional Programming in JavaScript", "6 weeks", "1 year", "Free", "Intermediate", true, 4.5, "Get started with functional programming"), + new CourseInfo("C183", "Digital Illustration with Adobe Illustrator", "8 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn how to create vector art and illustrations"), + new CourseInfo("C184", "Intro to Python for Data Science", "7 weeks", "1 year", "Free", "Basic", true, 4.6, "Start your journey with Python in Data Science"), + new CourseInfo("C185", "Automated Testing with Selenium", "6 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Learn to automate web app testing with Selenium"), + new CourseInfo("C186", "Advanced Git Techniques", "5 weeks", "6 months", "Free", "Advanced", true, 4.7, "Master Git for version control"), + new CourseInfo("C187", "Intro to Software Engineering", "9 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.6, "Learn software development best practices"), + new CourseInfo("C188", "Advanced Python Programming", "8 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Become a Python expert with advanced concepts"), + new CourseInfo("C189", "Intro to Ethical Hacking", "7 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.7, "Learn ethical hacking and cybersecurity practices"), + new CourseInfo("C190", "TensorFlow for Deep Learning", "9 weeks", "1 year", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Deep dive into TensorFlow for deep learning models"), + new CourseInfo("C191", "Intro to Game Design", "5 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Understand the basics of game mechanics and design"), + new CourseInfo("C192", "Web Performance Optimization", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Speed up your websites for better performance"), + new CourseInfo("C193", "Graph Databases with Neo4j", "7 weeks", "Lifetime", "Paid (Rs. 1399)", "Advanced", true, 4.8, "Learn graph databases with Neo4j"), + new CourseInfo("C194", "Angular Advanced Techniques", "9 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.9, "Master Angular with advanced features"), + new CourseInfo("C195", "Data Science with SQL", "6 weeks", "1 year", "Paid (Rs. 999)", "Intermediate", true, 4.7, "Combine SQL with data science techniques"), + new CourseInfo("C196", "Creating APIs with Django", "8 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Learn API development with Django framework"), + new CourseInfo("C197", "Python for Web Development", "7 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Build dynamic web apps using Python"), + new CourseInfo("C198", "Cloud Engineering with Google Cloud", "10 weeks", "1 year", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Learn how to build and manage cloud applications"), + new CourseInfo("C199", "Machine Learning with Scikit-Learn", "8 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Learn machine learning techniques using Scikit-learn"), + new CourseInfo("C200", "Building Scalable Web Applications", "9 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Learn to scale and optimize your web apps"), + new CourseInfo("C201", "Complete Digital Marketing", "12 weeks", "Lifetime", "Paid (Rs. 1499)", "Basic", false, 4.7, "Covering all aspects of digital marketing strategies"), + new CourseInfo("C202", "Advanced SQL for Data Analysis", "7 weeks", "1 year", "Paid (Rs. 1299)", "Advanced", true, 4.8, "Deep dive into SQL for data analysis"), + new CourseInfo("C203", "Intro to Cloud-Native Development", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.6, "Develop cloud-native apps using modern frameworks"), + new CourseInfo("C204", "Intro to Kubernetes", "5 weeks", "Lifetime", "Free", "Intermediate", true, 4.7, "Learn container orchestration with Kubernetes"), + new CourseInfo("C205", "AI-Powered Data Analytics", "10 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Learn AI and analytics for advanced business insights"), + new CourseInfo("C206", "Vue.js Essentials", "6 weeks", "1 year", "Paid (Rs. 1199)", "Intermediate", true, 4.7, "A complete guide to mastering Vue.js framework"), + new CourseInfo("C207", "Creating Web Applications with Flask", "7 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Build scalable web apps with Flask"), + new CourseInfo("C208", "Advanced JavaScript ES6+", "6 weeks", "1 year", "Paid (Rs. 1299)", "Advanced", true, 4.9, "Master the latest features of JavaScript"), + new CourseInfo("C209", "Data Engineering with Python", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Learn how to manage and process large data sets"), + new CourseInfo("C210", "DevOps Automation with Ansible", "9 weeks", "1 year", "Paid (Rs. 1799)", "Advanced", true, 4.7, "Automate your infrastructure management with Ansible"), + new CourseInfo("C211", "Design Thinking for Developers", "6 weeks", "Lifetime", "Free", "Intermediate", true, 4.7, "Learn how to approach problem-solving like a designer"), + new CourseInfo("C212", "Deep Learning with Keras", "8 weeks", "1 year", "Paid (Rs. 1699)", "Advanced", true, 4.9, "Create neural networks with Keras and TensorFlow"), + new CourseInfo("C213", "Introduction to 3D Modeling", "7 weeks", "Lifetime", "Paid (Rs. 1399)", "Basic", true, 4.5, "Learn the basics of 3D design and modeling"), + new CourseInfo("C214", "Augmented Reality with Unity", "10 weeks", "1 year", "Paid (Rs. 1999)", "Intermediate", true, 4.8, "Create AR experiences using Unity"), + new CourseInfo("C215", "Docker for Developers", "6 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn to containerize your applications with Docker"), + new CourseInfo("C216", "Natural Language Processing with Python", "8 weeks", "1 year", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Work on real-world NLP problems using Python"), + new CourseInfo("C217", "Advanced React Concepts", "6 weeks", "Lifetime", "Paid (Rs. 1399)", "Advanced", true, 4.9, "Level up your React skills with advanced concepts"), + new CourseInfo("C218", "Python for Data Visualization", "5 weeks", "Lifetime", "Free", "Intermediate", true, 4.6, "Visualize data using libraries like Matplotlib"), + new CourseInfo("C219", "Introduction to Financial Modeling", "7 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Learn financial modeling techniques for business"), + new CourseInfo("C220", "Advanced Ethical Hacking", "8 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.8, "Dive deep into penetration testing and security"), + new CourseInfo("C221", "Intro to Mobile Web Development", "6 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Develop mobile-friendly websites with modern techniques"), + new CourseInfo("C222", "Building Scalable Databases with MongoDB", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Learn how to design and scale MongoDB databases"), + new CourseInfo("C223", "AWS Certified Solutions Architect", "10 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Prepare for AWS Solutions Architect certification"), + new CourseInfo("C224", "API Development with Node.js", "7 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn how to build APIs using Node.js and Express"), + new CourseInfo("C225", "Creating Cross-Platform Apps with Flutter", "8 weeks", "Lifetime", "Paid (Rs. 1699)", "Intermediate", true, 4.8, "Develop native cross-platform apps with Flutter"), + new CourseInfo("C226", "Mastering Python for Machine Learning", "9 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Deep dive into Python for advanced machine learning"), + new CourseInfo("C227", "Deep Learning with PyTorch", "8 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Work on real-world deep learning projects using PyTorch"), + new CourseInfo("C228", "Understanding Big Data", "6 weeks", "Lifetime", "Paid (Rs. 999)", "Intermediate", true, 4.7, "Learn how to handle and process big data systems"), + new CourseInfo("C229", "UX/UI Research and Testing", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.6, "Conduct research and usability testing for UI/UX"), + new CourseInfo("C230", "Advanced Node.js", "7 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.9, "Master Node.js and build scalable applications"), + new CourseInfo("C231", "Building Mobile Apps with Kotlin", "9 weeks", "Lifetime", "Paid (Rs. 1799)", "Intermediate", true, 4.8, "Learn Android development with Kotlin"), + new CourseInfo("C232", "Intro to WebAssembly", "6 weeks", "1 year", "Paid (Rs. 1199)", "Intermediate", true, 4.7, "Explore high-performance applications with WebAssembly"), + new CourseInfo("C233", "Intro to Digital Art Creation", "5 weeks", "Lifetime", "Paid (Rs. 999)", "Basic", true, 4.6, "Start creating digital art and illustrations"), + new CourseInfo("C234", "Developing with Angular", "8 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Learn Angular for modern web applications"), + new CourseInfo("C235", "Intro to Data Visualization with D3.js", "7 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Master data visualization techniques with D3.js"), + new CourseInfo("C236", "Introduction to Scala for Data Science", "6 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Leverage Scala for data science applications"), + new CourseInfo("C237", "Getting Started with SwiftUI", "8 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn modern iOS development with SwiftUI"), + new CourseInfo("C238", "AI in Healthcare", "9 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Explore AI applications in the healthcare industry"), + new CourseInfo("C239", "Intro to Arduino Programming", "6 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Learn how to create hardware projects with Arduino"), + new CourseInfo("C240", "Automation with Python Scripts", "7 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.8, "Automate tasks and processes with Python scripting"), + new CourseInfo("C241", "Security for Web Developers", "6 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Understand security concepts for web applications"), + new CourseInfo("C242", "Deep Learning for NLP", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.9, "Build deep learning models for NLP tasks"), + new CourseInfo("C243", "React Redux for State Management", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.8, "Master state management with Redux in React"), + new CourseInfo("C244", "Mastering GitHub for Developers", "5 weeks", "Lifetime", "Free", "Basic", true, 4.7, "Learn version control and collaboration with GitHub"), + new CourseInfo("C245", "Introduction to Web Design with HTML & CSS", "5 weeks", "Lifetime", "Free", "Basic", true, 4.5, "Learn the fundamentals of web design with HTML & CSS"), + new CourseInfo("C246", "Serverless Architecture with AWS Lambda", "8 weeks", "Lifetime", "Paid (Rs. 1499)", "Advanced", true, 4.8, "Build scalable serverless applications with AWS Lambda"), + new CourseInfo("C247", "Mastering API Security", "9 weeks", "1 year", "Paid (Rs. 1699)", "Advanced", true, 4.9, "Learn to secure your APIs with modern techniques"), + new CourseInfo("C248", "Building Real-time Applications with Node.js", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Learn to build real-time apps using Node.js"), + new CourseInfo("C249", "Business Intelligence with Power BI", "7 weeks", "1 year", "Paid (Rs. 1399)", "Intermediate", true, 4.7, "Leverage Power BI for creating business intelligence solutions"), + new CourseInfo("C250", "Deep Learning for Computer Vision", "10 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Create advanced computer vision models with deep learning") + ); + + static { + // Insert all courses into the Trie for efficient search + for (CourseInfo course : courseList) { + courseTrie.insert(course.getCourseName(), course); + } + } + + // Get all courses + public List getAllCourses() { + return courseList; + } + + // Search courses by name using Trie + public List searchCourses(String courseName) { + return courseTrie.search(courseName); + } + + // Get courses ranked by rating (Ranking) + public List getRankedCourses() { + return courseList.stream() + .sorted(Comparator.comparingDouble(CourseInfo::getRating).reversed()) + .collect(Collectors.toList()); + } + + // Get courses sorted by duration (Sorting) + public List getSortedCoursesByDuration() { + return courseList.stream() + .sorted(Comparator.comparingInt(course -> Integer.parseInt(course.getDuration().split(" ")[0]))) // Sorting by numeric value of duration + .collect(Collectors.toList()); + } + + + // Get courses with prerequisites + public List getCoursesWithPrerequisites() { + List coursesWithPrerequisites = new ArrayList<>(); + for (CourseInfo course : courseList) { + if (prerequisitesMap.containsKey(course.getCourseId())) { + coursesWithPrerequisites.add(course); + } + } + return coursesWithPrerequisites; + } + + // Add prerequisites to a course + public void addPrerequisite(String courseId, String prerequisiteId) { + prerequisitesMap.computeIfAbsent(courseId, k -> new ArrayList<>()).add(prerequisiteId); + } + + // Add a course + public boolean addCourse(CourseInfo course) { + return courseList.add(course); + } + + // Update an existing course + public boolean updateCourse(String courseId, CourseInfo updatedCourse) { + for (int i = 0; i < courseList.size(); i++) { + CourseInfo course = courseList.get(i); + if (course.getCourseId().equals(courseId)) { + courseList.set(i, updatedCourse); + return true; + } + } + return false; + } + + // Delete a course + public boolean deleteCourse(String courseId) { + return courseList.removeIf(course -> course.getCourseId().equals(courseId)); + } + + // Trie class for efficient course search + static class Trie { + private TrieNode root; + + public Trie() { + root = new TrieNode(); + } + + public void insert(String courseName, CourseInfo courseInfo) { + TrieNode node = root; + for (char c : courseName.toLowerCase().toCharArray()) { + if (Character.isAlphabetic(c)) { // Only process alphabetic characters + int index = c - 'a'; // Calculate index for alphabetic characters + if (node.children[index] == null) { + node.children[index] = new TrieNode(); + } + node = node.children[index]; + } + } + node.isEndOfWord = true; + node.courseInfos.add(courseInfo); + } + + public List search(String prefix) { + TrieNode node = root; + for (char c : prefix.toLowerCase().toCharArray()) { + if (node.children[c - 'a'] == null) { + return new ArrayList<>(); // Return empty if no match + } + node = node.children[c - 'a']; + } + return collectCourses(node); + } + + private List collectCourses(TrieNode node) { + List courses = new ArrayList<>(); + if (node.isEndOfWord) { + courses.addAll(node.courseInfos); + } + for (TrieNode child : node.children) { + if (child != null) { + courses.addAll(collectCourses(child)); + } + } + return courses; + } + } +} diff --git a/Team116-EduQuest/CourseService.java b/Team116-EduQuest/CourseService.java new file mode 100644 index 00000000..f9bb41fd --- /dev/null +++ b/Team116-EduQuest/CourseService.java @@ -0,0 +1,129 @@ +package com.example.demo.service; + +import com.example.demo.model.CourseInfo; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class CourseService { + + // Fetch courses from the CourseSearcher class + + List allCourses = getAllCourses(); + // Method to search and filter courses + + // Method to search and filter courses + public List searchAndFilterCourses(String name, String minDuration, String maxDuration) { + List filteredCourses = new ArrayList<>(); + + // If the user provided no filters, return all courses + if ((minDuration == null || minDuration.isEmpty() || Integer.parseInt(minDuration) == 0) && + (maxDuration == null || maxDuration.isEmpty() || Integer.parseInt(maxDuration) == 0)) { + + // If no valid duration filters, just filter by name if given + return searchAndFilterCourses(name); + } + + // Filter based on name and duration if provided + for (CourseInfo course : allCourses) { + boolean matches = true; + + // Filter by course name if provided + if (name != null && !name.isEmpty() && !course.getCourseName().toLowerCase().contains(name.toLowerCase())) { + matches = false; + } + + // If minDuration is provided and valid, filter by duration + if (minDuration != null && !minDuration.isEmpty() && Integer.parseInt(minDuration) > 0) { + try { + int minDur = Integer.parseInt(minDuration); + if (Integer.parseInt(course.getDuration()) < minDur) { + matches = false; + } + } catch (NumberFormatException e) { + matches = false; + } + } + + // If maxDuration is provided and valid, filter by duration + if (maxDuration != null && !maxDuration.isEmpty() && Integer.parseInt(maxDuration) > 0) { + try { + int maxDur = Integer.parseInt(maxDuration); + if (Integer.parseInt(course.getDuration()) > maxDur) { + matches = false; + } + } catch (NumberFormatException e) { + matches = false; + } + } + + // If the course matches all filters, add it to the result + if (matches) { + filteredCourses.add(course); + } + } + + return filteredCourses; + } + + // Function to handle searching only by name (overloading) + public List searchAndFilterCourses(String name) { + List filteredCourses = new ArrayList<>(); + for (CourseInfo course : allCourses) { + if (name != null && !name.isEmpty() && course.getCourseName().toLowerCase().contains(name.toLowerCase())) { + filteredCourses.add(course); + } + } + return filteredCourses; + } + + + + private List courseList = new ArrayList<>(); + + // Fetch all courses + public List getAllCourses() { + return courseList; + } + + // Add a new course + public void addCourse(CourseInfo course) { + courseList.add(course); + } + + // Update an existing course + public void updateCourse(CourseInfo updatedCourse) { + for (CourseInfo course : courseList) { + if (course.getCourseId().equals(updatedCourse.getCourseId())) { + course.setCourseName(updatedCourse.getCourseName()); + course.setDuration(updatedCourse.getDuration()); + course.setCostStatus(updatedCourse.getCostStatus()); + course.setLevel(updatedCourse.getLevel()); + course.setRating(updatedCourse.getRating()); + course.setReview(updatedCourse.getReview()); + } + } + } + + // Delete a course by ID + public void deleteCourse(String courseId) { + courseList.removeIf(course -> course.getCourseId().equals(courseId)); + } + + // Rank courses by rating + public List getRankedCourses() { + return courseList.stream() + .sorted((course1, course2) -> Double.compare(course2.getRating(), course1.getRating())) // Sort by rating in descending order + .collect(Collectors.toList()); + } + + // Sort courses by duration + public List getCoursesSortedByDuration() { + return courseList.stream() + .sorted((course1, course2) -> Integer.compare(Integer.parseInt(course1.getDuration()), Integer.parseInt(course2.getDuration()))) + .collect(Collectors.toList()); + } +} diff --git a/Team116-EduQuest/CourseService.java.txt b/Team116-EduQuest/CourseService.java.txt new file mode 100644 index 00000000..e69de29b diff --git a/Team116-EduQuest/UserController.java b/Team116-EduQuest/UserController.java new file mode 100644 index 00000000..20f01198 --- /dev/null +++ b/Team116-EduQuest/UserController.java @@ -0,0 +1,21 @@ +package com.example.demo.controller; + +import com.example.demo.model.User; // Import the User model +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/api/auth") +public class UserController { + + @PostMapping("/login") + public String login(@RequestBody User user) { + // Hardcoded credentials for student and admin (to be replaced with a database later) + if (user.getId().equals("student") && user.getPassword().equals("student123")) { + return "student"; // For student + } else if (user.getId().equals("admin") && user.getPassword().equals("admin123")) { + return "admin"; // For admin + } else { + return "invalid"; // Invalid login credentials + } + } +} diff --git a/Team116-EduQuest/admin_dashboard.html b/Team116-EduQuest/admin_dashboard.html new file mode 100644 index 00000000..45e44b15 --- /dev/null +++ b/Team116-EduQuest/admin_dashboard.html @@ -0,0 +1,68 @@ + + + + + + Admin Dashboard + + + +
+
+ +
+ +
+
+ + + +
+

Admin Overview

+
Admin-specific information will go here.
+
+
+ + + + + + diff --git a/Team116-EduQuest/app.js b/Team116-EduQuest/app.js new file mode 100644 index 00000000..8da153e4 --- /dev/null +++ b/Team116-EduQuest/app.js @@ -0,0 +1,92 @@ +let role = ''; // Track if the user is an 'admin' or 'student' + +document.addEventListener("DOMContentLoaded", function() { + setRole('student'); // Default to student view on page load +}); + +function setRole(selectedRole) { + role = selectedRole; + + if (role === 'student') { + // Show student view, hide admin view + document.getElementById('studentView').style.display = 'block'; + document.getElementById('adminView').style.display = 'none'; + loadCourses(); // Load courses for student view + } else if (role === 'admin') { + // Show admin view, hide student view + document.getElementById('studentView').style.display = 'none'; + document.getElementById('adminView').style.display = 'block'; + } +} + +function loadCourses() { + fetch('http://localhost:8081/api/courses/all') + .then(response => response.json()) + .then(courses => { + displayCourses(courses); + }) + .catch(error => console.error("Error loading courses:", error)); +} + +function displayCourses(courses) { + const courseList = document.getElementById('courseList'); + courseList.innerHTML = ''; // Clear previous list + + if (courses.length === 0) { + courseList.innerHTML = '

No courses available.

'; + return; + } + + courses.forEach(course => { + const courseCard = document.createElement('div'); + courseCard.classList.add('course-card'); + + courseCard.innerHTML = ` +

${course.courseName}

+

Duration: ${course.duration}

+

Validity: ${course.validity}

+

Cost: ${course.costStatus}

+

Level: ${course.level}

+

Rating: ${course.rating}

+

Review: ${course.review}

+ `; + + courseList.appendChild(courseCard); + }); +} + +function searchCourses() { + const query = document.getElementById('courseSearch').value; + + if (query.length < 3) { + loadCourses(); // If query is too short, load all courses + return; + } + + fetch(`http://localhost:8081/api/courses/search?courseName=${query}`) + .then(response => response.json()) + .then(courses => { + displayCourses(courses); + }) + .catch(error => console.error("Error searching courses:", error)); +} + +// Fetch ranked courses by rating +function getRankedCourses() { + fetch('http://localhost:8081/api/courses/ranked') + .then(response => response.json()) + .then(courses => { + displayCourses(courses); + }) + .catch(error => console.error("Error fetching ranked courses:", error)); +} + +// Fetch sorted courses by duration +function getSortedCourses() { + fetch('http://localhost:8081/api/courses/sorted') + .then(response => response.json()) + .then(courses => { + displayCourses(courses); + }) + .catch(error => console.error("Error fetching sorted courses:", error)); +} diff --git a/Team116-EduQuest/login.html b/Team116-EduQuest/login.html new file mode 100644 index 00000000..38a94792 --- /dev/null +++ b/Team116-EduQuest/login.html @@ -0,0 +1,97 @@ + + + + + + Login - Course Finder + + + + + + + + + + diff --git a/Team116-EduQuest/manage-courses.html b/Team116-EduQuest/manage-courses.html new file mode 100644 index 00000000..ceb1406f --- /dev/null +++ b/Team116-EduQuest/manage-courses.html @@ -0,0 +1,324 @@ + + + + + + Manage Courses - Admin Dashboard + + + + +
+ + + + +
+
+ +
+ +
+
+ +

Manage Courses

+ + + + + + + + + + + + + + + + + + +
Course NameDurationPriceRatingActions
+
+
+ + + + + + diff --git a/Team116-EduQuest/script.js b/Team116-EduQuest/script.js new file mode 100644 index 00000000..deec550c --- /dev/null +++ b/Team116-EduQuest/script.js @@ -0,0 +1,105 @@ +function login() { + const userId = document.getElementById('userId').value; + const password = document.getElementById('password').value; + + const loginData = { + id: userId, + password: password + }; + + fetch('http://localhost:8080/api/auth/login', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(loginData) + }) + .then(response => response.text()) + .then(data => { + if (data === 'student') { + localStorage.setItem('userType', 'student'); + window.location.href = "student_dashboard.html"; + } else if (data === 'admin') { + localStorage.setItem('userType', 'admin'); + window.location.href = "admin_dashboard.html"; + } else { + document.getElementById('error-msg').textContent = 'Invalid credentials, please try again.'; + } + }) + .catch(error => console.error('Error:', error)); +} + +function logout() { + localStorage.removeItem('userType'); + window.location.href = 'login.html'; +} + +window.onload = function() { + const userType = localStorage.getItem('userType'); + if (userType !== 'student' && userType !== 'admin') { + window.location.href = 'login.html'; + return; + } + + fetch(`http://localhost:8080/api/auth/courses?userType=${userType}`) + .then(response => response.json()) + .then(courses => { + const courseList = document.getElementById('course-list'); + courses.forEach(course => { + const courseCard = document.createElement('div'); + courseCard.classList.add('course-card'); + courseCard.innerHTML = ` +

${course.courseName}

+

${course.description}

+

Rating: ${course.rating}

+

Duration: ${course.duration}

+

Price: ${course.price}

+ `; + courseList.appendChild(courseCard); + }); + }) + .catch(error => console.error('Error:', error)); +} +function fetchCourses() { + fetch('/api/courses/all') + .then(response => response.json()) + .then(data => displayCourses(data)); +} + +function searchCourses() { + const courseName = document.getElementById('searchName').value; + const minDuration = parseInt(document.getElementById('minDuration').value); + const maxDuration = parseInt(document.getElementById('maxDuration').value); + const sortByRating = document.getElementById('sortByRating').checked ? 'yes' : 'no'; + + fetch(`/api/courses/search?courseName=${courseName}&minDuration=${minDuration}&maxDuration=${maxDuration}&sortByRating=${sortByRating}`) + .then(response => response.json()) + .then(data => displayCourses(data)); +} + +function getRankedCourses() { + fetch('/api/courses/ranked') + .then(response => response.json()) + .then(data => displayCourses(data)); +} + +function getSortedCourses() { + fetch('/api/courses/sorted') + .then(response => response.json()) + .then(data => displayCourses(data)); +} + +function displayCourses(courses) { + const tableBody = document.getElementById('courseTableBody'); + tableBody.innerHTML = ''; + + courses.forEach(course => { + const row = ` + ${course.courseName} + ${course.instructor} + ${course.duration} + ${course.rating} + `; + tableBody.innerHTML += row; + }); +}; diff --git a/Team116-EduQuest/student_dashboard.html b/Team116-EduQuest/student_dashboard.html new file mode 100644 index 00000000..f4222828 --- /dev/null +++ b/Team116-EduQuest/student_dashboard.html @@ -0,0 +1,209 @@ + + + + + + Course Dashboard + + + + + + + +
+ Student Course Dashboard +
+ +
+ + + + + + +
+ +
+ + + + + + diff --git a/Team116-EduQuest/style.css b/Team116-EduQuest/style.css new file mode 100644 index 00000000..f4d16e0c --- /dev/null +++ b/Team116-EduQuest/style.css @@ -0,0 +1,209 @@ +/* Global Reset */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +/* Body styles */ +body { + font-family: 'Arial', sans-serif; + background-color: #f5f5f5; + color: #333; +} + +/* Main container */ +.dashboard-container { + display: flex; + min-height: 100vh; +} + +/* Header */ +.header { + width: 100%; + background-color: #4CAF50; + color: white; + padding: 20px; + display: flex; + justify-content: space-between; + align-items: center; +} + +.header-logo h1 { + margin-left: 20px; +} + +.header-nav button { + background-color: #45a049; + color: white; + border: none; + padding: 10px 20px; + border-radius: 5px; + cursor: pointer; + font-size: 16px; +} + +.header-nav button:hover { + background-color: #3e8e41; +} + +/* Sidebar */ +.sidebar { + width: 250px; + background-color: #2f4f4f; + color: white; + padding: 20px; + display: flex; + flex-direction: column; + justify-content: flex-start; + height: 100vh; +} + +.sidebar h3 { + margin-bottom: 20px; + font-size: 1.5rem; +} + +.sidebar button { + background-color: #4CAF50; + color: white; + border: none; + padding: 12px 20px; + margin: 10px 0; + border-radius: 5px; + font-size: 16px; + cursor: pointer; +} + +.sidebar button:hover { + background-color: #45a049; +} + +/* Course Section */ +.course-section { + flex: 1; + padding: 20px; + margin-left: 250px; + background-color: #fff; +} + +.course-section h2 { + font-size: 2rem; + color: #333; + margin-bottom: 20px; +} + +/* Course List */ +.course-list { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + gap: 20px; +} + +.course-card { + background-color: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); + transition: transform 0.3s ease; +} + +.course-card:hover { + transform: translateY(-10px); +} + +.course-card h4 { + font-size: 1.2rem; + color: #333; + margin-bottom: 10px; +} + +.course-card p { + font-size: 1rem; + color: #777; +} + +.course-card .rating { + color: #f39c12; + font-weight: bold; +} + +button { + background-color: #4CAF50; + color: white; + padding: 12px; + border: none; + border-radius: 5px; + cursor: pointer; + font-size: 16px; + margin-top: 20px; +} + +button:hover { + background-color: #45a049; +} + +/* Login Form */ +.login-container { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + background-color: #e0f7fa; +} + +.login-box { + background-color: white; + padding: 30px; + border-radius: 15px; + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); + width: 100%; + max-width: 400px; + text-align: center; +} + +.login-box h2 { + color: #4CAF50; +} + +.login-box input { + width: 100%; + padding: 14px; + margin: 10px 0; + border-radius: 5px; + border: 1px solid #ccc; + font-size: 16px; +} + +.login-box button { + width: 100%; + padding: 14px; + background-color: #4CAF50; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; +} + +.login-box button:hover { + background-color: #45a049; +} + +#error-msg { + color: red; + margin-top: 10px; +} + +/* Animations */ +@keyframes slideIn { + from { + transform: translateX(-100%); + } + to { + transform: translateX(0); + } +} + +.sidebar { + animation: slideIn 0.5s ease-out; +} From 82df8157804d62d37783d81cb3e2d783a047b25a Mon Sep 17 00:00:00 2001 From: Sanika Joshi Date: Fri, 18 Apr 2025 00:54:46 +0530 Subject: [PATCH 06/12] Delete .gitattributes --- .gitattributes | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 3b41682a..00000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/mvnw text eol=lf -*.cmd text eol=crlf From c48dbe19aeead9ad5625e6af1362b927cc77b790 Mon Sep 17 00:00:00 2001 From: Sanika Joshi Date: Fri, 18 Apr 2025 00:55:13 +0530 Subject: [PATCH 07/12] Delete .gitignore --- .gitignore | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 549e00a2..00000000 --- a/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/**/target/ -!**/src/test/**/target/ - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ -!**/src/main/**/build/ -!**/src/test/**/build/ - -### VS Code ### -.vscode/ From 06f00c64fa03cb227c0374184dc0d0181c0a3cbe Mon Sep 17 00:00:00 2001 From: Sanika Joshi Date: Fri, 18 Apr 2025 00:55:31 +0530 Subject: [PATCH 08/12] Delete mvnw --- mvnw | 259 ----------------------------------------------------------- 1 file changed, 259 deletions(-) delete mode 100644 mvnw diff --git a/mvnw b/mvnw deleted file mode 100644 index 19529ddf..00000000 --- a/mvnw +++ /dev/null @@ -1,259 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Apache Maven Wrapper startup batch script, version 3.3.2 -# -# Optional ENV vars -# ----------------- -# JAVA_HOME - location of a JDK home dir, required when download maven via java source -# MVNW_REPOURL - repo url base for downloading maven distribution -# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven -# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output -# ---------------------------------------------------------------------------- - -set -euf -[ "${MVNW_VERBOSE-}" != debug ] || set -x - -# OS specific support. -native_path() { printf %s\\n "$1"; } -case "$(uname)" in -CYGWIN* | MINGW*) - [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" - native_path() { cygpath --path --windows "$1"; } - ;; -esac - -# set JAVACMD and JAVACCMD -set_java_home() { - # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched - if [ -n "${JAVA_HOME-}" ]; then - if [ -x "$JAVA_HOME/jre/sh/java" ]; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - JAVACCMD="$JAVA_HOME/jre/sh/javac" - else - JAVACMD="$JAVA_HOME/bin/java" - JAVACCMD="$JAVA_HOME/bin/javac" - - if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then - echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 - echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 - return 1 - fi - fi - else - JAVACMD="$( - 'set' +e - 'unset' -f command 2>/dev/null - 'command' -v java - )" || : - JAVACCMD="$( - 'set' +e - 'unset' -f command 2>/dev/null - 'command' -v javac - )" || : - - if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then - echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 - return 1 - fi - fi -} - -# hash string like Java String::hashCode -hash_string() { - str="${1:-}" h=0 - while [ -n "$str" ]; do - char="${str%"${str#?}"}" - h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) - str="${str#?}" - done - printf %x\\n $h -} - -verbose() { :; } -[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } - -die() { - printf %s\\n "$1" >&2 - exit 1 -} - -trim() { - # MWRAPPER-139: - # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. - # Needed for removing poorly interpreted newline sequences when running in more - # exotic environments such as mingw bash on Windows. - printf "%s" "${1}" | tr -d '[:space:]' -} - -# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties -while IFS="=" read -r key value; do - case "${key-}" in - distributionUrl) distributionUrl=$(trim "${value-}") ;; - distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; - esac -done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" -[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" - -case "${distributionUrl##*/}" in -maven-mvnd-*bin.*) - MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ - case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in - *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; - :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; - :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; - :Linux*x86_64*) distributionPlatform=linux-amd64 ;; - *) - echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 - distributionPlatform=linux-amd64 - ;; - esac - distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" - ;; -maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; -*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; -esac - -# apply MVNW_REPOURL and calculate MAVEN_HOME -# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ -[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" -distributionUrlName="${distributionUrl##*/}" -distributionUrlNameMain="${distributionUrlName%.*}" -distributionUrlNameMain="${distributionUrlNameMain%-bin}" -MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" -MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" - -exec_maven() { - unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : - exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" -} - -if [ -d "$MAVEN_HOME" ]; then - verbose "found existing MAVEN_HOME at $MAVEN_HOME" - exec_maven "$@" -fi - -case "${distributionUrl-}" in -*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; -*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; -esac - -# prepare tmp dir -if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then - clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } - trap clean HUP INT TERM EXIT -else - die "cannot create temp dir" -fi - -mkdir -p -- "${MAVEN_HOME%/*}" - -# Download and Install Apache Maven -verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." -verbose "Downloading from: $distributionUrl" -verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" - -# select .zip or .tar.gz -if ! command -v unzip >/dev/null; then - distributionUrl="${distributionUrl%.zip}.tar.gz" - distributionUrlName="${distributionUrl##*/}" -fi - -# verbose opt -__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' -[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v - -# normalize http auth -case "${MVNW_PASSWORD:+has-password}" in -'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; -has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; -esac - -if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then - verbose "Found wget ... using wget" - wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" -elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then - verbose "Found curl ... using curl" - curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" -elif set_java_home; then - verbose "Falling back to use Java to download" - javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" - targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" - cat >"$javaSource" <<-END - public class Downloader extends java.net.Authenticator - { - protected java.net.PasswordAuthentication getPasswordAuthentication() - { - return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); - } - public static void main( String[] args ) throws Exception - { - setDefault( new Downloader() ); - java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); - } - } - END - # For Cygwin/MinGW, switch paths to Windows format before running javac and java - verbose " - Compiling Downloader.java ..." - "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" - verbose " - Running Downloader.java ..." - "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" -fi - -# If specified, validate the SHA-256 sum of the Maven distribution zip file -if [ -n "${distributionSha256Sum-}" ]; then - distributionSha256Result=false - if [ "$MVN_CMD" = mvnd.sh ]; then - echo "Checksum validation is not supported for maven-mvnd." >&2 - echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 - exit 1 - elif command -v sha256sum >/dev/null; then - if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then - distributionSha256Result=true - fi - elif command -v shasum >/dev/null; then - if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then - distributionSha256Result=true - fi - else - echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 - echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 - exit 1 - fi - if [ $distributionSha256Result = false ]; then - echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 - echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 - exit 1 - fi -fi - -# unzip and move -if command -v unzip >/dev/null; then - unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" -else - tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" -fi -printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" -mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" - -clean || : -exec_maven "$@" From 2569a035183d625c08ecd29006393ac91be25745 Mon Sep 17 00:00:00 2001 From: Sanika Joshi Date: Fri, 18 Apr 2025 00:56:10 +0530 Subject: [PATCH 09/12] Delete mvnw.cmd --- mvnw.cmd | 149 ------------------------------------------------------- 1 file changed, 149 deletions(-) delete mode 100644 mvnw.cmd diff --git a/mvnw.cmd b/mvnw.cmd deleted file mode 100644 index 249bdf38..00000000 --- a/mvnw.cmd +++ /dev/null @@ -1,149 +0,0 @@ -<# : batch portion -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Apache Maven Wrapper startup batch script, version 3.3.2 -@REM -@REM Optional ENV vars -@REM MVNW_REPOURL - repo url base for downloading maven distribution -@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven -@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output -@REM ---------------------------------------------------------------------------- - -@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) -@SET __MVNW_CMD__= -@SET __MVNW_ERROR__= -@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% -@SET PSModulePath= -@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( - IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) -) -@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% -@SET __MVNW_PSMODULEP_SAVE= -@SET __MVNW_ARG0_NAME__= -@SET MVNW_USERNAME= -@SET MVNW_PASSWORD= -@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) -@echo Cannot start maven from wrapper >&2 && exit /b 1 -@GOTO :EOF -: end batch / begin powershell #> - -$ErrorActionPreference = "Stop" -if ($env:MVNW_VERBOSE -eq "true") { - $VerbosePreference = "Continue" -} - -# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties -$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl -if (!$distributionUrl) { - Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" -} - -switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { - "maven-mvnd-*" { - $USE_MVND = $true - $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" - $MVN_CMD = "mvnd.cmd" - break - } - default { - $USE_MVND = $false - $MVN_CMD = $script -replace '^mvnw','mvn' - break - } -} - -# apply MVNW_REPOURL and calculate MAVEN_HOME -# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ -if ($env:MVNW_REPOURL) { - $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } - $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" -} -$distributionUrlName = $distributionUrl -replace '^.*/','' -$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' -$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" -if ($env:MAVEN_USER_HOME) { - $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" -} -$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' -$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" - -if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { - Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" - Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" - exit $? -} - -if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { - Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" -} - -# prepare tmp dir -$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile -$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" -$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null -trap { - if ($TMP_DOWNLOAD_DIR.Exists) { - try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } - catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } - } -} - -New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null - -# Download and Install Apache Maven -Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." -Write-Verbose "Downloading from: $distributionUrl" -Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" - -$webclient = New-Object System.Net.WebClient -if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { - $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) -} -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null - -# If specified, validate the SHA-256 sum of the Maven distribution zip file -$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum -if ($distributionSha256Sum) { - if ($USE_MVND) { - Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." - } - Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash - if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { - Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." - } -} - -# unzip and move -Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null -Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null -try { - Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null -} catch { - if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { - Write-Error "fail to move MAVEN_HOME" - } -} finally { - try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } - catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } -} - -Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" From 37ec5e6b16b15fd27a581f216b21b5ab355cf335 Mon Sep 17 00:00:00 2001 From: Sanika Joshi Date: Fri, 18 Apr 2025 00:56:23 +0530 Subject: [PATCH 10/12] Delete pom.xml --- pom.xml | 58 --------------------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 pom.xml diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 013f83f1..00000000 --- a/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 3.4.4 - - - com.pathfinders - PathFinder - 0.0.1-SNAPSHOT - PathFinder - Demo project for Spring Boot - - - - - - - - - - - - - - - 17 - - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - From c842dace4c6dae07139dba84ca63070693ab823a Mon Sep 17 00:00:00 2001 From: Sanika Joshi Date: Fri, 18 Apr 2025 00:56:41 +0530 Subject: [PATCH 11/12] Delete src directory --- .../example/demo/CourseMatchApplication.java | 12 - .../demo/Courseservice/CourseService.java.txt | 0 .../demo/controller/CourseController.java | 105 ------ .../controller/PathFinderApplication.java | 13 - .../demo/controller/UserController.java | 21 -- .../com/example/demo/model/CourseInfo.java | 100 ------ .../java/com/example/demo/model/User.java | 23 -- .../example/demo/service/CourseSearcher.java | 290 ---------------- .../example/demo/service/CourseService.java | 129 ------- src/main/resources/application.properties | 1 - .../static/admin/manage-courses.html | 324 ------------------ .../resources/static/admin_dashboard.html | 68 ---- src/main/resources/static/css/style.css | 209 ----------- src/main/resources/static/js/app.js | 92 ----- src/main/resources/static/js/script.js | 105 ------ src/main/resources/static/login.html | 97 ------ .../resources/static/student_dashboard.html | 209 ----------- src/main/resources/templates/index.html | 65 ---- .../demo/PathFinderApplicationTests.java | 13 - 19 files changed, 1876 deletions(-) delete mode 100644 src/main/java/com/example/demo/CourseMatchApplication.java delete mode 100644 src/main/java/com/example/demo/Courseservice/CourseService.java.txt delete mode 100644 src/main/java/com/example/demo/controller/CourseController.java delete mode 100644 src/main/java/com/example/demo/controller/PathFinderApplication.java delete mode 100644 src/main/java/com/example/demo/controller/UserController.java delete mode 100644 src/main/java/com/example/demo/model/CourseInfo.java delete mode 100644 src/main/java/com/example/demo/model/User.java delete mode 100644 src/main/java/com/example/demo/service/CourseSearcher.java delete mode 100644 src/main/java/com/example/demo/service/CourseService.java delete mode 100644 src/main/resources/application.properties delete mode 100644 src/main/resources/static/admin/manage-courses.html delete mode 100644 src/main/resources/static/admin_dashboard.html delete mode 100644 src/main/resources/static/css/style.css delete mode 100644 src/main/resources/static/js/app.js delete mode 100644 src/main/resources/static/js/script.js delete mode 100644 src/main/resources/static/login.html delete mode 100644 src/main/resources/static/student_dashboard.html delete mode 100644 src/main/resources/templates/index.html delete mode 100644 src/test/java/com/example/demo/PathFinderApplicationTests.java diff --git a/src/main/java/com/example/demo/CourseMatchApplication.java b/src/main/java/com/example/demo/CourseMatchApplication.java deleted file mode 100644 index 9d9f1e1c..00000000 --- a/src/main/java/com/example/demo/CourseMatchApplication.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.example.demo; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication // This annotation marks the main entry point of the Spring Boot application -public class CourseMatchApplication { - - public static void main(String[] args) { - SpringApplication.run(CourseMatchApplication.class, args); // This starts the Spring Boot application - } -} diff --git a/src/main/java/com/example/demo/Courseservice/CourseService.java.txt b/src/main/java/com/example/demo/Courseservice/CourseService.java.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/src/main/java/com/example/demo/controller/CourseController.java b/src/main/java/com/example/demo/controller/CourseController.java deleted file mode 100644 index 7010905c..00000000 --- a/src/main/java/com/example/demo/controller/CourseController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.example.demo.controller; - -import com.example.demo.service.CourseSearcher; -import com.example.demo.model.CourseInfo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import com.example.demo.service.CourseService; - -import java.util.List; - -@RestController -@RequestMapping("/api/courses") - - -public class CourseController { - @Autowired - private CourseService courseService; - - @Autowired - private CourseSearcher courseSearcher; - - - - // Endpoint to get all courses - @GetMapping("/all") - public List getAllCourses() { - return courseSearcher.getAllCourses(); - } - - // Endpoint to search courses by name using Trie - - - // Endpoint to get ranked courses by rating (Ranking) - @GetMapping("/ranked") - public List getRankedCourses() { - return courseSearcher.getRankedCourses(); - } - - // Endpoint to get sorted courses by duration (Sorting) - @GetMapping("/sorted") - public List getSortedCoursesByDuration() { - return courseSearcher.getSortedCoursesByDuration(); - } - - // Endpoint to get courses that have prerequisites - @GetMapping("/prerequisites") - public List getCoursesWithPrerequisites() { - return courseSearcher.getCoursesWithPrerequisites(); - } - - // Endpoint to add prerequisites for a course - @PostMapping("/prerequisite") - public String addPrerequisite(@RequestParam String courseId, @RequestParam String prerequisiteId) { - courseSearcher.addPrerequisite(courseId, prerequisiteId); - return "Prerequisite added!"; - } - - // Admin Endpoint to add a new course - @PostMapping("/add") - public String addCourse(@RequestBody CourseInfo course) { - boolean success = courseSearcher.addCourse(course); - if(success) { - return "Course added successfully!"; - } else { - return "Error adding course!"; - } - } - - // Admin Endpoint to update an existing course - @PutMapping("/update/{courseId}") - public String updateCourse(@PathVariable String courseId, @RequestBody CourseInfo course) { - boolean success = courseSearcher.updateCourse(courseId, course); - if(success) { - return "Course updated successfully!"; - } else { - return "Error updating course!"; - } - } - - // Admin Endpoint to delete a course - @DeleteMapping("/delete/{courseId}") - public String deleteCourse(@PathVariable String courseId) { - boolean success = courseSearcher.deleteCourse(courseId); - if(success) { - return "Course deleted successfully!"; - } else { - return "Error deleting course!"; - } - } - - // Endpoint to get courses sorted by duration - @GetMapping("/sortedByDuration") - public List getCoursegetSortedCoursesByDuration() { - return courseSearcher.getSortedCoursesByDuration(); - } - - @GetMapping("/search") - public List search( - @RequestParam(required = false) String title, - @RequestParam(required = false) String minRating, - @RequestParam(required = false) String maxRating - ) { - return courseService.searchAndFilterCourses(title, minRating, maxRating); - } -} diff --git a/src/main/java/com/example/demo/controller/PathFinderApplication.java b/src/main/java/com/example/demo/controller/PathFinderApplication.java deleted file mode 100644 index ae760468..00000000 --- a/src/main/java/com/example/demo/controller/PathFinderApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example.demo.controller; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class PathFinderApplication { - - public static void main(String[] args) { - SpringApplication.run(PathFinderApplication.class, args); - } - -} diff --git a/src/main/java/com/example/demo/controller/UserController.java b/src/main/java/com/example/demo/controller/UserController.java deleted file mode 100644 index 74353b93..00000000 --- a/src/main/java/com/example/demo/controller/UserController.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.example.demo.controller; - -import com.example.demo.model.User; // Import the User model -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/api/auth") -public class UserController { - - @PostMapping("/login") - public String login(@RequestBody User user) { - // Hardcoded credentials for student and admin (to be replaced with a database later) - if (user.getId().equals("student") && user.getPassword().equals("student123")) { - return "student"; // For student - } else if (user.getId().equals("admin") && user.getPassword().equals("admin123")) { - return "admin"; // For admin - } else { - return "invalid"; // Invalid login credentials - } - } -} diff --git a/src/main/java/com/example/demo/model/CourseInfo.java b/src/main/java/com/example/demo/model/CourseInfo.java deleted file mode 100644 index 0d01a067..00000000 --- a/src/main/java/com/example/demo/model/CourseInfo.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.example.demo.model; -public class CourseInfo { - private String courseId; - private String courseName; - private String duration; - private String validity; - private String costStatus; // This might be the 'price' in your front-end - private String level; - private boolean certification; - private double rating; - private String review; // This might be the 'description' in your front-end - - // Constructor - public CourseInfo(String courseId, String courseName, String duration, String validity, - String costStatus, String level, boolean certification, double rating, String review) { - this.courseId = courseId; - this.courseName = courseName; - this.duration = duration; - this.validity = validity; - this.costStatus = costStatus; - this.level = level; - this.certification = certification; - this.rating = rating; - this.review = review; - } - - // Getters and Setters - public String getCourseId() { - return courseId; - } - - public void setCourseId(String courseId) { - this.courseId = courseId; - } - - public String getCourseName() { - return courseName; - } - - public void setCourseName(String courseName) { - this.courseName = courseName; - } - - public String getDuration() { - return duration; - } - - public void setDuration(String duration) { - this.duration = duration; - } - - public String getValidity() { - return validity; - } - - public void setValidity(String validity) { - this.validity = validity; - } - - public String getCostStatus() { - return costStatus; - } - - public void setCostStatus(String costStatus) { - this.costStatus = costStatus; - } - - public String getLevel() { - return level; - } - - public void setLevel(String level) { - this.level = level; - } - - public boolean isCertification() { - return certification; - } - - public void setCertification(boolean certification) { - this.certification = certification; - } - - public double getRating() { - return rating; - } - - public void setRating(double rating) { - this.rating = rating; - } - - public String getReview() { - return review; - } - - public void setReview(String review) { - this.review = review; - } - -} diff --git a/src/main/java/com/example/demo/model/User.java b/src/main/java/com/example/demo/model/User.java deleted file mode 100644 index 07beae07..00000000 --- a/src/main/java/com/example/demo/model/User.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.example.demo.model; - -public class User { - private String id; - private String password; - - // Getters and setters - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } -} diff --git a/src/main/java/com/example/demo/service/CourseSearcher.java b/src/main/java/com/example/demo/service/CourseSearcher.java deleted file mode 100644 index 2de26309..00000000 --- a/src/main/java/com/example/demo/service/CourseSearcher.java +++ /dev/null @@ -1,290 +0,0 @@ -package com.example.demo.service; - -import com.example.demo.model.CourseInfo; -import java.util.*; -import java.util.stream.Collectors; -import org.springframework.stereotype.Service; - -// Trie Data Structure -class TrieNode { - TrieNode[] children = new TrieNode[26]; // for each letter a-z - boolean isEndOfWord; - List courseInfos = new ArrayList<>(); // Store courses at this node -} - -@Service -public class CourseSearcher { - private static Trie courseTrie = new Trie(); - private static Map> prerequisitesMap = new HashMap<>(); - - private static List courseList = List.of( - new CourseInfo("C101", "Java for Beginners", "6 weeks", "1 year", "Free", "Basic", true, 4.5, "Great for newbies!"), - new CourseInfo("C102", "Advanced DSA", "8 weeks", "1 year", "Paid (Rs. 999)", "Advanced", true, 4.7, "Challenging but worth it"), - new CourseInfo("C103", "Web Dev Bootcamp", "10 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Best full-stack course"), - new CourseInfo("C104", "UI/UX Design Fundamentals", "4 weeks", "6 months", "Free", "Basic", true, 4.6, "Good start for designers"), - new CourseInfo("C105", "Python for Data Science", "7 weeks", "1 year", "Paid (Rs. 799)", "Intermediate", true, 4.7, "Very informative and practical"), - new CourseInfo("C106", "Machine Learning A-Z", "12 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Hands-on and in-depth"), - new CourseInfo("C107", "DBMS Essentials", "5 weeks", "1 year", "Free", "Intermediate", true, 4.4, "Clear explanations with examples"), - new CourseInfo("C108", "Operating Systems", "6 weeks", "6 months", "Free", "Advanced", true, 4.3, "Great for CS students"), - new CourseInfo("C109", "Cybersecurity Basics", "4 weeks", "1 year", "Free", "Basic", false, 4.2, "Short and secure!"), - new CourseInfo("C110", "React Frontend Mastery", "9 weeks", "Lifetime", "Paid (Rs. 1299)", "Advanced", true, 4.8, "Modern UI development explained well"), - new CourseInfo("C111", "Agile & Scrum Training", "3 weeks", "3 months", "Free", "Intermediate", true, 4.5, "Very helpful for team leads"), - new CourseInfo("C112", "Cloud Computing with AWS", "6 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.6, "Well structured and real-world use cases"), - new CourseInfo("C113", "AI for Everyone", "5 weeks", "6 months", "Free", "Basic", true, 4.5, "Perfect for non-tech learners curious about AI"), - new CourseInfo("C114", "Kotlin for Android Development", "8 weeks", "1 year", "Paid (Rs. 1099)", "Intermediate", true, 4.6, "Covers all Android fundamentals"), - new CourseInfo("C115", "DevOps Masterclass", "10 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.8, "Great for CI/CD & deployment"), - new CourseInfo("C116", "Soft Skills & Communication", "3 weeks", "3 months", "Free", "Basic", false, 4.3, "Helpful for interviews and teamwork"), - new CourseInfo("C117", "Blockchain Basics", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.4, "Clear and conceptual course"), - new CourseInfo("C118", "Intro to Git & GitHub", "2 weeks", "1 year", "Free", "Basic", true, 4.6, "Essential for developers"), - new CourseInfo("C119", "Data Visualization with Tableau", "5 weeks", "6 months", "Paid (Rs. 899)", "Intermediate", true, 4.5, "Clean dashboards and use cases"), - new CourseInfo("C120", "Natural Language Processing", "8 weeks", "1 year", "Paid (Rs. 1499)", "Advanced", true, 4.7, "Very hands-on with real NLP tasks"), - new CourseInfo("C121", "Intro to Game Development", "6 weeks", "6 months", "Paid (Rs. 999)", "Basic", false, 4.2, "Fun and creative starting point"), - new CourseInfo("C122", "Excel & Google Sheets Mastery", "4 weeks", "1 year", "Free", "Basic", true, 4.4, "Very practical and work-friendly"), - new CourseInfo("C123", "Core Java Essentials", "5 weeks", "6 months", "Free", "Basic", true, 4.4, "Concise and beginner-friendly"), - new CourseInfo("C124", "Learn Java with Projects", "7 weeks", "1 year", "Paid (Rs. 799)", "Basic", true, 4.6, "Good hands-on experience"), - new CourseInfo("C125", "Mastering DSA in Java", "10 weeks", "Lifetime", "Paid (Rs. 1199)", "Advanced", true, 4.9, "Best for interviews"), - new CourseInfo("C126", "Competitive Programming Bootcamp", "9 weeks", "1 year", "Free", "Advanced", false, 4.3, "Great for contests"), - new CourseInfo("C127", "Full-Stack Web Development", "12 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Covers frontend + backend thoroughly"), - new CourseInfo("C128", "Responsive Web Design", "6 weeks", "1 year", "Free", "Intermediate", true, 4.5, "Excellent for UI/UX lovers"), - new CourseInfo("C129", "AI Foundations", "4 weeks", "6 months", "Free", "Basic", true, 4.4, "Simple explanations and case studies"), - new CourseInfo("C130", "Beginner’s Guide to Machine Learning", "6 weeks", "1 year", "Paid (Rs. 999)", "Basic", true, 4.6, "Visual approach to ML"), - new CourseInfo("C131", "CI/CD Pipeline with Jenkins", "8 weeks", "1 year", "Paid (Rs. 1399)", "Advanced", true, 4.7, "Practical DevOps guide"), - new CourseInfo("C132", "Docker & Kubernetes Bootcamp", "10 weeks", "Lifetime", "Paid (Rs. 1699)", "Advanced", true, 4.9, "Excellent for real-world DevOps"), - new CourseInfo("C133", "Git Essentials", "2 weeks", "6 months", "Free", "Basic", false, 4.3, "Short and effective"), - new CourseInfo("C134", "Version Control using Git", "3 weeks", "1 year", "Paid (Rs. 499)", "Basic", true, 4.5, "Perfect for beginners"), - new CourseInfo("C135", "Applied NLP with Python", "8 weeks", "1 year", "Paid (Rs. 1499)", "Advanced", true, 4.7, "Real-world use cases"), - new CourseInfo("C136", "NLP for Beginners", "5 weeks", "6 months", "Free", "Intermediate", true, 4.4, "Clear introduction to NLP techniques"), - new CourseInfo("C137", "Business Communication Skills", "4 weeks", "3 months", "Free", "Basic", true, 4.2, "Good for workplace etiquette"), - new CourseInfo("C138", "Public Speaking Mastery", "6 weeks", "1 year", "Paid (Rs. 599)", "Intermediate", true, 4.6, "Builds confidence and clarity"), - new CourseInfo("C139", "Java OOP Mastery", "6 weeks", "1 year", "Paid (Rs. 899)", "Intermediate", true, 4.6, "Solid OOP concepts in Java"), - new CourseInfo("C140", "Java Multithreading & Concurrency", "5 weeks", "6 months", "Free", "Advanced", false, 4.4, "In-depth and hands-on"), - new CourseInfo("C141", "DSA Crash Course", "4 weeks", "3 months", "Free", "Intermediate", false, 4.3, "Quick revision for interviews"), - new CourseInfo("C142", "DSA with C++", "8 weeks", "1 year", "Paid (Rs. 1199)", "Advanced", true, 4.7, "Perfect for competitive programmers"), - new CourseInfo("C143", "React for Beginners", "6 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Simple UI building blocks"), - new CourseInfo("C144", "Backend with Node.js", "7 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Practical REST API creation"), - new CourseInfo("C145", "Deep Learning with TensorFlow", "9 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.9, "In-depth neural networks training"), - new CourseInfo("C146", "Intro to Web Scraping with Python", "5 weeks", "6 months", "Free", "Basic", false, 4.4, "Scrape real-time data!"), - new CourseInfo("C147", "Python for Automation", "6 weeks", "Lifetime", "Free", "Intermediate", true, 4.5, "Automate your daily tasks"), - new CourseInfo("C148", "Data Science with R", "8 weeks", "1 year", "Paid (Rs. 1199)", "Intermediate", true, 4.7, "Great for stats & analysis"), - new CourseInfo("C149", "Swift for iOS Development", "7 weeks", "6 months", "Paid (Rs. 1099)", "Intermediate", true, 4.8, "Create amazing iOS apps"), - new CourseInfo("C150", "Introduction to Data Science", "10 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Good starter for aspiring data scientists"), - new CourseInfo("C151", "C++ for Beginners", "5 weeks", "6 months", "Free", "Basic", true, 4.5, "Master basic C++ concepts"), - new CourseInfo("C152", "Advanced SQL Queries", "6 weeks", "1 year", "Paid (Rs. 999)", "Advanced", true, 4.7, "Master complex queries"), - new CourseInfo("C153", "Web App Security", "6 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.8, "Focus on security best practices"), - new CourseInfo("C154", "Intro to Swift Programming", "5 weeks", "1 year", "Paid (Rs. 799)", "Intermediate", true, 4.6, "Great for iOS development"), - new CourseInfo("C155", "SQL for Data Science", "8 weeks", "1 year", "Free", "Basic", true, 4.5, "Strong foundation in SQL"), - new CourseInfo("C156", "Digital Marketing Fundamentals", "5 weeks", "Lifetime", "Paid (Rs. 1299)", "Basic", false, 4.4, "Introduction to digital strategies"), - new CourseInfo("C157", "SEO for Beginners", "4 weeks", "1 year", "Free", "Basic", true, 4.5, "Optimize your website for Google"), - new CourseInfo("C158", "Introduction to Docker", "5 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Perfect for containerizing apps"), - new CourseInfo("C159", "Introduction to Cloud Computing", "7 weeks", "1 year", "Paid (Rs. 999)", "Basic", true, 4.7, "Understand cloud fundamentals"), - new CourseInfo("C160", "Networking Basics", "6 weeks", "1 year", "Free", "Basic", true, 4.4, "Learn about network protocols"), - new CourseInfo("C161", "JavaScript: The Definitive Guide", "8 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.9, "Master the JavaScript language"), - new CourseInfo("C162", "React Native Basics", "7 weeks", "6 months", "Free", "Intermediate", true, 4.6, "Mobile app development with React Native"), - new CourseInfo("C163", "Advanced CSS Techniques", "6 weeks", "1 year", "Paid (Rs. 999)", "Advanced", true, 4.7, "CSS mastery for modern websites"), - new CourseInfo("C164", "Advanced Data Science with Python", "9 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.8, "Work on complex data problems"), - new CourseInfo("C165", "Intro to Mobile Game Development", "8 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.5, "Start building games for mobile"), - new CourseInfo("C166", "GraphQL Masterclass", "5 weeks", "Lifetime", "Paid (Rs. 999)", "Advanced", true, 4.6, "Master the modern query language"), - new CourseInfo("C167", "Building APIs with Flask", "6 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Flask for building REST APIs"), - new CourseInfo("C168", "Python for Cybersecurity", "8 weeks", "1 year", "Paid (Rs. 1599)", "Intermediate", true, 4.9, "Learn cybersecurity with Python"), - new CourseInfo("C169", "Android App Development", "10 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Build Android apps from scratch"), - new CourseInfo("C170", "Intro to Augmented Reality", "6 weeks", "Lifetime", "Paid (Rs. 1799)", "Intermediate", true, 4.6, "Get hands-on with AR development"),new CourseInfo("C170", "Intro to Augmented Reality", "6 weeks", "Lifetime", "Paid (Rs. 1799)", "Intermediate", true, 4.6, "Get hands-on with AR development"), - new CourseInfo("C171", "Introduction to Quantum Computing", "7 weeks", "1 year", "Free", "Advanced", true, 4.8, "Cutting-edge technology for future computing"), - new CourseInfo("C172", "Building Chatbots with Python", "8 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Create your own conversational agents"), - new CourseInfo("C173", "Intro to Data Structures with Python", "6 weeks", "1 year", "Free", "Basic", true, 4.5, "Understanding basic data structures"), - new CourseInfo("C174", "Intro to Deep Learning with Python", "7 weeks", "Lifetime", "Paid (Rs. 1699)", "Intermediate", true, 4.8, "Deep dive into neural networks"), - new CourseInfo("C175", "UI/UX Design with Figma", "8 weeks", "1 year", "Paid (Rs. 999)", "Intermediate", true, 4.6, "Create beautiful UI/UX designs"), - new CourseInfo("C176", "Responsive Web Design with CSS Grid", "6 weeks", "Lifetime", "Free", "Intermediate", true, 4.7, "Master responsive layouts with Grid"), - new CourseInfo("C177", "R for Data Science", "8 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.8, "A hands-on approach to data science with R"), - new CourseInfo("C178", "iOS Development with Swift", "10 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Build iOS apps from scratch using Swift"), - new CourseInfo("C179", "Blockchain for Developers", "7 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Learn to build blockchain applications"), - new CourseInfo("C180", "React Native with Expo", "6 weeks", "Lifetime", "Paid (Rs. 1199)", "Intermediate", true, 4.6, "Cross-platform app development with React Native"), - new CourseInfo("C181", "Advanced CSS Layouts", "5 weeks", "6 months", "Paid (Rs. 999)", "Advanced", true, 4.8, "Master layouts using Flexbox and Grid"), - new CourseInfo("C182", "Intro to Functional Programming in JavaScript", "6 weeks", "1 year", "Free", "Intermediate", true, 4.5, "Get started with functional programming"), - new CourseInfo("C183", "Digital Illustration with Adobe Illustrator", "8 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn how to create vector art and illustrations"), - new CourseInfo("C184", "Intro to Python for Data Science", "7 weeks", "1 year", "Free", "Basic", true, 4.6, "Start your journey with Python in Data Science"), - new CourseInfo("C185", "Automated Testing with Selenium", "6 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Learn to automate web app testing with Selenium"), - new CourseInfo("C186", "Advanced Git Techniques", "5 weeks", "6 months", "Free", "Advanced", true, 4.7, "Master Git for version control"), - new CourseInfo("C187", "Intro to Software Engineering", "9 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.6, "Learn software development best practices"), - new CourseInfo("C188", "Advanced Python Programming", "8 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Become a Python expert with advanced concepts"), - new CourseInfo("C189", "Intro to Ethical Hacking", "7 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.7, "Learn ethical hacking and cybersecurity practices"), - new CourseInfo("C190", "TensorFlow for Deep Learning", "9 weeks", "1 year", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Deep dive into TensorFlow for deep learning models"), - new CourseInfo("C191", "Intro to Game Design", "5 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Understand the basics of game mechanics and design"), - new CourseInfo("C192", "Web Performance Optimization", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Speed up your websites for better performance"), - new CourseInfo("C193", "Graph Databases with Neo4j", "7 weeks", "Lifetime", "Paid (Rs. 1399)", "Advanced", true, 4.8, "Learn graph databases with Neo4j"), - new CourseInfo("C194", "Angular Advanced Techniques", "9 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.9, "Master Angular with advanced features"), - new CourseInfo("C195", "Data Science with SQL", "6 weeks", "1 year", "Paid (Rs. 999)", "Intermediate", true, 4.7, "Combine SQL with data science techniques"), - new CourseInfo("C196", "Creating APIs with Django", "8 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Learn API development with Django framework"), - new CourseInfo("C197", "Python for Web Development", "7 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Build dynamic web apps using Python"), - new CourseInfo("C198", "Cloud Engineering with Google Cloud", "10 weeks", "1 year", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Learn how to build and manage cloud applications"), - new CourseInfo("C199", "Machine Learning with Scikit-Learn", "8 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Learn machine learning techniques using Scikit-learn"), - new CourseInfo("C200", "Building Scalable Web Applications", "9 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Learn to scale and optimize your web apps"), - new CourseInfo("C201", "Complete Digital Marketing", "12 weeks", "Lifetime", "Paid (Rs. 1499)", "Basic", false, 4.7, "Covering all aspects of digital marketing strategies"), - new CourseInfo("C202", "Advanced SQL for Data Analysis", "7 weeks", "1 year", "Paid (Rs. 1299)", "Advanced", true, 4.8, "Deep dive into SQL for data analysis"), - new CourseInfo("C203", "Intro to Cloud-Native Development", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.6, "Develop cloud-native apps using modern frameworks"), - new CourseInfo("C204", "Intro to Kubernetes", "5 weeks", "Lifetime", "Free", "Intermediate", true, 4.7, "Learn container orchestration with Kubernetes"), - new CourseInfo("C205", "AI-Powered Data Analytics", "10 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Learn AI and analytics for advanced business insights"), - new CourseInfo("C206", "Vue.js Essentials", "6 weeks", "1 year", "Paid (Rs. 1199)", "Intermediate", true, 4.7, "A complete guide to mastering Vue.js framework"), - new CourseInfo("C207", "Creating Web Applications with Flask", "7 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.8, "Build scalable web apps with Flask"), - new CourseInfo("C208", "Advanced JavaScript ES6+", "6 weeks", "1 year", "Paid (Rs. 1299)", "Advanced", true, 4.9, "Master the latest features of JavaScript"), - new CourseInfo("C209", "Data Engineering with Python", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Learn how to manage and process large data sets"), - new CourseInfo("C210", "DevOps Automation with Ansible", "9 weeks", "1 year", "Paid (Rs. 1799)", "Advanced", true, 4.7, "Automate your infrastructure management with Ansible"), - new CourseInfo("C211", "Design Thinking for Developers", "6 weeks", "Lifetime", "Free", "Intermediate", true, 4.7, "Learn how to approach problem-solving like a designer"), - new CourseInfo("C212", "Deep Learning with Keras", "8 weeks", "1 year", "Paid (Rs. 1699)", "Advanced", true, 4.9, "Create neural networks with Keras and TensorFlow"), - new CourseInfo("C213", "Introduction to 3D Modeling", "7 weeks", "Lifetime", "Paid (Rs. 1399)", "Basic", true, 4.5, "Learn the basics of 3D design and modeling"), - new CourseInfo("C214", "Augmented Reality with Unity", "10 weeks", "1 year", "Paid (Rs. 1999)", "Intermediate", true, 4.8, "Create AR experiences using Unity"), - new CourseInfo("C215", "Docker for Developers", "6 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn to containerize your applications with Docker"), - new CourseInfo("C216", "Natural Language Processing with Python", "8 weeks", "1 year", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Work on real-world NLP problems using Python"), - new CourseInfo("C217", "Advanced React Concepts", "6 weeks", "Lifetime", "Paid (Rs. 1399)", "Advanced", true, 4.9, "Level up your React skills with advanced concepts"), - new CourseInfo("C218", "Python for Data Visualization", "5 weeks", "Lifetime", "Free", "Intermediate", true, 4.6, "Visualize data using libraries like Matplotlib"), - new CourseInfo("C219", "Introduction to Financial Modeling", "7 weeks", "1 year", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Learn financial modeling techniques for business"), - new CourseInfo("C220", "Advanced Ethical Hacking", "8 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.8, "Dive deep into penetration testing and security"), - new CourseInfo("C221", "Intro to Mobile Web Development", "6 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Develop mobile-friendly websites with modern techniques"), - new CourseInfo("C222", "Building Scalable Databases with MongoDB", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Learn how to design and scale MongoDB databases"), - new CourseInfo("C223", "AWS Certified Solutions Architect", "10 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Prepare for AWS Solutions Architect certification"), - new CourseInfo("C224", "API Development with Node.js", "7 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn how to build APIs using Node.js and Express"), - new CourseInfo("C225", "Creating Cross-Platform Apps with Flutter", "8 weeks", "Lifetime", "Paid (Rs. 1699)", "Intermediate", true, 4.8, "Develop native cross-platform apps with Flutter"), - new CourseInfo("C226", "Mastering Python for Machine Learning", "9 weeks", "Lifetime", "Paid (Rs. 1799)", "Advanced", true, 4.9, "Deep dive into Python for advanced machine learning"), - new CourseInfo("C227", "Deep Learning with PyTorch", "8 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Work on real-world deep learning projects using PyTorch"), - new CourseInfo("C228", "Understanding Big Data", "6 weeks", "Lifetime", "Paid (Rs. 999)", "Intermediate", true, 4.7, "Learn how to handle and process big data systems"), - new CourseInfo("C229", "UX/UI Research and Testing", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.6, "Conduct research and usability testing for UI/UX"), - new CourseInfo("C230", "Advanced Node.js", "7 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.9, "Master Node.js and build scalable applications"), - new CourseInfo("C231", "Building Mobile Apps with Kotlin", "9 weeks", "Lifetime", "Paid (Rs. 1799)", "Intermediate", true, 4.8, "Learn Android development with Kotlin"), - new CourseInfo("C232", "Intro to WebAssembly", "6 weeks", "1 year", "Paid (Rs. 1199)", "Intermediate", true, 4.7, "Explore high-performance applications with WebAssembly"), - new CourseInfo("C233", "Intro to Digital Art Creation", "5 weeks", "Lifetime", "Paid (Rs. 999)", "Basic", true, 4.6, "Start creating digital art and illustrations"), - new CourseInfo("C234", "Developing with Angular", "8 weeks", "Lifetime", "Paid (Rs. 1399)", "Intermediate", true, 4.8, "Learn Angular for modern web applications"), - new CourseInfo("C235", "Intro to Data Visualization with D3.js", "7 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Master data visualization techniques with D3.js"), - new CourseInfo("C236", "Introduction to Scala for Data Science", "6 weeks", "1 year", "Free", "Intermediate", true, 4.6, "Leverage Scala for data science applications"), - new CourseInfo("C237", "Getting Started with SwiftUI", "8 weeks", "Lifetime", "Paid (Rs. 1299)", "Intermediate", true, 4.7, "Learn modern iOS development with SwiftUI"), - new CourseInfo("C238", "AI in Healthcare", "9 weeks", "1 year", "Paid (Rs. 1599)", "Advanced", true, 4.8, "Explore AI applications in the healthcare industry"), - new CourseInfo("C239", "Intro to Arduino Programming", "6 weeks", "Lifetime", "Free", "Basic", true, 4.6, "Learn how to create hardware projects with Arduino"), - new CourseInfo("C240", "Automation with Python Scripts", "7 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.8, "Automate tasks and processes with Python scripting"), - new CourseInfo("C241", "Security for Web Developers", "6 weeks", "Lifetime", "Paid (Rs. 1499)", "Intermediate", true, 4.7, "Understand security concepts for web applications"), - new CourseInfo("C242", "Deep Learning for NLP", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Advanced", true, 4.9, "Build deep learning models for NLP tasks"), - new CourseInfo("C243", "React Redux for State Management", "6 weeks", "1 year", "Paid (Rs. 1299)", "Intermediate", true, 4.8, "Master state management with Redux in React"), - new CourseInfo("C244", "Mastering GitHub for Developers", "5 weeks", "Lifetime", "Free", "Basic", true, 4.7, "Learn version control and collaboration with GitHub"), - new CourseInfo("C245", "Introduction to Web Design with HTML & CSS", "5 weeks", "Lifetime", "Free", "Basic", true, 4.5, "Learn the fundamentals of web design with HTML & CSS"), - new CourseInfo("C246", "Serverless Architecture with AWS Lambda", "8 weeks", "Lifetime", "Paid (Rs. 1499)", "Advanced", true, 4.8, "Build scalable serverless applications with AWS Lambda"), - new CourseInfo("C247", "Mastering API Security", "9 weeks", "1 year", "Paid (Rs. 1699)", "Advanced", true, 4.9, "Learn to secure your APIs with modern techniques"), - new CourseInfo("C248", "Building Real-time Applications with Node.js", "8 weeks", "Lifetime", "Paid (Rs. 1599)", "Intermediate", true, 4.8, "Learn to build real-time apps using Node.js"), - new CourseInfo("C249", "Business Intelligence with Power BI", "7 weeks", "1 year", "Paid (Rs. 1399)", "Intermediate", true, 4.7, "Leverage Power BI for creating business intelligence solutions"), - new CourseInfo("C250", "Deep Learning for Computer Vision", "10 weeks", "Lifetime", "Paid (Rs. 1999)", "Advanced", true, 4.9, "Create advanced computer vision models with deep learning") - ); - - static { - // Insert all courses into the Trie for efficient search - for (CourseInfo course : courseList) { - courseTrie.insert(course.getCourseName(), course); - } - } - - // Get all courses - public List getAllCourses() { - return courseList; - } - - // Search courses by name using Trie - public List searchCourses(String courseName) { - return courseTrie.search(courseName); - } - - // Get courses ranked by rating (Ranking) - public List getRankedCourses() { - return courseList.stream() - .sorted(Comparator.comparingDouble(CourseInfo::getRating).reversed()) - .collect(Collectors.toList()); - } - - // Get courses sorted by duration (Sorting) - public List getSortedCoursesByDuration() { - return courseList.stream() - .sorted(Comparator.comparingInt(course -> Integer.parseInt(course.getDuration().split(" ")[0]))) // Sorting by numeric value of duration - .collect(Collectors.toList()); - } - - - // Get courses with prerequisites - public List getCoursesWithPrerequisites() { - List coursesWithPrerequisites = new ArrayList<>(); - for (CourseInfo course : courseList) { - if (prerequisitesMap.containsKey(course.getCourseId())) { - coursesWithPrerequisites.add(course); - } - } - return coursesWithPrerequisites; - } - - // Add prerequisites to a course - public void addPrerequisite(String courseId, String prerequisiteId) { - prerequisitesMap.computeIfAbsent(courseId, k -> new ArrayList<>()).add(prerequisiteId); - } - - // Add a course - public boolean addCourse(CourseInfo course) { - return courseList.add(course); - } - - // Update an existing course - public boolean updateCourse(String courseId, CourseInfo updatedCourse) { - for (int i = 0; i < courseList.size(); i++) { - CourseInfo course = courseList.get(i); - if (course.getCourseId().equals(courseId)) { - courseList.set(i, updatedCourse); - return true; - } - } - return false; - } - - // Delete a course - public boolean deleteCourse(String courseId) { - return courseList.removeIf(course -> course.getCourseId().equals(courseId)); - } - - // Trie class for efficient course search - static class Trie { - private TrieNode root; - - public Trie() { - root = new TrieNode(); - } - - public void insert(String courseName, CourseInfo courseInfo) { - TrieNode node = root; - for (char c : courseName.toLowerCase().toCharArray()) { - if (Character.isAlphabetic(c)) { // Only process alphabetic characters - int index = c - 'a'; // Calculate index for alphabetic characters - if (node.children[index] == null) { - node.children[index] = new TrieNode(); - } - node = node.children[index]; - } - } - node.isEndOfWord = true; - node.courseInfos.add(courseInfo); - } - - public List search(String prefix) { - TrieNode node = root; - for (char c : prefix.toLowerCase().toCharArray()) { - if (node.children[c - 'a'] == null) { - return new ArrayList<>(); // Return empty if no match - } - node = node.children[c - 'a']; - } - return collectCourses(node); - } - - private List collectCourses(TrieNode node) { - List courses = new ArrayList<>(); - if (node.isEndOfWord) { - courses.addAll(node.courseInfos); - } - for (TrieNode child : node.children) { - if (child != null) { - courses.addAll(collectCourses(child)); - } - } - return courses; - } - } -} diff --git a/src/main/java/com/example/demo/service/CourseService.java b/src/main/java/com/example/demo/service/CourseService.java deleted file mode 100644 index cfee1807..00000000 --- a/src/main/java/com/example/demo/service/CourseService.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.example.demo.service; - -import com.example.demo.model.CourseInfo; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -@Service -public class CourseService { - - // Fetch courses from the CourseSearcher class - - List allCourses = getAllCourses(); - // Method to search and filter courses - - // Method to search and filter courses - public List searchAndFilterCourses(String name, String minDuration, String maxDuration) { - List filteredCourses = new ArrayList<>(); - - // If the user provided no filters, return all courses - if ((minDuration == null || minDuration.isEmpty() || Integer.parseInt(minDuration) == 0) && - (maxDuration == null || maxDuration.isEmpty() || Integer.parseInt(maxDuration) == 0)) { - - // If no valid duration filters, just filter by name if given - return searchAndFilterCourses(name); - } - - // Filter based on name and duration if provided - for (CourseInfo course : allCourses) { - boolean matches = true; - - // Filter by course name if provided - if (name != null && !name.isEmpty() && !course.getCourseName().toLowerCase().contains(name.toLowerCase())) { - matches = false; - } - - // If minDuration is provided and valid, filter by duration - if (minDuration != null && !minDuration.isEmpty() && Integer.parseInt(minDuration) > 0) { - try { - int minDur = Integer.parseInt(minDuration); - if (Integer.parseInt(course.getDuration()) < minDur) { - matches = false; - } - } catch (NumberFormatException e) { - matches = false; - } - } - - // If maxDuration is provided and valid, filter by duration - if (maxDuration != null && !maxDuration.isEmpty() && Integer.parseInt(maxDuration) > 0) { - try { - int maxDur = Integer.parseInt(maxDuration); - if (Integer.parseInt(course.getDuration()) > maxDur) { - matches = false; - } - } catch (NumberFormatException e) { - matches = false; - } - } - - // If the course matches all filters, add it to the result - if (matches) { - filteredCourses.add(course); - } - } - - return filteredCourses; - } - - // Function to handle searching only by name (overloading) - public List searchAndFilterCourses(String name) { - List filteredCourses = new ArrayList<>(); - for (CourseInfo course : allCourses) { - if (name != null && !name.isEmpty() && course.getCourseName().toLowerCase().contains(name.toLowerCase())) { - filteredCourses.add(course); - } - } - return filteredCourses; - } - - - - private List courseList = new ArrayList<>(); - - // Fetch all courses - public List getAllCourses() { - return courseList; - } - - // Add a new course - public void addCourse(CourseInfo course) { - courseList.add(course); - } - - // Update an existing course - public void updateCourse(CourseInfo updatedCourse) { - for (CourseInfo course : courseList) { - if (course.getCourseId().equals(updatedCourse.getCourseId())) { - course.setCourseName(updatedCourse.getCourseName()); - course.setDuration(updatedCourse.getDuration()); - course.setCostStatus(updatedCourse.getCostStatus()); - course.setLevel(updatedCourse.getLevel()); - course.setRating(updatedCourse.getRating()); - course.setReview(updatedCourse.getReview()); - } - } - } - - // Delete a course by ID - public void deleteCourse(String courseId) { - courseList.removeIf(course -> course.getCourseId().equals(courseId)); - } - - // Rank courses by rating - public List getRankedCourses() { - return courseList.stream() - .sorted((course1, course2) -> Double.compare(course2.getRating(), course1.getRating())) // Sort by rating in descending order - .collect(Collectors.toList()); - } - - // Sort courses by duration - public List getCoursesSortedByDuration() { - return courseList.stream() - .sorted((course1, course2) -> Integer.compare(Integer.parseInt(course1.getDuration()), Integer.parseInt(course2.getDuration()))) - .collect(Collectors.toList()); - } -} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties deleted file mode 100644 index 0fb8e821..00000000 --- a/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -spring.application.name=PathFinder diff --git a/src/main/resources/static/admin/manage-courses.html b/src/main/resources/static/admin/manage-courses.html deleted file mode 100644 index 151de35e..00000000 --- a/src/main/resources/static/admin/manage-courses.html +++ /dev/null @@ -1,324 +0,0 @@ - - - - - - Manage Courses - Admin Dashboard - - - - -
- - - - -
-
- -
- -
-
- -

Manage Courses

- - - - - - - - - - - - - - - - - - -
Course NameDurationPriceRatingActions
-
-
- - - - - - diff --git a/src/main/resources/static/admin_dashboard.html b/src/main/resources/static/admin_dashboard.html deleted file mode 100644 index 2a5f943d..00000000 --- a/src/main/resources/static/admin_dashboard.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Admin Dashboard - - - -
-
- -
- -
-
- - - -
-

Admin Overview

-
Admin-specific information will go here.
-
-
- - - - - - diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css deleted file mode 100644 index e55ef9a8..00000000 --- a/src/main/resources/static/css/style.css +++ /dev/null @@ -1,209 +0,0 @@ -/* Global Reset */ -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -/* Body styles */ -body { - font-family: 'Arial', sans-serif; - background-color: #f5f5f5; - color: #333; -} - -/* Main container */ -.dashboard-container { - display: flex; - min-height: 100vh; -} - -/* Header */ -.header { - width: 100%; - background-color: #4CAF50; - color: white; - padding: 20px; - display: flex; - justify-content: space-between; - align-items: center; -} - -.header-logo h1 { - margin-left: 20px; -} - -.header-nav button { - background-color: #45a049; - color: white; - border: none; - padding: 10px 20px; - border-radius: 5px; - cursor: pointer; - font-size: 16px; -} - -.header-nav button:hover { - background-color: #3e8e41; -} - -/* Sidebar */ -.sidebar { - width: 250px; - background-color: #2f4f4f; - color: white; - padding: 20px; - display: flex; - flex-direction: column; - justify-content: flex-start; - height: 100vh; -} - -.sidebar h3 { - margin-bottom: 20px; - font-size: 1.5rem; -} - -.sidebar button { - background-color: #4CAF50; - color: white; - border: none; - padding: 12px 20px; - margin: 10px 0; - border-radius: 5px; - font-size: 16px; - cursor: pointer; -} - -.sidebar button:hover { - background-color: #45a049; -} - -/* Course Section */ -.course-section { - flex: 1; - padding: 20px; - margin-left: 250px; - background-color: #fff; -} - -.course-section h2 { - font-size: 2rem; - color: #333; - margin-bottom: 20px; -} - -/* Course List */ -.course-list { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); - gap: 20px; -} - -.course-card { - background-color: #fff; - padding: 20px; - border-radius: 10px; - box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); - transition: transform 0.3s ease; -} - -.course-card:hover { - transform: translateY(-10px); -} - -.course-card h4 { - font-size: 1.2rem; - color: #333; - margin-bottom: 10px; -} - -.course-card p { - font-size: 1rem; - color: #777; -} - -.course-card .rating { - color: #f39c12; - font-weight: bold; -} - -button { - background-color: #4CAF50; - color: white; - padding: 12px; - border: none; - border-radius: 5px; - cursor: pointer; - font-size: 16px; - margin-top: 20px; -} - -button:hover { - background-color: #45a049; -} - -/* Login Form */ -.login-container { - display: flex; - justify-content: center; - align-items: center; - height: 100vh; - background-color: #e0f7fa; -} - -.login-box { - background-color: white; - padding: 30px; - border-radius: 15px; - box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); - width: 100%; - max-width: 400px; - text-align: center; -} - -.login-box h2 { - color: #4CAF50; -} - -.login-box input { - width: 100%; - padding: 14px; - margin: 10px 0; - border-radius: 5px; - border: 1px solid #ccc; - font-size: 16px; -} - -.login-box button { - width: 100%; - padding: 14px; - background-color: #4CAF50; - color: white; - border: none; - border-radius: 5px; - cursor: pointer; -} - -.login-box button:hover { - background-color: #45a049; -} - -#error-msg { - color: red; - margin-top: 10px; -} - -/* Animations */ -@keyframes slideIn { - from { - transform: translateX(-100%); - } - to { - transform: translateX(0); - } -} - -.sidebar { - animation: slideIn 0.5s ease-out; -} diff --git a/src/main/resources/static/js/app.js b/src/main/resources/static/js/app.js deleted file mode 100644 index 29b23944..00000000 --- a/src/main/resources/static/js/app.js +++ /dev/null @@ -1,92 +0,0 @@ -let role = ''; // Track if the user is an 'admin' or 'student' - -document.addEventListener("DOMContentLoaded", function() { - setRole('student'); // Default to student view on page load -}); - -function setRole(selectedRole) { - role = selectedRole; - - if (role === 'student') { - // Show student view, hide admin view - document.getElementById('studentView').style.display = 'block'; - document.getElementById('adminView').style.display = 'none'; - loadCourses(); // Load courses for student view - } else if (role === 'admin') { - // Show admin view, hide student view - document.getElementById('studentView').style.display = 'none'; - document.getElementById('adminView').style.display = 'block'; - } -} - -function loadCourses() { - fetch('http://localhost:8081/api/courses/all') - .then(response => response.json()) - .then(courses => { - displayCourses(courses); - }) - .catch(error => console.error("Error loading courses:", error)); -} - -function displayCourses(courses) { - const courseList = document.getElementById('courseList'); - courseList.innerHTML = ''; // Clear previous list - - if (courses.length === 0) { - courseList.innerHTML = '

No courses available.

'; - return; - } - - courses.forEach(course => { - const courseCard = document.createElement('div'); - courseCard.classList.add('course-card'); - - courseCard.innerHTML = ` -

${course.courseName}

-

Duration: ${course.duration}

-

Validity: ${course.validity}

-

Cost: ${course.costStatus}

-

Level: ${course.level}

-

Rating: ${course.rating}

-

Review: ${course.review}

- `; - - courseList.appendChild(courseCard); - }); -} - -function searchCourses() { - const query = document.getElementById('courseSearch').value; - - if (query.length < 3) { - loadCourses(); // If query is too short, load all courses - return; - } - - fetch(`http://localhost:8081/api/courses/search?courseName=${query}`) - .then(response => response.json()) - .then(courses => { - displayCourses(courses); - }) - .catch(error => console.error("Error searching courses:", error)); -} - -// Fetch ranked courses by rating -function getRankedCourses() { - fetch('http://localhost:8081/api/courses/ranked') - .then(response => response.json()) - .then(courses => { - displayCourses(courses); - }) - .catch(error => console.error("Error fetching ranked courses:", error)); -} - -// Fetch sorted courses by duration -function getSortedCourses() { - fetch('http://localhost:8081/api/courses/sorted') - .then(response => response.json()) - .then(courses => { - displayCourses(courses); - }) - .catch(error => console.error("Error fetching sorted courses:", error)); -} diff --git a/src/main/resources/static/js/script.js b/src/main/resources/static/js/script.js deleted file mode 100644 index 79ecbeee..00000000 --- a/src/main/resources/static/js/script.js +++ /dev/null @@ -1,105 +0,0 @@ -function login() { - const userId = document.getElementById('userId').value; - const password = document.getElementById('password').value; - - const loginData = { - id: userId, - password: password - }; - - fetch('http://localhost:8080/api/auth/login', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(loginData) - }) - .then(response => response.text()) - .then(data => { - if (data === 'student') { - localStorage.setItem('userType', 'student'); - window.location.href = "student_dashboard.html"; - } else if (data === 'admin') { - localStorage.setItem('userType', 'admin'); - window.location.href = "admin_dashboard.html"; - } else { - document.getElementById('error-msg').textContent = 'Invalid credentials, please try again.'; - } - }) - .catch(error => console.error('Error:', error)); -} - -function logout() { - localStorage.removeItem('userType'); - window.location.href = 'login.html'; -} - -window.onload = function() { - const userType = localStorage.getItem('userType'); - if (userType !== 'student' && userType !== 'admin') { - window.location.href = 'login.html'; - return; - } - - fetch(`http://localhost:8080/api/auth/courses?userType=${userType}`) - .then(response => response.json()) - .then(courses => { - const courseList = document.getElementById('course-list'); - courses.forEach(course => { - const courseCard = document.createElement('div'); - courseCard.classList.add('course-card'); - courseCard.innerHTML = ` -

${course.courseName}

-

${course.description}

-

Rating: ${course.rating}

-

Duration: ${course.duration}

-

Price: ${course.price}

- `; - courseList.appendChild(courseCard); - }); - }) - .catch(error => console.error('Error:', error)); -} -function fetchCourses() { - fetch('/api/courses/all') - .then(response => response.json()) - .then(data => displayCourses(data)); -} - -function searchCourses() { - const courseName = document.getElementById('searchName').value; - const minDuration = parseInt(document.getElementById('minDuration').value); - const maxDuration = parseInt(document.getElementById('maxDuration').value); - const sortByRating = document.getElementById('sortByRating').checked ? 'yes' : 'no'; - - fetch(`/api/courses/search?courseName=${courseName}&minDuration=${minDuration}&maxDuration=${maxDuration}&sortByRating=${sortByRating}`) - .then(response => response.json()) - .then(data => displayCourses(data)); -} - -function getRankedCourses() { - fetch('/api/courses/ranked') - .then(response => response.json()) - .then(data => displayCourses(data)); -} - -function getSortedCourses() { - fetch('/api/courses/sorted') - .then(response => response.json()) - .then(data => displayCourses(data)); -} - -function displayCourses(courses) { - const tableBody = document.getElementById('courseTableBody'); - tableBody.innerHTML = ''; - - courses.forEach(course => { - const row = ` - ${course.courseName} - ${course.instructor} - ${course.duration} - ${course.rating} - `; - tableBody.innerHTML += row; - }); -}; diff --git a/src/main/resources/static/login.html b/src/main/resources/static/login.html deleted file mode 100644 index b87d99db..00000000 --- a/src/main/resources/static/login.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - Login - Course Finder - - - - - - - - - - diff --git a/src/main/resources/static/student_dashboard.html b/src/main/resources/static/student_dashboard.html deleted file mode 100644 index 20d143b8..00000000 --- a/src/main/resources/static/student_dashboard.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - Course Dashboard - - - - - - - -
- Student Course Dashboard -
- -
- - - - - - -
- -
- - - - - - diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html deleted file mode 100644 index 686a6caa..00000000 --- a/src/main/resources/templates/index.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - Welcome to Course Finder - - - - -
-

Welcome to Course Finder

- - -
- - - - - diff --git a/src/test/java/com/example/demo/PathFinderApplicationTests.java b/src/test/java/com/example/demo/PathFinderApplicationTests.java deleted file mode 100644 index 30a21184..00000000 --- a/src/test/java/com/example/demo/PathFinderApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example.demo; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class PathFinderApplicationTests { - - @Test - void contextLoads() { - } - -} From 90809ed13cd12fd9234d89b31c708ff6e0479c4b Mon Sep 17 00:00:00 2001 From: Sanika Joshi Date: Fri, 18 Apr 2025 00:56:50 +0530 Subject: [PATCH 12/12] Delete .mvn/wrapper directory --- .mvn/wrapper/maven-wrapper.properties | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .mvn/wrapper/maven-wrapper.properties diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties deleted file mode 100644 index d58dfb70..00000000 --- a/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -wrapperVersion=3.3.2 -distributionType=only-script -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip