diff --git a/.gitignore b/.gitignore index a547bf3..2791342 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,11 @@ dist-ssr *.njsproj *.sln *.sw? +*.db + +# Environments +.env +.env.local +.env.* +.env.development +.env.production diff --git a/backend/.mvn/wrapper/maven-wrapper.properties b/backend/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..8dea6c2 --- /dev/null +++ b/backend/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,3 @@ +wrapperVersion=3.3.4 +distributionType=only-script +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip diff --git a/backend/.vscode/launch.json b/backend/.vscode/launch.json new file mode 100644 index 0000000..bbbebda --- /dev/null +++ b/backend/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + "configurations": [ + { + "type": "java", + "name": "Spring Boot-PortalApplication", + "request": "launch", + "cwd": "${workspaceFolder}", + "mainClass": "com.rit.portal.PortalApplication", + "projectName": "portal", + "args": "", + "envFile": "${workspaceFolder}/.env" + } + ] +} \ No newline at end of file diff --git a/backend/mvnw b/backend/mvnw new file mode 100644 index 0000000..bd8896b --- /dev/null +++ b/backend/mvnw @@ -0,0 +1,295 @@ +#!/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.4 +# +# 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:]' +} + +scriptDir="$(dirname "$0")" +scriptName="$(basename "$0")" + +# 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 <"$scriptDir/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in $scriptDir/.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${scriptName#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 + +# Find the actual extracted directory name (handles snapshots where filename != directory name) +actualDistributionDir="" + +# First try the expected directory name (for regular distributions) +if [ -d "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" ]; then + if [ -f "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/bin/$MVN_CMD" ]; then + actualDistributionDir="$distributionUrlNameMain" + fi +fi + +# If not found, search for any directory with the Maven executable (for snapshots) +if [ -z "$actualDistributionDir" ]; then + # enable globbing to iterate over items + set +f + for dir in "$TMP_DOWNLOAD_DIR"/*; do + if [ -d "$dir" ]; then + if [ -f "$dir/bin/$MVN_CMD" ]; then + actualDistributionDir="$(basename "$dir")" + break + fi + fi + done + set -f +fi + +if [ -z "$actualDistributionDir" ]; then + verbose "Contents of $TMP_DOWNLOAD_DIR:" + verbose "$(ls -la "$TMP_DOWNLOAD_DIR")" + die "Could not find Maven distribution directory in extracted archive" +fi + +verbose "Found extracted Maven distribution directory: $actualDistributionDir" +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$actualDistributionDir/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$actualDistributionDir" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/backend/mvnw.cmd b/backend/mvnw.cmd new file mode 100644 index 0000000..92450f9 --- /dev/null +++ b/backend/mvnw.cmd @@ -0,0 +1,189 @@ +<# : 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.4 +@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 -eq $False) { "/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_M2_PATH = "$HOME/.m2" +if ($env:MAVEN_USER_HOME) { + $MAVEN_M2_PATH = "$env:MAVEN_USER_HOME" +} + +if (-not (Test-Path -Path $MAVEN_M2_PATH)) { + New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null +} + +$MAVEN_WRAPPER_DISTS = $null +if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) { + $MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists" +} else { + $MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists" +} + +$MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain" +$MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::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 + +# Find the actual extracted directory name (handles snapshots where filename != directory name) +$actualDistributionDir = "" + +# First try the expected directory name (for regular distributions) +$expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain" +$expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD" +if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) { + $actualDistributionDir = $distributionUrlNameMain +} + +# If not found, search for any directory with the Maven executable (for snapshots) +if (!$actualDistributionDir) { + Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object { + $testPath = Join-Path $_.FullName "bin/$MVN_CMD" + if (Test-Path -Path $testPath -PathType Leaf) { + $actualDistributionDir = $_.Name + } + } +} + +if (!$actualDistributionDir) { + Write-Error "Could not find Maven distribution directory in extracted archive" +} + +Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir" +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -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/backend/pom.xml b/backend/pom.xml index 9995b8f..7739cd7 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -1,35 +1,42 @@ - + 4.0.0 org.springframework.boot spring-boot-starter-parent - 3.4.1 - + 3.4.13 + com.rit portal 0.0.1-SNAPSHOT Freshers Hub Backend Centralized Spring Boot backend for RIT Freshers Hub - + - + - + - - - - + + + + 17 + + + org.springframework.boot + spring-boot-starter-actuator + + org.springframework.boot @@ -87,4 +94,4 @@ - + \ No newline at end of file diff --git a/backend/src/main/java/com/rit/portal/controller/BusRouteController.java b/backend/src/main/java/com/rit/portal/controller/BusRouteController.java new file mode 100644 index 0000000..da11521 --- /dev/null +++ b/backend/src/main/java/com/rit/portal/controller/BusRouteController.java @@ -0,0 +1,20 @@ +package com.rit.portal.controller; + +import com.rit.portal.entity.BusRoute; +import com.rit.portal.repository.BusRouteRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.List; + +@RestController +@RequestMapping("/api/bus-routes") +public class BusRouteController { + + @Autowired + private BusRouteRepository busRouteRepository; + + @GetMapping + public List getAllBusRoutes() { + return busRouteRepository.findAll(); + } +} diff --git a/backend/src/main/java/com/rit/portal/controller/CommunityQuestionController.java b/backend/src/main/java/com/rit/portal/controller/CommunityQuestionController.java new file mode 100644 index 0000000..a97b8fb --- /dev/null +++ b/backend/src/main/java/com/rit/portal/controller/CommunityQuestionController.java @@ -0,0 +1,97 @@ +package com.rit.portal.controller; + +import com.rit.portal.entity.CommunityAnswer; +import com.rit.portal.entity.CommunityQuestion; +import com.rit.portal.repository.CommunityAnswerRepository; +import com.rit.portal.repository.CommunityQuestionRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.client.RestTemplate; +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/api/questions") +public class CommunityQuestionController { + + @Autowired + private CommunityQuestionRepository questionRepository; + + @Autowired + private CommunityAnswerRepository answerRepository; + + private final RestTemplate restTemplate = new RestTemplate(); + private static final String TELEGRAM_BOT_URL = "http://localhost:8082/send_question"; + + @GetMapping + public List getAllQuestions() { + return questionRepository.findAll(); + } + + @GetMapping("/paged") + public org.springframework.data.domain.Page getPagedQuestions( + @RequestParam(defaultValue = "0") int page, + @RequestParam(defaultValue = "5") int size) { + return questionRepository.findAll( + org.springframework.data.domain.PageRequest.of( + page, + size, + org.springframework.data.domain.Sort.by("createdAt").descending() + ) + ); + } + + @PostMapping + public CommunityQuestion createQuestion(@RequestBody CommunityQuestion question) { + if (question.getUpvotes() == null) question.setUpvotes(0); + if (question.getIsAnswered() == null) question.setIsAnswered(false); + question.setCreatedAt(LocalDateTime.now()); + + CommunityQuestion saved = questionRepository.save(question); + + // Notify Telegram bot in a background thread to keep it robust and non-blocking + new Thread(() -> { + try { + Map payload = new HashMap<>(); + payload.put("question_id", saved.getId()); + payload.put("title", saved.getTitle()); + payload.put("body", saved.getBody()); + payload.put("author", saved.getAuthor()); + + restTemplate.postForEntity(TELEGRAM_BOT_URL, payload, String.class); + } catch (Exception e) { + System.err.println("Failed to notify Telegram Bot intermediary: " + e.getMessage()); + } + }).start(); + + return saved; + } + + @PostMapping("/{id}/answers") + public ResponseEntity addAnswer(@PathVariable Integer id, @RequestBody CommunityAnswer answer) { + return questionRepository.findById(id).map(question -> { + answer.setQuestion(question); + if (answer.getUpvotes() == null) answer.setUpvotes(0); + if (answer.getIsAccepted() == null) answer.setIsAccepted(false); + answer.setCreatedAt(LocalDateTime.now()); + + CommunityAnswer savedAnswer = answerRepository.save(answer); + + question.setIsAnswered(true); + questionRepository.save(question); + + return ResponseEntity.ok(savedAnswer); + }).orElse(ResponseEntity.notFound().build()); + } + + @PostMapping("/{id}/upvote") + public ResponseEntity upvoteQuestion(@PathVariable Integer id) { + return questionRepository.findById(id).map(question -> { + question.setUpvotes(question.getUpvotes() + 1); + return ResponseEntity.ok(questionRepository.save(question)); + }).orElse(ResponseEntity.notFound().build()); + } +} diff --git a/backend/src/main/java/com/rit/portal/controller/NotePyqController.java b/backend/src/main/java/com/rit/portal/controller/NotePyqController.java index 8ee5400..7fc8b78 100644 --- a/backend/src/main/java/com/rit/portal/controller/NotePyqController.java +++ b/backend/src/main/java/com/rit/portal/controller/NotePyqController.java @@ -14,7 +14,6 @@ import java.time.LocalDateTime; @RestController @RequestMapping("/api/notes") -@CrossOrigin(origins = "*") // CrossOrigin configured globally, but added here for safety public class NotePyqController { @Autowired @@ -142,7 +141,7 @@ public class NotePyqController { // Increment downloads count @PostMapping("/{id}/download") - public ResponseEntity incrementDownloads(@PathVariable Long id) { + public ResponseEntity incrementDownloads(@PathVariable Integer id) { return noteRepository.findById(id).map(note -> { note.setDownloadsCount(note.getDownloadsCount() + 1); note.setFileType(note.getFileType()); // Keep dirty check diff --git a/backend/src/main/java/com/rit/portal/entity/BusRoute.java b/backend/src/main/java/com/rit/portal/entity/BusRoute.java new file mode 100644 index 0000000..58552ea --- /dev/null +++ b/backend/src/main/java/com/rit/portal/entity/BusRoute.java @@ -0,0 +1,46 @@ +package com.rit.portal.entity; + +import jakarta.persistence.*; +import lombok.*; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Table(name = "bus_routes") +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class BusRoute { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name = "route_number", unique = true, nullable = false) + private String number; + + @Column(name = "route_name", nullable = false) + private String name; + + @Column(name = "start_point", nullable = false) + private String from; + + @Column(name = "end_point", nullable = false) + private String to; + + @Column(name = "departure_time", nullable = false) + private String departureTime; + + @Column(name = "arrival_time", nullable = false) + private String arrivalTime; + + @Column(name = "color_code") + private String color; + + @OneToMany(mappedBy = "route", cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @OrderBy("stopOrder ASC") + @Builder.Default + private List stops = new ArrayList<>(); +} diff --git a/backend/src/main/java/com/rit/portal/entity/BusStop.java b/backend/src/main/java/com/rit/portal/entity/BusStop.java new file mode 100644 index 0000000..a92361f --- /dev/null +++ b/backend/src/main/java/com/rit/portal/entity/BusStop.java @@ -0,0 +1,33 @@ +package com.rit.portal.entity; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Table(name = "bus_stops") +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class BusStop { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "route_id", nullable = false) + @JsonIgnore + private BusRoute route; + + @Column(name = "stop_name", nullable = false) + private String name; + + @Column(name = "arrival_time", nullable = false) + private String time; + + @Column(name = "stop_order", nullable = false) + private Integer stopOrder; +} diff --git a/backend/src/main/java/com/rit/portal/entity/CommunityAnswer.java b/backend/src/main/java/com/rit/portal/entity/CommunityAnswer.java new file mode 100644 index 0000000..2c49cad --- /dev/null +++ b/backend/src/main/java/com/rit/portal/entity/CommunityAnswer.java @@ -0,0 +1,40 @@ +package com.rit.portal.entity; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.persistence.*; +import lombok.*; +import java.time.LocalDateTime; + +@Entity +@Table(name = "community_answers") +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class CommunityAnswer { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "question_id", nullable = false) + @JsonIgnore + private CommunityQuestion question; + + @Column(nullable = false, columnDefinition = "TEXT") + private String body; + + @Column(nullable = false) + private String author; + + @Column(name = "upvotes") + private Integer upvotes = 0; + + @Column(name = "is_accepted") + private Boolean isAccepted = false; + + @Column(name = "created_at") + private LocalDateTime createdAt = LocalDateTime.now(); +} diff --git a/backend/src/main/java/com/rit/portal/entity/CommunityQuestion.java b/backend/src/main/java/com/rit/portal/entity/CommunityQuestion.java new file mode 100644 index 0000000..0bf8012 --- /dev/null +++ b/backend/src/main/java/com/rit/portal/entity/CommunityQuestion.java @@ -0,0 +1,46 @@ +package com.rit.portal.entity; + +import jakarta.persistence.*; +import lombok.*; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Table(name = "community_questions") +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class CommunityQuestion { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(nullable = false) + private String title; + + @Column(nullable = false, columnDefinition = "TEXT") + private String body; + + @Column(nullable = false) + private String author; + + @Column(name = "upvotes") + private Integer upvotes = 0; + + @Column(name = "tags", columnDefinition = "text[]") + private List tags = new ArrayList<>(); + + @Column(name = "is_answered") + private Boolean isAnswered = false; + + @Column(name = "created_at") + private LocalDateTime createdAt = LocalDateTime.now(); + + @OneToMany(mappedBy = "question", cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @Builder.Default + private List answers = new ArrayList<>(); +} diff --git a/backend/src/main/java/com/rit/portal/entity/NotePyq.java b/backend/src/main/java/com/rit/portal/entity/NotePyq.java index d71892b..9fb586a 100644 --- a/backend/src/main/java/com/rit/portal/entity/NotePyq.java +++ b/backend/src/main/java/com/rit/portal/entity/NotePyq.java @@ -15,7 +15,7 @@ public class NotePyq { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + private Integer id; @Column(nullable = false) private String title; diff --git a/backend/src/main/java/com/rit/portal/repository/BusRouteRepository.java b/backend/src/main/java/com/rit/portal/repository/BusRouteRepository.java new file mode 100644 index 0000000..9e9db04 --- /dev/null +++ b/backend/src/main/java/com/rit/portal/repository/BusRouteRepository.java @@ -0,0 +1,10 @@ +package com.rit.portal.repository; + +import com.rit.portal.entity.BusRoute; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface BusRouteRepository extends JpaRepository { + BusRoute findByNumber(String number); +} diff --git a/backend/src/main/java/com/rit/portal/repository/BusStopRepository.java b/backend/src/main/java/com/rit/portal/repository/BusStopRepository.java new file mode 100644 index 0000000..3cb3a9c --- /dev/null +++ b/backend/src/main/java/com/rit/portal/repository/BusStopRepository.java @@ -0,0 +1,9 @@ +package com.rit.portal.repository; + +import com.rit.portal.entity.BusStop; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface BusStopRepository extends JpaRepository { +} diff --git a/backend/src/main/java/com/rit/portal/repository/CommunityAnswerRepository.java b/backend/src/main/java/com/rit/portal/repository/CommunityAnswerRepository.java new file mode 100644 index 0000000..302685f --- /dev/null +++ b/backend/src/main/java/com/rit/portal/repository/CommunityAnswerRepository.java @@ -0,0 +1,9 @@ +package com.rit.portal.repository; + +import com.rit.portal.entity.CommunityAnswer; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface CommunityAnswerRepository extends JpaRepository { +} diff --git a/backend/src/main/java/com/rit/portal/repository/CommunityQuestionRepository.java b/backend/src/main/java/com/rit/portal/repository/CommunityQuestionRepository.java new file mode 100644 index 0000000..72dd96f --- /dev/null +++ b/backend/src/main/java/com/rit/portal/repository/CommunityQuestionRepository.java @@ -0,0 +1,9 @@ +package com.rit.portal.repository; + +import com.rit.portal.entity.CommunityQuestion; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface CommunityQuestionRepository extends JpaRepository { +} diff --git a/backend/src/main/java/com/rit/portal/repository/NotePyqRepository.java b/backend/src/main/java/com/rit/portal/repository/NotePyqRepository.java index 6a9fd1d..c14e7fd 100644 --- a/backend/src/main/java/com/rit/portal/repository/NotePyqRepository.java +++ b/backend/src/main/java/com/rit/portal/repository/NotePyqRepository.java @@ -6,7 +6,7 @@ import org.springframework.stereotype.Repository; import java.util.List; @Repository -public interface NotePyqRepository extends JpaRepository { +public interface NotePyqRepository extends JpaRepository { List findBySemester(Integer semester); List findByDepartment(String department); List findByFileType(String fileType); diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index c24917f..6f2c635 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -1,7 +1,7 @@ # ─── DATABASE CONNECTION CONFIGURATION ─── spring.datasource.url=jdbc:postgresql://localhost:5432/rit_freshers_hub?sslmode=disable spring.datasource.username=postgres -spring.datasource.password=Amudiesh22@. +spring.datasource.password=${DB_PASSWORD:murugan06} # ─── JPA / HIBERNATE SETTINGS ─── spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect diff --git a/backend/src/main/resources/bus_routes.json b/backend/src/main/resources/bus_routes.json new file mode 100644 index 0000000..206abbc --- /dev/null +++ b/backend/src/main/resources/bus_routes.json @@ -0,0 +1,2771 @@ +[ + { + "number": "R01", + "name": "Ennore Route", + "from": "Lift Gate", + "to": "RIT Campus", + "departureTime": "05:50 AM", + "arrivalTime": "07:40 AM", + "color": "#F97316", + "stops": [ + { + "name": "Lift Gate", + "time": "05:50 AM" + }, + { + "name": "Wimco Market", + "time": "05:55 AM" + }, + { + "name": "Ajax", + "time": "06:00 AM" + }, + { + "name": "Periyar Nagar", + "time": "06:03 AM" + }, + { + "name": "Thiruvortiyur Market", + "time": "06:08 AM" + }, + { + "name": "Theradi", + "time": "06:10 AM" + }, + { + "name": "Ellaimman Koil", + "time": "06:12 AM" + }, + { + "name": "Raja Kadai", + "time": "06:14 AM" + }, + { + "name": "Toll Gate", + "time": "06:15 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R01A", + "name": "Tondiarpet Route", + "from": "New vannarpettai", + "to": "RIT Campus", + "departureTime": "06:17 AM", + "arrivalTime": "07:40 AM", + "color": "#3B82F6", + "stops": [ + { + "name": "New vannarpettai", + "time": "06:17 AM" + }, + { + "name": "Apollo", + "time": "06:18 AM" + }, + { + "name": "Tondiarpet", + "time": "06:19 AM" + }, + { + "name": "Maharani", + "time": "06:21 AM" + }, + { + "name": "Mint", + "time": "06:22 AM" + }, + { + "name": "New Bus Stand Mint", + "time": "06:27 AM" + }, + { + "name": "Thirupalli street", + "time": "06:33 AM" + }, + { + "name": "Aminijkarai", + "time": "07:00 AM" + }, + { + "name": "Skywalk", + "time": "07:02 AM" + }, + { + "name": "Arumbakkam", + "time": "07:07 AM" + }, + { + "name": "Koyambedu Metro", + "time": "07:10 AM" + }, + { + "name": "Vengaya mandi", + "time": "07:16 AM" + }, + { + "name": "Ration stop (Nerkundram)", + "time": "07:20 AM" + }, + { + "name": "Maduravoyal", + "time": "07:21 AM" + }, + { + "name": "Maduravoyal Erikarai", + "time": "07:25 AM" + }, + { + "name": "Vanagaram", + "time": "07:29 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R01B", + "name": "Kasimedu Route", + "from": "Kasimedu", + "to": "RIT Campus", + "departureTime": "06:15 AM", + "arrivalTime": "07:40 AM", + "color": "#10B981", + "stops": [ + { + "name": "Kasimedu", + "time": "06:15 AM" + }, + { + "name": "Kalmandapam", + "time": "06:21 AM" + }, + { + "name": "Royapuram Bridge", + "time": "06:27 AM" + }, + { + "name": "Beach Station", + "time": "06:30 AM" + }, + { + "name": "Parry's", + "time": "06:34 AM" + }, + { + "name": "Central", + "time": "06:37 AM" + }, + { + "name": "Egmore", + "time": "06:40 AM" + }, + { + "name": "Dasprakash", + "time": "06:44 AM" + }, + { + "name": "Eaga Theatre", + "time": "06:48 AM" + }, + { + "name": "Amjikarai Market", + "time": "06:51 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R02", + "name": "Triplicane Route", + "from": "Chintadripet (Post Offiec)", + "to": "RIT Campus", + "departureTime": "06:20 AM", + "arrivalTime": "07:40 AM", + "color": "#8B5CF6", + "stops": [ + { + "name": "Chintadripet (Post Offiec)", + "time": "06:20 AM" + }, + { + "name": "D1 Police Station", + "time": "06:25 AM" + }, + { + "name": "Triplicane -High Way", + "time": "06:29 AM" + }, + { + "name": "Ice House Police Station", + "time": "06:32 AM" + }, + { + "name": "Meersahibpet-Market", + "time": "06:35 AM" + }, + { + "name": "Royapettah New College", + "time": "06:39 AM" + }, + { + "name": "Sterling Road (Bharath Petrol Bunk)", + "time": "06:40 AM" + }, + { + "name": "Choolaimedu Subway", + "time": "06:43 AM" + }, + { + "name": "Choolaimedu bus stop", + "time": "06:45 AM" + }, + { + "name": "Anna Arch", + "time": "06:50 AM" + }, + { + "name": "Arumbakkam Panchaliamman Koil", + "time": "06:53 AM" + }, + { + "name": "NSK", + "time": "06:55 AM" + }, + { + "name": "Maduravoyal- Murugan Store", + "time": "06:58 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R03", + "name": "Choolai Route", + "from": "Pulianthope", + "to": "RIT Campus", + "departureTime": "06:20 AM", + "arrivalTime": "07:40 AM", + "color": "#EF4444", + "stops": [ + { + "name": "Pulianthope", + "time": "06:20 AM" + }, + { + "name": "Choolai Post Office", + "time": "06:25 AM" + }, + { + "name": "Purasaivakkam Doveton", + "time": "06:30 AM" + }, + { + "name": "Kellys Signal", + "time": "06:33 AM" + }, + { + "name": "Water tank road signal", + "time": "06:40 AM" + }, + { + "name": "Kilpauk Garden", + "time": "06:45 AM" + }, + { + "name": "Chinthamani", + "time": "06:50 AM" + }, + { + "name": "Anna Nagar Roundtana", + "time": "06:55 AM" + }, + { + "name": "Thirumangalam Blue star", + "time": "06:57 AM" + }, + { + "name": "VR Mall", + "time": "07:00 AM" + }, + { + "name": "Maduravoyal Ration Shop", + "time": "07:10 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R03A", + "name": "Collector Nagar Route", + "from": "Collector nagar", + "to": "RIT Campus", + "departureTime": "06:50 AM", + "arrivalTime": "07:40 AM", + "color": "#EC4899", + "stops": [ + { + "name": "Collector nagar", + "time": "06:50 AM" + }, + { + "name": "Golden flat", + "time": "06:55 AM" + }, + { + "name": "Mogappair West depot", + "time": "07:00 AM" + }, + { + "name": "Nolambur", + "time": "07:03 AM" + }, + { + "name": "MGR University", + "time": "07:08 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R03B", + "name": "Water Tank Route", + "from": "Gangaiamman koil", + "to": "RIT Campus", + "departureTime": "06:40 AM", + "arrivalTime": "07:40 AM", + "color": "#06B6D4", + "stops": [ + { + "name": "Gangaiamman koil", + "time": "06:40 AM" + }, + { + "name": "Madina masjid", + "time": "06:43 AM" + }, + { + "name": "New Avadi Road", + "time": "06:45 AM" + }, + { + "name": "Chintamani", + "time": "06:50 AM" + }, + { + "name": "Nalli Store", + "time": "06:58 AM" + }, + { + "name": "Anna Nagar Metro", + "time": "07:05 AM" + }, + { + "name": "Thirumangalam Metro", + "time": "07:10 AM" + }, + { + "name": "Nerkundram", + "time": "07:15 AM" + }, + { + "name": "Maduravaoyal Ration Shop", + "time": "07:25 AM" + }, + { + "name": "Maduravoyal Erikarai", + "time": "07:27 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R04", + "name": "East Mogappair Route", + "from": "JJ Nagar Police Station", + "to": "RIT Campus", + "departureTime": "06:30 AM", + "arrivalTime": "07:40 AM", + "color": "#F59E0B", + "stops": [ + { + "name": "JJ Nagar Police Station", + "time": "06:30 AM" + }, + { + "name": "HDFC Bank", + "time": "06:32 AM" + }, + { + "name": "IOB Bank", + "time": "06:35 AM" + }, + { + "name": "7 H Bus Depot", + "time": "06:40 AM" + }, + { + "name": "Amutha School", + "time": "06:50 AM" + }, + { + "name": "D.R.Super Market", + "time": "06:52 AM" + }, + { + "name": "Nolambur", + "time": "06:55 AM" + }, + { + "name": "Meadows Apprtment", + "time": "06:57 AM" + }, + { + "name": "MGR University", + "time": "07:00 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R05", + "name": "CIT Nagar Route", + "from": "CIT Nagar", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#14B8A6", + "stops": [ + { + "name": "CIT Nagar", + "time": "06:10 AM" + }, + { + "name": "Aranganathan Subway", + "time": "06:12 AM" + }, + { + "name": "Srinivasa Theatre", + "time": "06:14 AM" + }, + { + "name": "Metupalayam", + "time": "06:16 AM" + }, + { + "name": "Sangamam Hotel", + "time": "06:19 AM" + }, + { + "name": "Aryagowda Road", + "time": "06:24 AM" + }, + { + "name": "Vivek", + "time": "06:29 AM" + }, + { + "name": "Usman Road", + "time": "06:34 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R05A", + "name": "Loyola College Route", + "from": "Loyola College", + "to": "RIT Campus", + "departureTime": "06:40 AM", + "arrivalTime": "07:40 AM", + "color": "#6366F1", + "stops": [ + { + "name": "Loyola College", + "time": "06:40 AM" + }, + { + "name": "Choolaimedu", + "time": "06:45 AM" + }, + { + "name": "Metha Nagar", + "time": "06:49 AM" + }, + { + "name": "NSK Nagar", + "time": "06:55 AM" + }, + { + "name": "Arumbakkam (SBI Bank)", + "time": "07:00 AM" + }, + { + "name": "MMDA Cholan Street", + "time": "07:05 AM" + }, + { + "name": "MMDA Vallavan Hotel", + "time": "07:10 AM" + }, + { + "name": "CMBT (Koyambedu)", + "time": "07:15 AM" + }, + { + "name": "Rohini (Theatre)", + "time": "07:18 AM" + }, + { + "name": "Nerkundram Vengaya Mandi", + "time": "07:22 AM" + }, + { + "name": "Maduravoyal Erikarai", + "time": "07:25 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R06", + "name": "Chinmayanagar Route", + "from": "Chinmaiya Nagar", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#F97316", + "stops": [ + { + "name": "Chinmaiya Nagar", + "time": "06:10 AM" + }, + { + "name": "Sai Nagar", + "time": "06:12 AM" + }, + { + "name": "Natesan Nagar", + "time": "06:13 AM" + }, + { + "name": "Elango Nagar", + "time": "06:14 AM" + }, + { + "name": "Virugampakkam", + "time": "06:17 AM" + }, + { + "name": "KK Nagar", + "time": "06:20 AM" + }, + { + "name": "KK Nagar ESI", + "time": "06:27 AM" + }, + { + "name": "Ashok Pillar", + "time": "06:32 AM" + }, + { + "name": "Kasi Theatre", + "time": "06:37 AM" + }, + { + "name": "Ekkatuthangal", + "time": "06:42 AM" + }, + { + "name": "Olympia", + "time": "06:43 AM" + }, + { + "name": "Porur Saravana Store", + "time": "06:55 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R07", + "name": "Santhome Route", + "from": "Mandaveli Bus Depot", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#3B82F6", + "stops": [ + { + "name": "Mandaveli Bus Depot", + "time": "06:10 AM" + }, + { + "name": "Pattinapakkam", + "time": "06:15 AM" + }, + { + "name": "Kutchery Road", + "time": "06:20 AM" + }, + { + "name": "Luz Corner", + "time": "06:25 AM" + }, + { + "name": "P.S.Sivasamy Road", + "time": "06:27 AM" + }, + { + "name": "SIET College", + "time": "06:32 AM" + }, + { + "name": "Nanthanam Signal", + "time": "06:37 AM" + }, + { + "name": "Saidapet Vetrinary Hospital", + "time": "06:42 AM" + }, + { + "name": "Saidapet Bus Stop", + "time": "06:47 AM" + }, + { + "name": "Guindy", + "time": "06:49 AM" + }, + { + "name": "Butt Road", + "time": "06:55 AM" + }, + { + "name": "Chennai Trade Centre", + "time": "07:10 AM" + }, + { + "name": "Porur", + "time": "07:15 AM" + }, + { + "name": "Ayyapanthangal", + "time": "07:18 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R08", + "name": "Kovilambakkam Route", + "from": "Kovilampakkam", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#10B981", + "stops": [ + { + "name": "Kovilampakkam", + "time": "06:10 AM" + }, + { + "name": "Keelkattalai Bus Stop", + "time": "06:12 AM" + }, + { + "name": "Madipakkam UTI Bank", + "time": "06:15 AM" + }, + { + "name": "Madipakkam Koot Road Bus stop", + "time": "06:16 AM" + }, + { + "name": "Ranga Theatre", + "time": "06:18 AM" + }, + { + "name": "Nanganallur Chidambaram Stores", + "time": "06:10 AM" + }, + { + "name": "Nanganallur Saravana Hotel", + "time": "06:22 AM" + }, + { + "name": "Vanuvampet Church", + "time": "06:25 AM" + }, + { + "name": "Surendhar Nagar Bus Stop", + "time": "06:27 AM" + }, + { + "name": "Jayalakshmi Theatre", + "time": "06:29 AM" + }, + { + "name": "Thillai Ganga Nagar Sub Way", + "time": "06:32 AM" + }, + { + "name": "Aazar Khana Bus Stop", + "time": "06:35 AM" + }, + { + "name": "Butt Road", + "time": "06:37 AM" + }, + { + "name": "Ramavaram", + "time": "06:39 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R08A", + "name": "Adambakkam Route", + "from": "Seasons", + "to": "RIT Campus", + "departureTime": "06:30 AM", + "arrivalTime": "07:40 AM", + "color": "#8B5CF6", + "stops": [ + { + "name": "Seasons", + "time": "06:30 AM" + }, + { + "name": "Kakkan Bridge", + "time": "06:33 AM" + }, + { + "name": "Adambakkam Bus Depot", + "time": "06:35 AM" + }, + { + "name": "St Thomas Mount", + "time": "06:38 AM" + }, + { + "name": "Deepam Foods", + "time": "06:40 AM" + }, + { + "name": "Maharaja traders", + "time": "06:45 AM" + }, + { + "name": "Vanuvampet church", + "time": "06:50 AM" + }, + { + "name": "Thilaiganga nagar subway", + "time": "06:55 AM" + }, + { + "name": "Butt road", + "time": "07:00 AM" + }, + { + "name": "Poonamallee", + "time": "07:35 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R09", + "name": "MKB Nagar Route", + "from": "Vyasarpadi", + "to": "RIT Campus", + "departureTime": "06:00 AM", + "arrivalTime": "07:40 AM", + "color": "#EF4444", + "stops": [ + { + "name": "Vyasarpadi", + "time": "06:00 AM" + }, + { + "name": "MKB Nagar", + "time": "06:05 AM" + }, + { + "name": "E.B. Stop", + "time": "06:08 AM" + }, + { + "name": "Kannadhasan Nagar", + "time": "06:10 AM" + }, + { + "name": "M.R.Nagar", + "time": "06:13 AM" + }, + { + "name": "lakshmi Amman Nagar", + "time": "06:22 AM" + }, + { + "name": "B.B.Road", + "time": "06:26 AM" + }, + { + "name": "Perumbur Market", + "time": "06:34 AM" + }, + { + "name": "Agaram", + "time": "06:40 AM" + }, + { + "name": "Peravalur Road", + "time": "06:42 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R10", + "name": "Thachoor Route", + "from": "Thachoor", + "to": "RIT Campus", + "departureTime": "05:50 AM", + "arrivalTime": "07:40 AM", + "color": "#EC4899", + "stops": [ + { + "name": "Thachoor", + "time": "05:50 AM" + }, + { + "name": "Panjetty", + "time": "05:52 AM" + }, + { + "name": "Janappanchatram Bypass", + "time": "05:55 AM" + }, + { + "name": "Karanodai Bypass", + "time": "05:58 AM" + }, + { + "name": "Vijaya Nallur", + "time": "06:03 AM" + }, + { + "name": "Toll Gate", + "time": "06:05 AM" + }, + { + "name": "Padianallur", + "time": "06:07 AM" + }, + { + "name": "Red Hills (GRT)", + "time": "06:10 AM" + }, + { + "name": "Red Hills Market", + "time": "06:12 AM" + }, + { + "name": "Kavangarai", + "time": "06:15 AM" + }, + { + "name": "Puzhal Jail", + "time": "06:17 AM" + }, + { + "name": "Puzhal Camp", + "time": "06:20 AM" + }, + { + "name": "Velammal college", + "time": "06:25 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R11", + "name": "Chengalpattu Route", + "from": "Chengalpattu Rattinakinaru", + "to": "RIT Campus", + "departureTime": "06:00 AM", + "arrivalTime": "07:40 AM", + "color": "#06B6D4", + "stops": [ + { + "name": "Chengalpattu Rattinakinaru", + "time": "06:00 AM" + }, + { + "name": "New Bus Stand", + "time": "06:02 AM" + }, + { + "name": "Old Bus Stand", + "time": "06:04 AM" + }, + { + "name": "Chengalpattu Bypass", + "time": "06:07 AM" + }, + { + "name": "SP Kovil", + "time": "06:18 AM" + }, + { + "name": "MM Nagar Samiyar Gate", + "time": "06:23 AM" + }, + { + "name": "MM Nagar Bus Stand", + "time": "06:28 AM" + }, + { + "name": "KattanKulathur", + "time": "06:30 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R11A", + "name": "Guduvanchery Route", + "from": "Guduvanchery", + "to": "RIT Campus", + "departureTime": "06:30 AM", + "arrivalTime": "07:40 AM", + "color": "#F59E0B", + "stops": [ + { + "name": "Guduvanchery", + "time": "06:30 AM" + }, + { + "name": "Urapakkam", + "time": "06:35 AM" + }, + { + "name": "Vandalur", + "time": "06:40 AM" + }, + { + "name": "Perungalathur", + "time": "06:45 AM" + }, + { + "name": "Vandalur Bridge", + "time": "06:55 AM" + }, + { + "name": "Mannivakkam", + "time": "07:05 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R12", + "name": "Minjur Route", + "from": "Minjur Bus Stand", + "to": "RIT Campus", + "departureTime": "05:45 AM", + "arrivalTime": "07:40 AM", + "color": "#14B8A6", + "stops": [ + { + "name": "Minjur Bus Stand", + "time": "05:45 AM" + }, + { + "name": "Minjur Railway Station", + "time": "05:50 AM" + }, + { + "name": "BDO Office", + "time": "05:52 AM" + }, + { + "name": "Nandiyambakkam", + "time": "05:54 AM" + }, + { + "name": "Pattamandiri", + "time": "06:00 AM" + }, + { + "name": "Napalayam", + "time": "06:05 AM" + }, + { + "name": "Manali Pudhu nagar", + "time": "06:08 AM" + }, + { + "name": "Manali Market", + "time": "06:15 AM" + }, + { + "name": "MMDA 3rd Main Road", + "time": "06:18 AM" + }, + { + "name": "Mathur", + "time": "06:22 AM" + }, + { + "name": "Veterinary Hospital", + "time": "06:25 AM" + }, + { + "name": "Madhavaram Milk Colony", + "time": "06:28 AM" + }, + { + "name": "Arul Nagar", + "time": "06:30 AM" + }, + { + "name": "Thapalpetti", + "time": "06:32 AM" + }, + { + "name": "Moolakadai", + "time": "06:38 AM" + }, + { + "name": "Kalpana Lamp", + "time": "06:45 AM" + }, + { + "name": "Madhavaram Roundana", + "time": "06:47 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R13", + "name": "Vyasarpadi Route", + "from": "Ganeshapuram", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#6366F1", + "stops": [ + { + "name": "Ganeshapuram", + "time": "06:10 AM" + }, + { + "name": "G3 Police Station", + "time": "06:15 AM" + }, + { + "name": "Pattalam", + "time": "06:18 AM" + }, + { + "name": "Otteri", + "time": "06:20 AM" + }, + { + "name": "Podi Kadai", + "time": "06:23 AM" + }, + { + "name": "T.B.Hospital", + "time": "06:25 AM" + }, + { + "name": "Ayanawaram Signal", + "time": "06:27 AM" + }, + { + "name": "Sayyani", + "time": "06:30 AM" + }, + { + "name": "Ayanawaram Noor Hotel", + "time": "06:33 AM" + }, + { + "name": "Joint Office", + "time": "06:35 AM" + }, + { + "name": "Ayanawaram Railway Quarters", + "time": "06:37 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R13A", + "name": "ICF Route", + "from": "ICF Signal", + "to": "RIT Campus", + "departureTime": "06:45 AM", + "arrivalTime": "07:40 AM", + "color": "#F97316", + "stops": [ + { + "name": "ICF Signal", + "time": "06:45 AM" + }, + { + "name": "Villivakkam Bus Stand", + "time": "06:50 AM" + }, + { + "name": "Korattur Signal", + "time": "06:55 AM" + }, + { + "name": "Nolambur Signal", + "time": "07:05 AM" + }, + { + "name": "Vanagaram", + "time": "07:15 AM" + }, + { + "name": "Velappanchavadi", + "time": "07:23 AM" + }, + { + "name": "Poonamallee Bypass", + "time": "07:30 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R14", + "name": "Thiruvallur Route", + "from": "Sevapetai", + "to": "RIT Campus", + "departureTime": "06:25 AM", + "arrivalTime": "07:40 AM", + "color": "#3B82F6", + "stops": [ + { + "name": "Sevapetai", + "time": "06:25 AM" + }, + { + "name": "Kakkalur", + "time": "06:30 AM" + }, + { + "name": "Poonga Nagar", + "time": "06:35 AM" + }, + { + "name": "GRT", + "time": "06:50 AM" + }, + { + "name": "Manavalanagar Signal", + "time": "06:55 AM" + }, + { + "name": "Manavalanagar Railway Station", + "time": "06:57 AM" + }, + { + "name": "Putlur", + "time": "07:10 AM" + }, + { + "name": "Aranvoyal", + "time": "07:15 AM" + }, + { + "name": "Puthuchatram (India Jappan Company)", + "time": "07:20 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R14B", + "name": "Kakkalur Route", + "from": "Kakkalur Signal", + "to": "RIT Campus", + "departureTime": "06:55 AM", + "arrivalTime": "07:40 AM", + "color": "#10B981", + "stops": [ + { + "name": "Kakkalur Signal", + "time": "06:55 AM" + }, + { + "name": "SBI Bank", + "time": "06:58 AM" + }, + { + "name": "Vellavedu", + "time": "07:20 AM" + }, + { + "name": "Thirumazhisai", + "time": "07:25 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R15", + "name": "Cheyyar Route", + "from": "Cheyyar-SBI", + "to": "RIT Campus", + "departureTime": "05:30 AM", + "arrivalTime": "07:40 AM", + "color": "#8B5CF6", + "stops": [ + { + "name": "Cheyyar-SBI", + "time": "05:30 AM" + }, + { + "name": "Soundarya Theatre", + "time": "05:31 AM" + }, + { + "name": "Mangal X Road", + "time": "05:55 AM" + }, + { + "name": "Ayyangarkulam", + "time": "06:05 AM" + }, + { + "name": "Punjarasanthangal", + "time": "06:07 AM" + }, + { + "name": "Sevlimedu", + "time": "06:07 AM" + }, + { + "name": "Housing Board", + "time": "06:12 AM" + }, + { + "name": "Collector Office", + "time": "06:18 AM" + }, + { + "name": "Mettu street Signal", + "time": "06:20 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R15A", + "name": "Orikkai Route", + "from": "Orikkai", + "to": "RIT Campus", + "departureTime": "06:15 AM", + "arrivalTime": "07:40 AM", + "color": "#EF4444", + "stops": [ + { + "name": "Orikkai", + "time": "06:15 AM" + }, + { + "name": "JJ Nagar", + "time": "06:17 AM" + }, + { + "name": "Keerai Mandapam", + "time": "06:20 AM" + }, + { + "name": "Tollgate", + "time": "06:23 AM" + }, + { + "name": "Pachaiyappa's College", + "time": "06:30 AM" + }, + { + "name": "Ayyampettai", + "time": "06:32 AM" + }, + { + "name": "Rajampettai", + "time": "06:40 AM" + }, + { + "name": "Walajabad", + "time": "06:50 AM" + }, + { + "name": "Natha nallur", + "time": "07:00 AM" + }, + { + "name": "Panrutti", + "time": "07:03 AM" + }, + { + "name": "Oragadam", + "time": "07:12 AM" + }, + { + "name": "Arun Excello", + "time": "07:15 AM" + }, + { + "name": "Sriperumbudur High School", + "time": "07:20 AM" + }, + { + "name": "Sriperumbudur Tollgate", + "time": "07:25 AM" + }, + { + "name": "Irungattukottai bus stand", + "time": "07:30 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R15B", + "name": "Kancheepuram Route", + "from": "Shri Chitragupta Temple", + "to": "RIT Campus", + "departureTime": "06:30 AM", + "arrivalTime": "07:40 AM", + "color": "#EC4899", + "stops": [ + { + "name": "Shri Chitragupta Temple", + "time": "06:30 AM" + }, + { + "name": "Pookadai Chatram", + "time": "06:35 AM" + }, + { + "name": "Kammala street", + "time": "06:38 AM" + }, + { + "name": "Railway Station", + "time": "06:41 AM" + }, + { + "name": "Ponnerikarai", + "time": "06:46 AM" + }, + { + "name": "Senthamangalam", + "time": "07:01 AM" + }, + { + "name": "Santhavellore", + "time": "07:03 AM" + }, + { + "name": "Sunguvarchatram", + "time": "07:05 AM" + }, + { + "name": "Nokia Gate", + "time": "07:10 AM" + }, + { + "name": "Sathya Grand Resorts", + "time": "07:12 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R16", + "name": "Neelangkarai Route", + "from": "Prathana Theatre", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#06B6D4", + "stops": [ + { + "name": "Prathana Theatre", + "time": "06:10 AM" + }, + { + "name": "Vetuvankeni", + "time": "06:15 AM" + }, + { + "name": "Thiruvanmiyur RTO Office", + "time": "06:20 AM" + }, + { + "name": "Adyar Depot", + "time": "06:29 AM" + }, + { + "name": "Madyakailash", + "time": "06:35 AM" + }, + { + "name": "Guindy", + "time": "06:42 AM" + }, + { + "name": "Mugalivakkam", + "time": "06:55 AM" + }, + { + "name": "Karayanchavadi", + "time": "07:10 AM" + }, + { + "name": "Poonamallee Bus Stand", + "time": "07:15 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R16B", + "name": "Sholinganallur Route", + "from": "Sholinganallur", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#F59E0B", + "stops": [ + { + "name": "Sholinganallur", + "time": "06:10 AM" + }, + { + "name": "Karapakkam", + "time": "06:16 AM" + }, + { + "name": "Karapakkam - TCS", + "time": "06:19 AM" + }, + { + "name": "PTC (KFC)", + "time": "06:24 AM" + }, + { + "name": "Mettukuppam", + "time": "06:26 AM" + }, + { + "name": "Medavakkam nilgiris", + "time": "06:35 AM" + }, + { + "name": "Santhoshpuram", + "time": "06:37 AM" + }, + { + "name": "Sembakkam", + "time": "06:40 AM" + }, + { + "name": "Tambaram Railway Station", + "time": "06:45 AM" + }, + { + "name": "Krishna nagar bridge", + "time": "06:48 AM" + }, + { + "name": "Kulakarai street", + "time": "06:50 AM" + }, + { + "name": "Padmavathy Kalyana Mandapam", + "time": "06:55 AM" + }, + { + "name": "Joshua School", + "time": "07:00 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R17", + "name": "Valluvarkottam Route", + "from": "Valluvarkottam", + "to": "RIT Campus", + "departureTime": "06:15 AM", + "arrivalTime": "07:40 AM", + "color": "#14B8A6", + "stops": [ + { + "name": "Valluvarkottam", + "time": "06:15 AM" + }, + { + "name": "Liberty", + "time": "06:20 AM" + }, + { + "name": "Power House", + "time": "06:25 AM" + }, + { + "name": "Lakshman Sruthi", + "time": "06:30 AM" + }, + { + "name": "Thai Sathya", + "time": "06:35 AM" + }, + { + "name": "Virugambakkam", + "time": "06:40 AM" + }, + { + "name": "Alwar Thirunagar", + "time": "06:42 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R17A", + "name": "Valasaravakkam Route", + "from": "Valasaravakkam Shivan Koil", + "to": "RIT Campus", + "departureTime": "06:45 AM", + "arrivalTime": "07:40 AM", + "color": "#6366F1", + "stops": [ + { + "name": "Valasaravakkam Shivan Koil", + "time": "06:45 AM" + }, + { + "name": "Valasaravakkam", + "time": "06:50 AM" + }, + { + "name": "Saravana Bhavan Hotel", + "time": "06:53 AM" + }, + { + "name": "Lakshmi Nagar", + "time": "06:55 AM" + }, + { + "name": "Porur Bridge", + "time": "07:00 AM" + }, + { + "name": "Iyyappanthangal", + "time": "07:05 AM" + }, + { + "name": "Kattupakkam", + "time": "07:10 AM" + }, + { + "name": "Kumanachavadi", + "time": "07:15 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R18", + "name": "Velachery Route", + "from": "Murugan Kalyana mandapam", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#F97316", + "stops": [ + { + "name": "Murugan Kalyana mandapam", + "time": "06:10 AM" + }, + { + "name": "Velachery Bus Stand", + "time": "06:15 AM" + }, + { + "name": "Kaiveli", + "time": "06:18 AM" + }, + { + "name": "Balaji Dental College", + "time": "06:20 AM" + }, + { + "name": "Pallikaranai", + "time": "06:23 AM" + }, + { + "name": "Jeyachandran", + "time": "06:27 AM" + }, + { + "name": "Rajakilpakam Signal", + "time": "06:35 AM" + }, + { + "name": "Camp Road ICICI Bank", + "time": "06:38 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R18A", + "name": "Sembakkam Route", + "from": "Sembakkam", + "to": "RIT Campus", + "departureTime": "06:25 AM", + "arrivalTime": "07:40 AM", + "color": "#3B82F6", + "stops": [ + { + "name": "Sembakkam", + "time": "06:25 AM" + }, + { + "name": "Poondi Bazaar", + "time": "06:45 AM" + }, + { + "name": "Tambaram Sanatorium", + "time": "06:50 AM" + }, + { + "name": "Chrompet", + "time": "06:55 AM" + }, + { + "name": "Nagalkeni (nayara Petrol Bunk)", + "time": "07:00 AM" + }, + { + "name": "Thiruneermalai", + "time": "07:05 AM" + }, + { + "name": "Thirumudivakkam", + "time": "07:10 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R18B", + "name": "Kelambakkam Route", + "from": "Kelambakkam - GH", + "to": "RIT Campus", + "departureTime": "06:00 AM", + "arrivalTime": "07:40 AM", + "color": "#10B981", + "stops": [ + { + "name": "Kelambakkam - GH", + "time": "06:00 AM" + }, + { + "name": "Pudupakkam", + "time": "06:10 AM" + }, + { + "name": "Mambakkam (Samathuvapuram)", + "time": "06:15 AM" + }, + { + "name": "Mambakkam Kulam", + "time": "06:20 AM" + }, + { + "name": "Sithalapakkam", + "time": "06:30 AM" + }, + { + "name": "Medavakkam Koot Road", + "time": "06:40 AM" + }, + { + "name": "Kamarajapuram", + "time": "06:43 AM" + }, + { + "name": "Tambaram Airforce signal", + "time": "06:45 AM" + }, + { + "name": "Krishna nagar", + "time": "06:52 AM" + }, + { + "name": "Bharathi nagar", + "time": "06:54 AM" + }, + { + "name": "old Perungalathur", + "time": "06:57 AM" + }, + { + "name": "mathanapuram", + "time": "07:00 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R19", + "name": "Poombukar Route", + "from": "Poombukar", + "to": "RIT Campus", + "departureTime": "06:10 AM", + "arrivalTime": "07:40 AM", + "color": "#8B5CF6", + "stops": [ + { + "name": "Poombukar", + "time": "06:10 AM" + }, + { + "name": "Ganga Cinima", + "time": "06:25 AM" + }, + { + "name": "Donbosco", + "time": "06:28 AM" + }, + { + "name": "Poombukar", + "time": "06:30 AM" + }, + { + "name": "Korattur Bus Stop", + "time": "06:55 AM" + }, + { + "name": "Padi Britania", + "time": "06:58 AM" + }, + { + "name": "TVS Show Room", + "time": "07:10 AM" + }, + { + "name": "Ambattur", + "time": "07:12 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R19A", + "name": "Vinayagapuram Route", + "from": "Vinayagapuram Bus Stand", + "to": "RIT Campus", + "departureTime": "06:45 AM", + "arrivalTime": "07:40 AM", + "color": "#EF4444", + "stops": [ + { + "name": "Vinayagapuram Bus Stand", + "time": "06:45 AM" + }, + { + "name": "Retteri RTO Office", + "time": "06:55 AM" + }, + { + "name": "Retteri", + "time": "06:58 AM" + }, + { + "name": "Senthil Nagar", + "time": "07:00 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R20", + "name": "Vepampattu Route", + "from": "Vepampattu Railway Station", + "to": "RIT Campus", + "departureTime": "06:30 AM", + "arrivalTime": "07:40 AM", + "color": "#EC4899", + "stops": [ + { + "name": "Vepampattu Railway Station", + "time": "06:30 AM" + }, + { + "name": "Madha Kovil", + "time": "06:32 AM" + }, + { + "name": "Eswar Nagar", + "time": "06:33 AM" + }, + { + "name": "Indian Bank Thiruvninravur", + "time": "06:35 AM" + }, + { + "name": "Thiruninravur Railway Station", + "time": "06:36 AM" + }, + { + "name": "Thiruninravur Bridge", + "time": "06:37 AM" + }, + { + "name": "Jaya College", + "time": "06:39 AM" + }, + { + "name": "Nemilicherri Road", + "time": "06:40 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R20A", + "name": "Pattabiram Route", + "from": "Pattabiram Gandhi Nagar", + "to": "RIT Campus", + "departureTime": "06:45 AM", + "arrivalTime": "07:40 AM", + "color": "#06B6D4", + "stops": [ + { + "name": "Pattabiram Gandhi Nagar", + "time": "06:45 AM" + }, + { + "name": "Pattabiram Vasantha Mandapam", + "time": "06:46 AM" + }, + { + "name": "Sekkadu Bus Stand", + "time": "06:49 AM" + }, + { + "name": "Avadi Ponnu Store", + "time": "06:54 AM" + }, + { + "name": "Avadi J.P.Garden", + "time": "06:56 AM" + }, + { + "name": "Govarthanagiri Bus Stand", + "time": "06:59 AM" + }, + { + "name": "Chennirkuppam", + "time": "07:09 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R21", + "name": "Ayyapakkam Route", + "from": "Ayappakkam Parking", + "to": "RIT Campus", + "departureTime": "06:15 AM", + "arrivalTime": "07:40 AM", + "color": "#F59E0B", + "stops": [ + { + "name": "Ayappakkam Parking", + "time": "06:15 AM" + }, + { + "name": "Ayappakkam SBI ATM", + "time": "06:17 AM" + }, + { + "name": "Ayappakkam Petrol Bunk", + "time": "06:20 AM" + }, + { + "name": "ICF Church", + "time": "06:22 AM" + }, + { + "name": "Canara Bank", + "time": "06:27 AM" + }, + { + "name": "Singapore Shopping", + "time": "06:32 AM" + }, + { + "name": "Senneerkuppam", + "time": "07:05 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R22", + "name": "Thiruthani Route", + "from": "Thiruthani Bypass", + "to": "RIT Campus", + "departureTime": "05:55 AM", + "arrivalTime": "07:40 AM", + "color": "#14B8A6", + "stops": [ + { + "name": "Thiruthani Bypass", + "time": "05:55 AM" + }, + { + "name": "Thiruvallur Bypass X Road", + "time": "06:00 AM" + }, + { + "name": "Nagalamman Nagar", + "time": "06:08 AM" + }, + { + "name": "Krishna Poly", + "time": "06:10 AM" + }, + { + "name": "Jothi Nagar", + "time": "06:12 AM" + }, + { + "name": "Indira Gandhi Nagar", + "time": "06:15 AM" + }, + { + "name": "Swalpetaih", + "time": "06:16 AM" + }, + { + "name": "Government Hospital", + "time": "06:17 AM" + }, + { + "name": "Old Bus stand", + "time": "06:18 AM" + }, + { + "name": "Railway Station", + "time": "06:20 AM" + }, + { + "name": "New Bus Stand", + "time": "06:22 AM" + }, + { + "name": "Navy Gate", + "time": "06:30 AM" + }, + { + "name": "Venkatesapuram", + "time": "06:31 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R22A", + "name": "Sholinghur Route", + "from": "Sholinghur", + "to": "RIT Campus", + "departureTime": "05:35 AM", + "arrivalTime": "07:40 AM", + "color": "#6366F1", + "stops": [ + { + "name": "Sholinghur", + "time": "05:35 AM" + }, + { + "name": "Banavaram koot", + "time": "05:40 AM" + }, + { + "name": "Gudalore", + "time": "05:55 AM" + }, + { + "name": "Salai", + "time": "06:00 AM" + }, + { + "name": "Chitteri", + "time": "06:05 AM" + }, + { + "name": "SR Gate", + "time": "06:25 AM" + }, + { + "name": "Thakkolam Koot Road", + "time": "06:35 AM" + }, + { + "name": "Thakkolam", + "time": "06:40 AM" + }, + { + "name": "Narasimapuram", + "time": "06:55 AM" + }, + { + "name": "Perambakkam", + "time": "07:00 AM" + }, + { + "name": "Koovam Bus Stop", + "time": "07:02 AM" + }, + { + "name": "Valarpuram", + "time": "07:30 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R23", + "name": "K4 Police Station Route", + "from": "Nathamuni Theatre", + "to": "RIT Campus", + "departureTime": "` 6:35 am", + "arrivalTime": "07:40 AM", + "color": "#F97316", + "stops": [ + { + "name": "Nathamuni Theatre", + "time": "` 6:35 am" + }, + { + "name": "K4 Police Station", + "time": "06:40 AM" + }, + { + "name": "Labour officers Quarters", + "time": "06:52 AM" + }, + { + "name": "Vijaya Maruthi (Nuts & Spices)", + "time": "06:44 AM" + }, + { + "name": "Udayam colony", + "time": "06:46 AM" + }, + { + "name": "Kambar Colony", + "time": "06:48 AM" + }, + { + "name": "Anna Nagar West Depot", + "time": "06:50 AM" + }, + { + "name": "Thirumangalam Bridge", + "time": "06:52 AM" + }, + { + "name": "Thirumangalam Waves", + "time": "06:56 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R24", + "name": "Arcot Route", + "from": "Arcot Bus Stand", + "to": "RIT Campus", + "departureTime": "05:25 AM", + "arrivalTime": "07:40 AM", + "color": "#3B82F6", + "stops": [ + { + "name": "Arcot Bus Stand", + "time": "05:25 AM" + }, + { + "name": "Muthukadai", + "time": "05:30 AM" + }, + { + "name": "VC Motor", + "time": "05:33 AM" + }, + { + "name": "Walajapettai", + "time": "05:35 AM" + }, + { + "name": "Arignar Anna Gov College", + "time": "05:37 AM" + }, + { + "name": "Walajapettai Toll gate", + "time": "05:40 AM" + }, + { + "name": "Kaveripakkam", + "time": "05:45 AM" + }, + { + "name": "Perumpullipakkam", + "time": "06:00 AM" + }, + { + "name": "Vinayagapuram (KPM)", + "time": "06:20 AM" + }, + { + "name": "Olimugamathu Pettai(Gori)", + "time": "06:22 AM" + }, + { + "name": "Egambaranathar Koil", + "time": "06:25 AM" + }, + { + "name": "Kachapeswarar Koil", + "time": "06:28 AM" + }, + { + "name": "Pookadai chatram", + "time": "06:32 AM" + }, + { + "name": "Kammal Street", + "time": "06:35 AM" + }, + { + "name": "Indra Nagar (KPM Railwaygate)", + "time": "06:37 AM" + }, + { + "name": "Ponnerikarai", + "time": "06:40 AM" + }, + { + "name": "Santhavellore", + "time": "07:05 AM" + }, + { + "name": "Sungawarchthram", + "time": "07:10 AM" + }, + { + "name": "Vadamangalam", + "time": "07:20 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R25", + "name": "Kallikuppam Route", + "from": "Kallikuppam", + "to": "RIT Campus", + "departureTime": "06:45 AM", + "arrivalTime": "07:40 AM", + "color": "#10B981", + "stops": [ + { + "name": "Kallikuppam", + "time": "06:45 AM" + }, + { + "name": "Stedford Hospital", + "time": "06:50 AM" + }, + { + "name": "Saraswathy Nagar Indian oil petrol bunk", + "time": "06:54 AM" + }, + { + "name": "Manigandapuram", + "time": "06:56 AM" + }, + { + "name": "Thirumullaivoyal Junction", + "time": "06:58 AM" + }, + { + "name": "Vaishnavi Nagar", + "time": "07:00 AM" + }, + { + "name": "Murugappa Polytechnic", + "time": "07:02 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R25A", + "name": "Pudur Route", + "from": "Pudur", + "to": "RIT Campus", + "departureTime": "06:45 AM", + "arrivalTime": "07:40 AM", + "color": "#8B5CF6", + "stops": [ + { + "name": "Pudur", + "time": "06:45 AM" + }, + { + "name": "Oragadam HP Pump", + "time": "06:47 AM" + }, + { + "name": "PTR Mahal", + "time": "06:50 AM" + }, + { + "name": "Ponnu Supermarket", + "time": "06:53 AM" + }, + { + "name": "Govardhanagari", + "time": "07:15 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R26", + "name": "Andarkuppam Route", + "from": "Andarkuppam", + "to": "RIT Campus", + "departureTime": "06:35 AM", + "arrivalTime": "07:40 AM", + "color": "#EF4444", + "stops": [ + { + "name": "Andarkuppam", + "time": "06:35 AM" + }, + { + "name": "Kundrathur", + "time": "06:40 AM" + }, + { + "name": "Kundrathur Thandalam", + "time": "06:43 AM" + }, + { + "name": "Kovur", + "time": "06:45 AM" + }, + { + "name": "Gerugambakkam", + "time": "06:50 AM" + }, + { + "name": "Bai Kadai", + "time": "06:53 AM" + }, + { + "name": "Mathanandapuram", + "time": "06:55 AM" + }, + { + "name": "Venkateswara Nagar", + "time": "06:58 AM" + }, + { + "name": "Porur", + "time": "07:05 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R27", + "name": "Avadi Route", + "from": "Ajeya Stadium", + "to": "RIT Campus", + "departureTime": "06:25 AM", + "arrivalTime": "07:40 AM", + "color": "#EC4899", + "stops": [ + { + "name": "Ajeya Stadium", + "time": "06:25 AM" + }, + { + "name": "HVF", + "time": "06:28 AM" + }, + { + "name": "CRP", + "time": "06:32 AM" + }, + { + "name": "Mitnamalli", + "time": "06:35 AM" + }, + { + "name": "Muthapudupet", + "time": "06:40 AM" + }, + { + "name": "Sasthri Nagar", + "time": "06:45 AM" + }, + { + "name": "Avadi Checkpost", + "time": "06:55 AM" + }, + { + "name": "Rama Rathna Theatre", + "time": "07:06 AM" + }, + { + "name": "Avadi mankoil", + "time": "07:10 AM" + }, + { + "name": "Vasantham Nagar", + "time": "07:12 AM" + }, + { + "name": "Kovarthanagiri", + "time": "07:14 AM" + }, + { + "name": "Kendra vihar", + "time": "07:15 AM" + }, + { + "name": "Kaduveti", + "time": "07:17 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R27A", + "name": "Kollumedu Route", + "from": "Kollumedu", + "to": "RIT Campus", + "departureTime": "06:20 AM", + "arrivalTime": "07:40 AM", + "color": "#06B6D4", + "stops": [ + { + "name": "Kollumedu", + "time": "06:20 AM" + }, + { + "name": "Vel Tech College", + "time": "06:30 AM" + }, + { + "name": "Kovilpathagai", + "time": "06:35 AM" + }, + { + "name": "Ajeya Stadium", + "time": "06:40 AM" + }, + { + "name": "CRPF", + "time": "06:45 AM" + }, + { + "name": "Mittanemili", + "time": "06:50 AM" + }, + { + "name": "Palavedu Service Road", + "time": "07:00 AM" + }, + { + "name": "Nemilichery Tollgate", + "time": "07:05 AM" + }, + { + "name": "Chithukadu Blue", + "time": "07:15 AM" + }, + { + "name": "Panimalar Tollgate", + "time": "07:20 AM" + }, + { + "name": "Chembarambakkam", + "time": "07:27 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R28", + "name": "Agaram Route", + "from": "Agaram", + "to": "RIT Campus", + "departureTime": "06:20 AM", + "arrivalTime": "07:40 AM", + "color": "#F59E0B", + "stops": [ + { + "name": "Agaram", + "time": "06:20 AM" + }, + { + "name": "Periyar Nagar", + "time": "06:22 AM" + }, + { + "name": "Thiruvalluvar Thirumanamandapam", + "time": "06:24 AM" + }, + { + "name": "Permal Koil", + "time": "06:26 AM" + }, + { + "name": "Kamban Nagar", + "time": "06:28 AM" + }, + { + "name": "E.B", + "time": "06:30 AM" + }, + { + "name": "Shanmugam Mahal", + "time": "06:32 AM" + }, + { + "name": "Senthil Nagar", + "time": "06:35 AM" + }, + { + "name": "Thathankuppam", + "time": "06:38 AM" + }, + { + "name": "Kalyan Jewalrs", + "time": "06:45 AM" + }, + { + "name": "Collector Nagar", + "time": "06:47 AM" + }, + { + "name": "Cheriyan Hospital", + "time": "06:48 AM" + }, + { + "name": "Golden Flats", + "time": "06:50 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R29", + "name": "Medavakkam Koot Road Route", + "from": "Vellakal", + "to": "RIT Campus", + "departureTime": "06:20 AM", + "arrivalTime": "07:40 AM", + "color": "#14B8A6", + "stops": [ + { + "name": "Vellakal", + "time": "06:20 AM" + }, + { + "name": "Rajakilpakkam Bus Stand", + "time": "06:30 AM" + }, + { + "name": "Kozhi Pannai", + "time": "06:33 AM" + }, + { + "name": "Bharath College", + "time": "06:40 AM" + }, + { + "name": "Camp Road Singal", + "time": "06:45 AM" + }, + { + "name": "Kishkintha Road", + "time": "06:55 AM" + }, + { + "name": "Erumaiyur", + "time": "07:00 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R29A", + "name": "Pammal Route", + "from": "Pammal", + "to": "RIT Campus", + "departureTime": "06:35 AM", + "arrivalTime": "07:40 AM", + "color": "#6366F1", + "stops": [ + { + "name": "Pammal", + "time": "06:35 AM" + }, + { + "name": "Arunmathi theatre", + "time": "06:37 AM" + }, + { + "name": "Anagaputhur", + "time": "06:39 AM" + }, + { + "name": "Manikandan Nagar", + "time": "06:41 AM" + }, + { + "name": "Karima Nagar", + "time": "06:45 AM" + }, + { + "name": "Kundrathur (theradi)", + "time": "06:48 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + }, + { + "number": "R29B", + "name": "Sivanthangal Route", + "from": "Sivanthangal", + "to": "RIT Campus", + "departureTime": "07:05 AM", + "arrivalTime": "07:40 AM", + "color": "#F97316", + "stops": [ + { + "name": "Sivanthangal", + "time": "07:05 AM" + }, + { + "name": "Muthukumaran College", + "time": "07:10 AM" + }, + { + "name": "Pattu Koot Road", + "time": "07:13 AM" + }, + { + "name": "Mangadu", + "time": "07:15 AM" + }, + { + "name": "Kankaiyamman Kovil", + "time": "07:20 AM" + }, + { + "name": "MGR Nagar", + "time": "07:23 AM" + }, + { + "name": "Kumananchavadi", + "time": "07:25 AM" + }, + { + "name": "Aravind Hospital", + "time": "07:30 AM" + }, + { + "name": "RIT Campus", + "time": "07:40 AM" + } + ] + } +] \ No newline at end of file diff --git a/backend/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/backend/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..b541521 --- /dev/null +++ b/backend/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,14 @@ +com\rit\portal\config\DataInitializer.class +com\rit\portal\entity\CommunityQuestion$CommunityQuestionBuilder.class +com\rit\portal\entity\NotePyq$NotePyqBuilder.class +com\rit\portal\repository\CommunityAnswerRepository.class +com\rit\portal\entity\CommunityAnswer$CommunityAnswerBuilder.class +com\rit\portal\controller\NotePyqController.class +com\rit\portal\entity\CommunityQuestion.class +com\rit\portal\entity\NotePyq.class +com\rit\portal\repository\NotePyqRepository.class +com\rit\portal\entity\CommunityAnswer.class +com\rit\portal\controller\CommunityQuestionController.class +com\rit\portal\repository\CommunityQuestionRepository.class +com\rit\portal\config\WebConfig.class +com\rit\portal\PortalApplication.class diff --git a/backend/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/backend/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..7b9469e --- /dev/null +++ b/backend/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,11 @@ +C:\Users\deves\OneDrive\project_main\Freshers-Hub\backend\src\main\java\com\rit\portal\config\DataInitializer.java +C:\Users\deves\OneDrive\project_main\Freshers-Hub\backend\src\main\java\com\rit\portal\config\WebConfig.java +C:\Users\deves\OneDrive\project_main\Freshers-Hub\backend\src\main\java\com\rit\portal\controller\CommunityQuestionController.java +C:\Users\deves\OneDrive\project_main\Freshers-Hub\backend\src\main\java\com\rit\portal\controller\NotePyqController.java +C:\Users\deves\OneDrive\project_main\Freshers-Hub\backend\src\main\java\com\rit\portal\entity\CommunityAnswer.java +C:\Users\deves\OneDrive\project_main\Freshers-Hub\backend\src\main\java\com\rit\portal\entity\CommunityQuestion.java +C:\Users\deves\OneDrive\project_main\Freshers-Hub\backend\src\main\java\com\rit\portal\entity\NotePyq.java +C:\Users\deves\OneDrive\project_main\Freshers-Hub\backend\src\main\java\com\rit\portal\PortalApplication.java +C:\Users\deves\OneDrive\project_main\Freshers-Hub\backend\src\main\java\com\rit\portal\repository\CommunityAnswerRepository.java +C:\Users\deves\OneDrive\project_main\Freshers-Hub\backend\src\main\java\com\rit\portal\repository\CommunityQuestionRepository.java +C:\Users\deves\OneDrive\project_main\Freshers-Hub\backend\src\main\java\com\rit\portal\repository\NotePyqRepository.java diff --git a/package-lock.json b/package-lock.json index 817e569..c2aab0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -340,9 +340,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -360,9 +357,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -380,9 +374,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -400,9 +391,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -420,9 +408,6 @@ "riscv64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -440,9 +425,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -460,9 +442,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -480,9 +459,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1605,9 +1581,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1625,9 +1598,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1645,9 +1615,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1665,9 +1632,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1685,9 +1649,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1705,9 +1666,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1959,9 +1917,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -1983,9 +1938,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2007,9 +1959,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2031,9 +1980,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2206,9 +2152,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2226,9 +2169,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -2246,9 +2186,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -2266,9 +2203,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -3211,9 +3145,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -3235,9 +3166,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -3259,9 +3187,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -3283,9 +3208,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ diff --git a/public/clubs/artist_league.png b/public/clubs/artist_league.png new file mode 100644 index 0000000..39e387b Binary files /dev/null and b/public/clubs/artist_league.png differ diff --git a/public/clubs/fusion.png b/public/clubs/fusion.png new file mode 100644 index 0000000..2c83a27 Binary files /dev/null and b/public/clubs/fusion.png differ diff --git a/public/clubs/helios.png b/public/clubs/helios.png new file mode 100644 index 0000000..0b55eef Binary files /dev/null and b/public/clubs/helios.png differ diff --git a/public/clubs/infinitus.png b/public/clubs/infinitus.png new file mode 100644 index 0000000..88530d8 Binary files /dev/null and b/public/clubs/infinitus.png differ diff --git a/public/clubs/mediastic.png b/public/clubs/mediastic.png new file mode 100644 index 0000000..c487799 Binary files /dev/null and b/public/clubs/mediastic.png differ diff --git a/public/clubs/nippon.png b/public/clubs/nippon.png new file mode 100644 index 0000000..c0ae165 Binary files /dev/null and b/public/clubs/nippon.png differ diff --git a/public/clubs/nss.png b/public/clubs/nss.png new file mode 100644 index 0000000..2800780 Binary files /dev/null and b/public/clubs/nss.png differ diff --git a/public/clubs/podx.png b/public/clubs/podx.png new file mode 100644 index 0000000..80cf510 Binary files /dev/null and b/public/clubs/podx.png differ diff --git a/public/clubs/rotaract.png b/public/clubs/rotaract.png new file mode 100644 index 0000000..c0d199c Binary files /dev/null and b/public/clubs/rotaract.png differ diff --git a/public/clubs/steam.png b/public/clubs/steam.png new file mode 100644 index 0000000..5d2313d Binary files /dev/null and b/public/clubs/steam.png differ diff --git a/public/clubs/stellar_space_tech.png b/public/clubs/stellar_space_tech.png new file mode 100644 index 0000000..d5e96f6 Binary files /dev/null and b/public/clubs/stellar_space_tech.png differ diff --git a/public/clubs/techspark.png b/public/clubs/techspark.png new file mode 100644 index 0000000..c7df579 Binary files /dev/null and b/public/clubs/techspark.png differ diff --git a/public/clubs/unnat_bharat.png b/public/clubs/unnat_bharat.png new file mode 100644 index 0000000..604b250 Binary files /dev/null and b/public/clubs/unnat_bharat.png differ diff --git a/public/clubs/vaarithi.png b/public/clubs/vaarithi.png new file mode 100644 index 0000000..733b8a0 Binary files /dev/null and b/public/clubs/vaarithi.png differ diff --git a/public/clubs/wec.png b/public/clubs/wec.png new file mode 100644 index 0000000..b723172 Binary files /dev/null and b/public/clubs/wec.png differ diff --git a/public/clubs/wistem.png b/public/clubs/wistem.png new file mode 100644 index 0000000..e890e88 Binary files /dev/null and b/public/clubs/wistem.png differ diff --git a/public/clubs/yuva.png b/public/clubs/yuva.png new file mode 100644 index 0000000..d782f77 Binary files /dev/null and b/public/clubs/yuva.png differ diff --git a/schema.sql b/schema.sql index a0197b2..9bbd096 100644 --- a/schema.sql +++ b/schema.sql @@ -3,7 +3,7 @@ -- 1. Notes & PYQs Module Table CREATE TABLE IF NOT EXISTS notes_pyqs ( - id SERIAL PRIMARY KEY, + id BIGSERIAL PRIMARY KEY, title VARCHAR(255) NOT NULL, subject VARCHAR(250) NOT NULL, department VARCHAR(250) NOT NULL, diff --git a/src/components/FacultyCard/FacultyCard.tsx b/src/components/FacultyCard/FacultyCard.tsx index e29767e..d804758 100644 --- a/src/components/FacultyCard/FacultyCard.tsx +++ b/src/components/FacultyCard/FacultyCard.tsx @@ -1,5 +1,7 @@ -import { motion } from 'framer-motion'; -import { Mail, Phone, Building2, User } from 'lucide-react'; +import { useState } from 'react'; +import { createPortal } from 'react-dom'; +import { motion, AnimatePresence } from 'framer-motion'; +import { Mail, Phone, Building2, User, X, BookOpen, ChevronRight, Monitor, Command, GraduationCap, Briefcase, Microscope, Clock } from 'lucide-react'; import type { Faculty } from '@/types'; interface FacultyCardProps { @@ -16,6 +18,9 @@ const AVATAR_COLORS = [ ]; export default function FacultyCard({ faculty }: FacultyCardProps) { + const [showModal, setShowModal] = useState(false); + const [showEmailOptions, setShowEmailOptions] = useState(false); + const colorIndex = parseInt(faculty.id) % AVATAR_COLORS.length; const [from, to] = AVATAR_COLORS[colorIndex]; const initials = faculty.name @@ -24,73 +29,359 @@ export default function FacultyCard({ faculty }: FacultyCardProps) { .map((n) => n[0]) .join(''); + const mailOptions = [ + { name: 'Default Mail App', url: `mailto:${faculty.email}`, icon: Monitor, color: 'text-gray-700', bg: 'bg-gray-100' }, + { name: 'Gmail', url: `https://mail.google.com/mail/?view=cm&fs=1&to=${faculty.email}`, icon: Mail, color: 'text-red-500', bg: 'bg-red-50' }, + { name: 'Outlook', url: `https://outlook.office.com/mail/deeplink/compose?to=${faculty.email}`, icon: Mail, color: 'text-blue-600', bg: 'bg-blue-50' }, + { name: 'Yahoo Mail', url: `https://compose.mail.yahoo.com/?to=${faculty.email}`, icon: Mail, color: 'text-purple-600', bg: 'bg-purple-50' }, + ]; + return ( - - {/* Avatar + Name */} -
-
- {initials} + <> + + {/* Avatar + Name */} +
+
+
+ {initials} +
+ {/* Online Indicator */} +
+
+
+

+ {faculty.name} +

+

+ {faculty.designation} +

+
-
-

- {faculty.name} -

-

- {faculty.designation} -

-
-
- {/* Details */} -
-
- - {faculty.department} -
- {faculty.office && ( + {/* Details */} +
- - {faculty.office} + + {faculty.department}
- )} - {faculty.specialization && ( -
- {faculty.specialization} -
- )} -
+
- {/* Contact */} -
- - - Email - - {faculty.phone && ( - + + +
+
+ + {/* Profile Modal */} + {createPortal( + + {showModal && ( +
+ setShowModal(false)} + className="absolute inset-0 bg-[#0F172A]/40 backdrop-blur-sm" + /> + + + +
+ {/* LEFT PANEL */} +
+
+
+ {initials} +
+

+ {faculty.name} +

+

+ {faculty.designation} +

+

+ {faculty.department} +

+ +
+ +
+ + + {faculty.phone && ( + +
+ +
+
+

Phone Number

+

{faculty.phone}

+
+
+ )} +
+
+
+ + {/* RIGHT PANEL */} +
+ {/* Section 1: Professional Details */} +
+
+
+ +
+

Professional Details

+
+
+
+

Department

+

{faculty.department}

+
+
+

Specialization

+

{faculty.specialization || 'Not specified'}

+
+
+

Qualification

+

{faculty.qualification || 'Not specified'}

+
+
+

Experience

+

{faculty.experience || 'Not specified'}

+
+ {faculty.joinedInstitution && ( +
+

Joined Institution

+

{faculty.joinedInstitution}

+
+ )} +
+
+ + {/* Section 2: Academic Info */} +
+
+
+ +
+

Academic Information

+
+
+
+

Subjects Handling

+

{faculty.subjectsHandling || 'Not specified'}

+
+
+

Research Areas

+

{faculty.researchAreas || 'Not specified'}

+
+ {faculty.studentsGuided && ( +
+

Students Guided

+
+
+ {faculty.studentsGuided.ug} + UG +
+
+ {faculty.studentsGuided.pg} + PG +
+
+ {faculty.studentsGuided.phd} + Ph.D. +
+
+
+ )} +
+
+ + {/* Section 3: Achievements (Render only if present) */} + {(faculty.achievements || faculty.publications) && ( +
+
+
+ +
+

Achievements

+
+
+ {faculty.achievements && faculty.achievements.length > 0 && ( +
+

Awards & Certifications

+
    + {faculty.achievements.map((ach, i) => ( +
  • {ach}
  • + ))} +
+
+ )} + {faculty.publications && faculty.publications.length > 0 && ( +
+

Recent Publications

+
    + {faculty.publications.map((pub, i) => ( +
  • {pub}
  • + ))} +
+
+ )} +
+
+ )} + + {/* Section 4: Office Info */} +
+
+
+ +
+

Office Information

+
+
+
+ +
+

Office Hours

+

{faculty.officeHours || 'Not specified'}

+
+
+
+ +
+

Office Location

+

{faculty.office || 'Not specified'}

+
+
+
+
+
+
+
+
)} -
- + , + document.body + )} + + {/* Email Options Modal */} + {createPortal( + + {showEmailOptions && ( +
+ setShowEmailOptions(false)} + className="absolute inset-0 bg-[#0F172A]/40 backdrop-blur-sm" + /> + +
+
+

Choose Mail App

+

Compose email to {faculty.name}

+
+ +
+ + +
+
+ )} +
, + document.body + )} + ); } diff --git a/src/components/FeatureCard/FeatureCard.tsx b/src/components/FeatureCard/FeatureCard.tsx index 9f3a887..0867686 100644 --- a/src/components/FeatureCard/FeatureCard.tsx +++ b/src/components/FeatureCard/FeatureCard.tsx @@ -9,7 +9,7 @@ interface FeatureCardProps { } export default function FeatureCard({ feature }: FeatureCardProps) { - const IconComponent = (LucideIcons as Record>)[feature.icon]; + const IconComponent = (LucideIcons as unknown as Record>)[feature.icon]; return ( ('map'); const [searchFaculty, setSearchFaculty] = useState(''); const [selectedDept, setSelectedDept] = useState('All Departments'); + const [sortBy, setSortBy] = useState('Name A-Z'); const [busSearch, setBusSearch] = useState(''); + const [busRoutes, setBusRoutes] = useState([]); + const [loadingBus, setLoadingBus] = useState(true); - const filteredFaculty = FACULTY_DATA.filter((f) => { - const matchSearch = f.name.toLowerCase().includes(searchFaculty.toLowerCase()) || - f.department.toLowerCase().includes(searchFaculty.toLowerCase()); - const matchDept = selectedDept === 'All Departments' || f.department === selectedDept; - return matchSearch && matchDept; - }); + useEffect(() => { + if (activeTab === 'bus' && busRoutes.length === 0) { + setLoadingBus(true); + fetch('http://localhost:8080/api/bus-routes') + .then((res) => { + if (!res.ok) throw new Error('Failed to fetch'); + return res.json(); + }) + .then((data) => { + setBusRoutes(data); + setLoadingBus(false); + }) + .catch((err) => { + console.error('Error fetching bus routes:', err); + setLoadingBus(false); + }); + } + }, [activeTab, busRoutes.length]); - const filteredRoutes = BUS_ROUTES.filter((r) => + const filteredAndSortedFaculty = useMemo(() => { + const filtered = FACULTY_DATA.filter((f) => { + const searchLower = searchFaculty.trim().toLowerCase(); + const matchSearch = + f.name.toLowerCase().includes(searchLower) || + f.department.toLowerCase().includes(searchLower) || + f.designation.toLowerCase().includes(searchLower) || + (f.specialization && f.specialization.toLowerCase().includes(searchLower)); + + const matchDept = selectedDept === 'All Departments' || f.department === selectedDept; + return matchSearch && matchDept; + }); + + return filtered.sort((a, b) => { + if (sortBy === 'Name A-Z') return a.name.localeCompare(b.name); + if (sortBy === 'Department') return a.department.localeCompare(b.department); + if (sortBy === 'Designation') return a.designation.localeCompare(b.designation); + return 0; + }); + }, [searchFaculty, selectedDept, sortBy]); + + const filteredRoutes = busRoutes.filter((r) => r.name.toLowerCase().includes(busSearch.toLowerCase()) || r.from.toLowerCase().includes(busSearch.toLowerCase()) || r.number.toLowerCase().includes(busSearch.toLowerCase()) @@ -36,8 +73,18 @@ export default function Campus() { ]; return ( -
- {/* Header */} +
+ {/* Background decorations for Faculty tab */} + {activeTab === 'faculty' && ( +
+
+
+
+
+
+ )} +
+ {/* Header */}
@@ -61,7 +108,7 @@ export default function Campus() { {/* Tabs */}
{TABS.map((tab) => { - const Icon = (LucideIcons as Record>)[tab.icon]; + const Icon = (LucideIcons as unknown as Record>)[tab.icon]; return (
- - {filteredRoutes.map((route) => ( - - - - ))} - + + {loadingBus ? ( +
+ +

+ Loading live bus routes from RIT Transport... +

+
+ ) : filteredRoutes.length === 0 ? ( +
+

+ No bus routes found matching "{busSearch}" +

+
+ ) : ( + + {filteredRoutes.map((route) => ( + + + + ))} + + )} )} {/* Faculty Tab */} {activeTab === 'faculty' && ( - -
+ + {/* Faculty Hero Section */} +
+
+
+
+ +
+

+ Faculty Directory +

+

+ Browse and connect with experienced faculty members. Search by name, department, or specialization. +

+
+ +
+

Department Overview

+
+ {[ + { abrv: 'CSE', full: 'Computer Science & Engineering', color: 'blue' }, + { abrv: 'CSBS', full: 'Computer Science & Business Systems', color: 'indigo' }, + { abrv: 'AIML', full: 'Artificial Intelligence & Machine Learning', color: 'sky' }, + { abrv: 'ECE', full: 'Electronics & Communication Engineering', color: 'purple' }, + { abrv: 'MECH', full: 'Mechanical Engineering', color: 'orange' }, + { abrv: 'CIVIL', full: 'Civil Engineering', color: 'emerald' }, + { abrv: 'AI & DS', full: 'Artificial Intelligence & Data Science', color: 'pink' }, + { abrv: 'EEE', full: 'Electrical & Electronics Engineering', color: 'yellow' }, + ].map(d => { + const count = FACULTY_DATA.filter(f => f.department === d.full).length; + return ( +
+
+ {d.abrv} + +
+ {count} +
+ ); + })} +
+
+
+ + {/* Search Section */} +
- + setSearchFaculty(e.target.value)} - className="w-full pl-11 pr-4 py-3 rounded-xl border border-[#E5E7EB] bg-white text-sm text-[#1E293B] placeholder-[#94A3B8] focus:outline-none focus:border-[#F97316] transition-colors" + className="w-full pl-12 pr-4 py-3.5 rounded-2xl bg-[#F8FAFC] border-none text-sm text-[#1E293B] placeholder-[#94A3B8] focus:ring-2 focus:ring-[#FF7A00]/20 focus:outline-none transition-all" style={{ fontFamily: 'Inter, sans-serif' }} />
- +
+
+ + +
+
+ + +
+
+
+ + {/* Grid */} + {filteredAndSortedFaculty.length > 0 ? ( + + {filteredAndSortedFaculty.map((faculty) => ( + + + + ))} + + ) : ( +
+ +

No faculty found

+

Try adjusting your search or filters.

+
+ )} + + {/* Bottom Status */} +
+ + 👥 + + Showing {filteredAndSortedFaculty.length} Faculty Members + +
- - {filteredFaculty.map((faculty) => ( - - - - ))} - )}
+
); } diff --git a/src/pages/Community/Community.tsx b/src/pages/Community/Community.tsx index bcfc482..0d712ba 100644 --- a/src/pages/Community/Community.tsx +++ b/src/pages/Community/Community.tsx @@ -1,31 +1,157 @@ -import { useState } from 'react'; +import { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { MessageCircle, Heart, TrendingUp, ThumbsUp, Send, - Shield, Lock, Smile, ChevronRight, Search, Plus + Shield, Lock, Smile, ChevronRight, Search, Plus, User } from 'lucide-react'; import SectionTitle from '@/components/SectionTitle/SectionTitle'; import { StaggerContainer, StaggerItem } from '@/components/AnimatedContainer/AnimatedContainer'; import AnimatedContainer from '@/components/AnimatedContainer/AnimatedContainer'; import { QUESTIONS_DATA, CONFESSIONS_DATA } from '@/constants'; -import { formatDate } from '@/lib/utils'; type Tab = 'qa' | 'confession'; const TRENDING_TAGS = ['hostel', 'academics', 'clubs', 'campus', 'canteen', 'sports', 'placement', 'library']; +const AVATARS: Record = { + 'Priya S.': 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=120&h=120&q=80', + 'Ravi K.': 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?auto=format&fit=crop&w=120&h=120&q=80', + 'Arun M.': 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?auto=format&fit=crop&w=120&h=120&q=80', +}; + +const getAvatar = (author: string) => { + return AVATARS[author] || `https://api.dicebear.com/7.x/initials/svg?seed=${encodeURIComponent(author)}`; +}; + +const getRelativeTime = (dateString: string) => { + if (!dateString) return 'just now'; + + // Normalize microsecond timestamps (e.g. 2026-07-22T13:28:18.174367) to standard millisecond precision + let normalized = dateString; + const dotIndex = dateString.indexOf('.'); + if (dotIndex !== -1) { + const mainPart = dateString.substring(0, dotIndex); + let msPart = dateString.substring(dotIndex + 1); + // Strip any trailing non-digits (like timezone offsets Z or +05:30) for truncation, then keep first 3 digits + const nonDigitMatch = msPart.match(/\D/); + let suffix = ''; + if (nonDigitMatch && nonDigitMatch.index !== undefined) { + suffix = msPart.substring(nonDigitMatch.index); + msPart = msPart.substring(0, nonDigitMatch.index); + } + normalized = `${mainPart}.${msPart.substring(0, 3)}${suffix}`; + } + + const now = new Date().getTime(); // Dynamic local time + const past = new Date(normalized).getTime(); + if (isNaN(past)) return 'just now'; + + const msPerMinute = 60 * 1000; + const msPerHour = msPerMinute * 60; + const msPerDay = msPerHour * 24; + const elapsed = now - past; + + if (elapsed < msPerMinute) { + return 'just now'; + } else if (elapsed < msPerHour) { + return Math.round(elapsed / msPerMinute) + 'm ago'; + } else if (elapsed < msPerDay) { + return Math.round(elapsed / msPerHour) + 'h ago'; + } else { + const days = Math.round(elapsed / msPerDay); + return days === 1 ? 'yesterday' : `${days}d ago`; + } +}; + export default function Community() { + const PAGE_SIZE = 5; + const [activeTab, setActiveTab] = useState('qa'); const [confessionText, setConfessionText] = useState(''); const [questionText, setQuestionText] = useState(''); + const [authorName, setAuthorName] = useState(''); const [confessionPosted, setConfessionPosted] = useState(false); const [searchQuery, setSearchQuery] = useState(''); const [likedIds, setLikedIds] = useState>(new Set()); + const [expandedQuestionIds, setExpandedQuestionIds] = useState>(new Set()); + // Server-side pagination + const [currentPage, setCurrentPage] = useState(0); + const [totalPages, setTotalPages] = useState(1); + const [questions, setQuestions] = useState([]); + const [loading, setLoading] = useState(false); + // Fallback static questions for when backend is unavailable + const [staticQuestions] = useState(QUESTIONS_DATA); - const filteredQuestions = QUESTIONS_DATA.filter((q) => - q.title.toLowerCase().includes(searchQuery.toLowerCase()) || - q.tags.some((t) => t.includes(searchQuery.toLowerCase())) - ); + const toggleAnswers = (id: string) => { + setExpandedQuestionIds((prev) => { + const next = new Set(prev); + if (next.has(id.toString())) { + next.delete(id.toString()); + } else { + next.add(id.toString()); + } + return next; + }); + }; + + const fetchQuestions = async (page = 0) => { + setLoading(true); + try { + const response = await fetch(`http://localhost:8080/api/questions/paged?page=${page}&size=${PAGE_SIZE}`); + if (response.ok) { + const data = await response.json(); + // Spring Page response: { content: [], totalPages, totalElements, number } + setQuestions(data.content || []); + setTotalPages(data.totalPages || 1); + setCurrentPage(data.number ?? page); + } else { + console.error("Failed to fetch questions from backend: HTTP status", response.status); + // Fallback: slice static questions + const start = page * PAGE_SIZE; + setQuestions(staticQuestions.slice(start, start + PAGE_SIZE)); + setTotalPages(Math.ceil(staticQuestions.length / PAGE_SIZE)); + setCurrentPage(page); + } + } catch (error) { + console.error('Backend not available. Falling back to local static questions data.', error); + const start = page * PAGE_SIZE; + setQuestions(staticQuestions.slice(start, start + PAGE_SIZE)); + setTotalPages(Math.ceil(staticQuestions.length / PAGE_SIZE)); + setCurrentPage(page); + } finally { + setLoading(false); + } + }; + + useEffect(() => { + fetchQuestions(0); + }, []); + + const getAnswersCount = (q: any) => { + if (Array.isArray(q.answers)) return q.answers.length; + if (typeof q.answers === 'number') return q.answers; + return 0; + }; + + const getVotesCount = (q: any) => { + const votesVal = typeof q.upvotes === 'number' ? q.upvotes : (typeof q.votes === 'number' ? q.votes : 0); + return votesVal; + }; + + // Client-side filter applied on top of current page (for search within page) + const filteredQuestions = questions.filter((q) => { + const titleVal = q.title || ""; + const tagsVal = q.tags || []; + return titleVal.toLowerCase().includes(searchQuery.toLowerCase()) || + tagsVal.some((t: string) => t.toLowerCase().includes(searchQuery.toLowerCase())); + }); + + const handlePageChange = (newPage: number) => { + setExpandedQuestionIds(new Set()); // collapse any open answers + fetchQuestions(newPage); + // Scroll back to the top of the questions list smoothly + document.getElementById('qa-questions-list')?.scrollIntoView({ behavior: 'smooth', block: 'start' }); + }; const handleConfess = () => { if (!confessionText.trim()) return; @@ -34,34 +160,90 @@ export default function Community() { setTimeout(() => setConfessionPosted(false), 3000); }; - const toggleLike = (id: string) => { + const toggleLike = async (id: string) => { setLikedIds((prev) => { const next = new Set(prev); if (next.has(id)) next.delete(id); else next.add(id); return next; }); + + try { + await fetch(`http://localhost:8080/api/questions/${id}/upvote`, { + method: 'POST' + }); + fetchQuestions(); + } catch (error) { + console.log('Backend not available for upvote sync.', error); + } + }; + + const handlePostQuestion = async () => { + if (!questionText.trim()) return; + + const displayAuthor = authorName.trim() || 'Anonymous'; + + const newQuestion = { + title: questionText.split('\n')[0].substring(0, 100) || "Q&A Question", + body: questionText, + author: displayAuthor, + tags: ['fresher', 'general'], + upvotes: 0, + isAnswered: false, + createdAt: new Date().toISOString(), + answers: [] + }; + + try { + const response = await fetch('http://localhost:8080/api/questions', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + title: newQuestion.title, + body: newQuestion.body, + author: newQuestion.author, + tags: newQuestion.tags + }) + }); + + if (response.ok) { + const saved = await response.json(); + setQuestions(prev => { + // Prepend saved question and filter out duplicate placeholders + const filtered = prev.filter(q => q.id.toString() !== saved.id.toString()); + return [saved, ...filtered]; + }); + setQuestionText(''); + setAuthorName(''); + } else { + setQuestions(prev => [{ ...newQuestion, id: String(Date.now()) }, ...prev]); + setQuestionText(''); + setAuthorName(''); + } + } catch (error) { + console.error("Error saving question:", error); + setQuestions(prev => [{ ...newQuestion, id: String(Date.now()) }, ...prev]); + setQuestionText(''); + setAuthorName(''); + } }; return ( -
+
{/* Header */} -
+
-

- RIT{' '} - - Community - +

+ RIT Community

-

+

Ask questions, share confessions, and connect with fellow RIT students.

-
+
{/* Tabs */} -
+
{[ { id: 'qa' as Tab, label: 'Freshers Q&A', icon: MessageCircle }, { id: 'confession' as Tab, label: 'Confessions', icon: Heart }, @@ -69,19 +251,18 @@ export default function Community() { @@ -93,33 +274,42 @@ export default function Community() { {activeTab === 'qa' && (
{/* Ask Question Box */} -
-

Ask a Question

+
+

Ask a Question