diff --git a/COLLABORATION.md b/COLLABORATION.md index 81dd715..1272563 100644 --- a/COLLABORATION.md +++ b/COLLABORATION.md @@ -15,7 +15,7 @@ Welcome to the team! This guide explains how to get set up, which Git branch you 2. **Select your module's branch**: Find your assigned module below, and check out your branch: ```bash - git checkout feature/ + ``` 3. **Install frontend dependencies**: 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 1576d4b..687c0b6 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 - + - + - + - - - - + + + + 21 + + + 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/config/DataInitializer.java b/backend/src/main/java/com/rit/portal/config/DataInitializer.java index 844a3f0..4a0dd3b 100644 --- a/backend/src/main/java/com/rit/portal/config/DataInitializer.java +++ b/backend/src/main/java/com/rit/portal/config/DataInitializer.java @@ -1,12 +1,21 @@ package com.rit.portal.config; import com.rit.portal.entity.NotePyq; +import com.rit.portal.entity.BusRoute; +import com.rit.portal.entity.BusStop; import com.rit.portal.repository.NotePyqRepository; +import com.rit.portal.repository.BusRouteRepository; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; +import java.io.InputStream; import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; +import java.util.Map; @Component public class DataInitializer implements CommandLineRunner { @@ -14,6 +23,9 @@ public class DataInitializer implements CommandLineRunner { @Autowired private NotePyqRepository noteRepository; + @Autowired + private BusRouteRepository busRouteRepository; + @Override public void run(String... args) throws Exception { if (noteRepository.count() == 0) { @@ -109,5 +121,52 @@ public class DataInitializer implements CommandLineRunner { )); System.out.println("🌱 Database successfully seeded with Notes & PYQs test data!"); } + + // Seed Bus Routes + if (busRouteRepository.count() == 0) { + try { + ObjectMapper mapper = new ObjectMapper(); + InputStream is = getClass().getResourceAsStream("/bus_routes.json"); + if (is != null) { + List> routesList = mapper.readValue(is, new TypeReference>>() {}); + List routesToSave = new ArrayList<>(); + + for (Map routeMap : routesList) { + BusRoute br = BusRoute.builder() + .number((String) routeMap.get("number")) + .name((String) routeMap.get("name")) + .from((String) routeMap.get("from")) + .to((String) routeMap.get("to")) + .departureTime((String) routeMap.get("departureTime")) + .arrivalTime((String) routeMap.get("arrivalTime")) + .color((String) routeMap.get("color")) + .build(); + + List> stopsList = (List>) routeMap.get("stops"); + List stops = new ArrayList<>(); + if (stopsList != null) { + for (int i = 0; i < stopsList.size(); i++) { + Map stopMap = stopsList.get(i); + stops.add(BusStop.builder() + .route(br) + .name(stopMap.get("name")) + .time(stopMap.get("time")) + .stopOrder(i + 1) + .build()); + } + } + br.setStops(stops); + routesToSave.add(br); + } + busRouteRepository.saveAll(routesToSave); + System.out.println("🌱 Database successfully seeded with " + routesToSave.size() + " Bus Routes and stops!"); + } else { + System.err.println("⚠️ Could not find bus_routes.json in resources!"); + } + } catch (Exception e) { + System.err.println("❌ Failed to seed bus routes: " + e.getMessage()); + e.printStackTrace(); + } + } } } 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/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/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/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/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/Events/Events.tsx b/src/pages/Events/Events.tsx index ab524f7..18817af 100644 --- a/src/pages/Events/Events.tsx +++ b/src/pages/Events/Events.tsx @@ -1,18 +1,16 @@ import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; -import { Calendar, MapPin, Clock, Users, ChevronLeft, ChevronRight, Tag, ExternalLink } from 'lucide-react'; +import { + Users, Tag, X, Mail, Phone, UserCheck, GraduationCap, Info, + Atom, Wifi, Printer, Zap, Languages, Calculator, HeartHandshake, + Rocket, Camera, Sparkles, Mic, Target, ArrowRight, RotateCcw, + MessageCircle, ExternalLink, CheckCircle2, Compass, Globe, BookOpen, Heart +} from 'lucide-react'; import SectionTitle from '@/components/SectionTitle/SectionTitle'; import { StaggerContainer, StaggerItem } from '@/components/AnimatedContainer/AnimatedContainer'; import AnimatedContainer from '@/components/AnimatedContainer/AnimatedContainer'; -import { EVENTS_DATA, CLUBS_DATA } from '@/constants'; - -const CATEGORY_COLORS: Record = { - technical: { bg: '#EFF6FF', text: '#3B82F6', border: '#BFDBFE' }, - cultural: { bg: '#FDF2F8', text: '#EC4899', border: '#FBCFE8' }, - sports: { bg: '#ECFDF5', text: '#10B981', border: '#A7F3D0' }, - seminar: { bg: '#FFF7ED', text: '#F97316', border: '#FED7AA' }, - workshop: { bg: '#F5F3FF', text: '#8B5CF6', border: '#DDD6FE' }, -}; +import { CLUBS_DATA } from '@/constants'; +import type { Club } from '@/types'; const CLUB_CATEGORY_COLORS: Record = { Technical: '#3B82F6', @@ -21,21 +19,173 @@ const CLUB_CATEGORY_COLORS: Record = { Creative: '#F59E0B', }; +const CLUB_ICON_MAP: Record> = { + Atom, + Wifi, + Printer, + Zap, + Languages, + Calculator, + HeartHandshake, + Rocket, + Camera, + Sparkles, + Mic, + BookOpen, + Globe, + Users, +}; + +// ─── Inline Brand SVG Icons for Feature 5 ────────────────────────────────────── +const InstagramIcon = ({ className = 'w-4 h-4' }: { className?: string }) => ( + + + + + +); + +const LinkedinIcon = ({ className = 'w-4 h-4' }: { className?: string }) => ( + + + + + +); + +const YoutubeIcon = ({ className = 'w-4 h-4' }: { className?: string }) => ( + + + + +); + +// ─── Quiz Questions Data for Feature 1 (3-Question Matcher) ───────────────────── +const QUIZ_QUESTIONS = [ + { + id: 'interest', + title: '1. What topics or domains are you most interested in?', + options: [ + { label: '🚀 Space Tech, Astronomy & Rocketry', clubIds: ['stellar_space_tech', 'infinitus'] }, + { label: '⚙️ AI Quests, Chip Design, RobochipX & STEM', clubIds: ['steam', 'wistem', 'techspark'] }, + { label: '🎙️ Radio, Podcasting, Storytelling & RJing', clubIds: ['podx', 'mediastic'] }, + { label: '🤝 Community Service, Village Development & NSS Drives', clubIds: ['nss', 'unnat_bharat'] }, + { label: '🎭 Dance, Music, Band & Cultural Arts', clubIds: ['artist_league', 'podx'] }, + { label: '🧮 Fast Calculation, PiDoku, Logic & Mathematics', clubIds: ['infinitus', 'stellar_space_tech'] }, + { label: '✍️ Tamil Literature, Debates & Cultural Heritage', clubIds: ['vaarithi', 'fusion'] }, + { label: '🌸 Japanese Culture, Anime, Manga & Foreign Languages', clubIds: ['nippon', 'fusion'] }, + { label: '📷 Photo/Video Production & Social Media Content', clubIds: ['mediastic', 'helios', 'podx'] }, + ], + }, + { + id: 'skills', + title: '2. What skills do you currently have or want to develop?', + options: [ + { label: '💻 Web3, AI Tools, Circuit Design & Coding Hackathons', clubIds: ['wistem', 'steam', 'techspark'] }, + { label: '🌌 Space Science & Physics Problem Solving', clubIds: ['stellar_space_tech', 'infinitus'] }, + { label: '🎙️ Public Speaking, Interviewing & Voice Recording', clubIds: ['podx', 'mediastic'] }, + { label: '🤝 Social Work, Environmental Protection & Leadership', clubIds: ['nss', 'unnat_bharat'] }, + { label: '🕺 Stage Performance, Singing, Dance & Rap', clubIds: ['artist_league'] }, + { label: '📐 Analytical Thinking, Logic Puzzles & Aptitude', clubIds: ['infinitus'] }, + { label: '📝 Essay Writing, Tamil/English Oratory & Literature', clubIds: ['vaarithi', 'fusion'] }, + { label: '🎥 Camera Operations, Video Editing & Digital Media', clubIds: ['mediastic', 'helios'] }, + ], + }, + { + id: 'goal', + title: '3. What is your main goal for joining a club at RIT?', + options: [ + { label: '🤖 Build hackathon projects, chip designs & STEM innovations', clubIds: ['steam', 'wistem', 'techspark'] }, + { label: '🚀 Work on aerospace tech & scientific projects', clubIds: ['stellar_space_tech', 'infinitus'] }, + { label: '🌟 Share inspiring stories & host campus podcasts', clubIds: ['podx', 'mediastic'] }, + { label: '👥 Drive social change & serve rural communities', clubIds: ['nss', 'unnat_bharat'] }, + { label: '🏆 Perform live at cultural fests & stage shows', clubIds: ['artist_league', 'vaarithi'] }, + { label: '📖 Master new languages & explore world cultures', clubIds: ['nippon', 'fusion', 'vaarithi'] }, + ], + }, +]; + export default function Events() { - const [currentIdx, setCurrentIdx] = useState(0); - const [selectedCategory, setSelectedCategory] = useState('All'); + const [selectedClub, setSelectedClub] = useState(null); - const categories = ['All', 'Technical', 'Cultural', 'Seminar', 'Workshop']; + // ─── Interactive Like / Favorite System State ───────────────────────────── + const [likedClubs, setLikedClubs] = useState>(() => { + try { + const saved = localStorage.getItem('rit_freshers_liked_clubs'); + return saved ? new Set(JSON.parse(saved)) : new Set(['podx', 'stellar_space_tech']); + } catch { + return new Set(['podx', 'stellar_space_tech']); + } + }); - const filteredEvents = EVENTS_DATA.filter((e) => - selectedCategory === 'All' || e.category === selectedCategory.toLowerCase() - ); + const [likesMap, setLikesMap] = useState>(() => { + const initialMap: Record = {}; + CLUBS_DATA.forEach((c, idx) => { + initialMap[c.id] = Math.round(c.members * 0.42) + (idx % 5) * 14 + 35; + }); + return initialMap; + }); - const prev = () => setCurrentIdx((i) => (i === 0 ? EVENTS_DATA.length - 1 : i - 1)); - const next = () => setCurrentIdx((i) => (i === EVENTS_DATA.length - 1 ? 0 : i + 1)); + const toggleLike = (clubId: string) => { + setLikedClubs((prev) => { + const next = new Set(prev); + const isCurrentlyLiked = next.has(clubId); + if (isCurrentlyLiked) { + next.delete(clubId); + setLikesMap((l) => ({ ...l, [clubId]: Math.max(0, (l[clubId] || 1) - 1) })); + } else { + next.add(clubId); + setLikesMap((l) => ({ ...l, [clubId]: (l[clubId] || 0) + 1 })); + } + try { + localStorage.setItem('rit_freshers_liked_clubs', JSON.stringify(Array.from(next))); + } catch {} + return next; + }); + }; - const featured = EVENTS_DATA[currentIdx]; - const featCfg = CATEGORY_COLORS[featured.category] || CATEGORY_COLORS.seminar; + // ─── Club Matcher Quiz State (Feature 1) ───────────────────────────────── + const [isQuizOpen, setIsQuizOpen] = useState(false); + const [quizStep, setQuizStep] = useState(0); + const [selectedAnswers, setSelectedAnswers] = useState([]); + const [quizResults, setQuizResults] = useState<{ club: Club; score: number }[] | null>(null); + + const handleSelectOption = (optionIdx: number) => { + const updated = [...selectedAnswers]; + updated[quizStep] = optionIdx; + setSelectedAnswers(updated); + + if (quizStep < QUIZ_QUESTIONS.length - 1) { + setQuizStep(quizStep + 1); + } else { + calculateQuizResults(updated); + } + }; + + const calculateQuizResults = (answers: number[]) => { + const scoreMap: Record = {}; + CLUBS_DATA.forEach((c) => (scoreMap[c.id] = 0)); + + answers.forEach((ansIdx, qIdx) => { + const option = QUIZ_QUESTIONS[qIdx].options[ansIdx]; + option.clubIds.forEach((clubId, idx) => { + scoreMap[clubId] = (scoreMap[clubId] || 0) + (3 - idx); + }); + }); + + const ranked = CLUBS_DATA.map((club) => ({ + club, + score: scoreMap[club.id] || 0, + })).sort((a, b) => b.score - a.score); + + setQuizResults(ranked.slice(0, 3)); + }; + + const resetQuiz = () => { + setQuizStep(0); + setSelectedAnswers([]); + setQuizResults(null); + }; return (
@@ -43,221 +193,537 @@ export default function Events() {

- Clubs &{' '} + Student{' '} - Events + Clubs

- Discover events, join clubs, and be part of the RIT community. + Explore official RIT student clubs & societies, leadership details, and community links.

-
- {/* Featured Event Carousel */} - +
- -
- - - {/* Image placeholder */} -
-
-
- {featured.category === 'technical' ? '💻' : featured.category === 'cultural' ? '🎭' : featured.category === 'seminar' ? '🎤' : '📅'} -
-
{featured.venue}
-
-
+ {/* ─── Feature 1: "Find My Ideal Club" Banner ────────────────────────── */} + +
+ {/* Background Glow */} +
- {/* Content */} -
-
- - {featured.category} - - - Upcoming - -
+
+
+ + Interactive Club Matcher +
+

+ Not sure which club to join? +

+

+ Take our 3-step AI-powered Club Matcher quiz to get instant recommendations tailored to your interests, skills, and goals! +

+
-

- {featured.title} -

-

- {featured.description} -

- -
- {[ - { icon: Calendar, label: new Date(featured.date).toLocaleDateString('en-IN', { day: 'numeric', month: 'long', year: 'numeric' }) }, - { icon: Clock, label: featured.time }, - { icon: MapPin, label: featured.venue }, - { icon: Users, label: featured.organizer }, - ].map((item, i) => ( -
- - {item.label} -
- ))} -
- -
- - Register Now - - - - More Details - -
-
- - -
- - {/* Carousel Controls */} -
- - {EVENTS_DATA.map((_, i) => ( - + { resetQuiz(); setIsQuizOpen(true); }} + className="relative z-10 px-6 py-3.5 rounded-2xl text-white font-semibold text-sm flex items-center gap-2.5 shadow-lg shrink-0 cursor-pointer" + style={{ background: 'linear-gradient(135deg, #F97316, #FB923C)', fontFamily: 'Poppins, sans-serif' }} + > + + Find My Ideal Club + +
- {/* All Events Grid */} -
-
-

All Events

-
- {categories.map((cat) => ( - - ))} -
-
+ {/* Clubs Directory Section */} + + + {(() => { + const fullGridCount = Math.floor(CLUBS_DATA.length / 3) * 3; + const mainGridClubs = CLUBS_DATA.slice(0, fullGridCount); + const remainingClubs = CLUBS_DATA.slice(fullGridCount); - - {filteredEvents.map((event) => { - const cfg = CATEGORY_COLORS[event.category] || CATEGORY_COLORS.seminar; - return ( - - -
- - {new Date(event.date).toLocaleDateString('en-IN', { day: 'numeric' })} - - - {new Date(event.date).toLocaleDateString('en-IN', { month: 'short' })} - -
-
- - {event.category} - -

{event.title}

-
- {event.time} - {event.venue} -
-
-
-
- ); - })} -
-
+ const renderClubCard = (club: Club) => { + const IconComponent = (club.icon && CLUB_ICON_MAP[club.icon]) || Atom; + const categoryColor = CLUB_CATEGORY_COLORS[club.category] || '#F97316'; + const isLiked = likedClubs.has(club.id); + const likesCount = likesMap[club.id] || 0; - {/* Clubs Section */} - - - {CLUBS_DATA.map((club) => ( - + return ( setSelectedClub(club)} + className="bg-white rounded-2xl border border-[#E5E7EB] p-5 cursor-pointer hover:border-[#F97316] transition-all flex flex-col justify-between h-full group" style={{ boxShadow: '0 2px 15px -3px rgba(0,0,0,0.07)' }} > -
-
- {club.name[0]} -
-
- - {club.members} members +
+ {/* Top Row: Tech Icon / Club Logo & Interactive Heart Like Button */} +
+ {club.logoUrl ? ( +
+ {club.name} +
+ ) : ( +
+ +
+ )} + + {/* Like Button & Members Count */} +
+ { + e.stopPropagation(); + toggleLike(club.id); + }} + className={`flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-semibold transition-all cursor-pointer border ${ + isLiked + ? 'bg-rose-50 border-rose-200 text-rose-600 shadow-2xs' + : 'bg-slate-50 border-slate-200 text-slate-500 hover:border-rose-300 hover:text-rose-500' + }`} + > + + {likesCount} + + +
+ + {club.members} +
+
+ + {/* Club Title & Description */} +

+ {club.name} +

+

{club.description}

-

{club.name}

-

{club.description}

-
- + + {/* Bottom Row: Category Tag & View Details Button */} +
+ {club.category} - Join Club + View Details
- - ))} - + ); + }; + + return ( + + {/* 3-Column Grid for Full Rows */} +
+ {mainGridClubs.map((club) => ( + + {renderClubCard(club)} + + ))} +
+ + {/* Centered Flex Row for Remaining Clubs (WiSTEM & STEAM) */} + {remainingClubs.length > 0 && ( +
+ {remainingClubs.map((club) => ( + + {renderClubCard(club)} + + ))} +
+ )} +
+ ); + })()}
+ + {/* ─── Club Matcher Quiz Modal (Feature 1) ─────────────────────────────── */} + + {isQuizOpen && ( +
+ + {/* Close Button */} + + + {!quizResults ? ( +
+ {/* Quiz Progress */} +
+ Question {quizStep + 1} of {QUIZ_QUESTIONS.length} + Step {quizStep + 1} / {QUIZ_QUESTIONS.length} +
+
+
+
+ + {/* Question Header */} +
+ + Club Matcher Quiz +
+

+ {QUIZ_QUESTIONS[quizStep].title} +

+ + {/* Options List */} +
+ {QUIZ_QUESTIONS[quizStep].options.map((opt, idx) => ( + + ))} +
+ + {quizStep > 0 && ( + + )} +
+ ) : ( + /* Results Screen */ +
+
+
+ +
+

+ Your Ideal Club Matches! +

+

Based on your interests & goals, here are your top recommended RIT clubs:

+
+ + {/* Top 3 Matches */} +
+ {quizResults.map((item, i) => { + const IconComponent = (item.club.icon && CLUB_ICON_MAP[item.club.icon]) || Atom; + const catColor = CLUB_CATEGORY_COLORS[item.club.category] || '#F97316'; + const matchPercent = i === 0 ? '98%' : i === 1 ? '91%' : '84%'; + + return ( +
{ + setIsQuizOpen(false); + setSelectedClub(item.club); + }} + className="p-4 rounded-2xl border border-slate-200 hover:border-[#F97316] bg-slate-50 hover:bg-white cursor-pointer transition-all flex items-center justify-between" + > +
+ {item.club.logoUrl ? ( +
+ {item.club.name} +
+ ) : ( +
+ +
+ )} +
+
+ {item.club.name} + {i === 0 && Top Match 🏆} +
+ {item.club.category} Club • {item.club.members} members +
+
+ + {matchPercent} Match + +
+ ); + })} +
+ +
+ + +
+
+ )} + +
+ )} + + + {/* ─── Club Details Modal (Featuring Feature 5: Social Link Hub) ───────── */} + + {selectedClub && ( +
+ + {/* Close Button */} + + + {/* Modal Header */} + {(() => { + const IconComponent = (selectedClub.icon && CLUB_ICON_MAP[selectedClub.icon]) || Atom; + const categoryColor = CLUB_CATEGORY_COLORS[selectedClub.category] || '#F97316'; + const isLiked = likedClubs.has(selectedClub.id); + const likesCount = likesMap[selectedClub.id] || 0; + + return ( +
+
+ {selectedClub.logoUrl ? ( +
+ {selectedClub.name} +
+ ) : ( +
+ +
+ )} +
+ + {selectedClub.category} + +

+ {selectedClub.name} +

+
+
+ + {/* Interactive Like Button in Modal */} + toggleLike(selectedClub.id)} + className={`px-4 py-2 rounded-xl text-xs font-bold flex items-center gap-2 transition-all cursor-pointer shadow-xs border shrink-0 ${ + isLiked + ? 'bg-rose-500 text-white border-rose-600 shadow-rose-200' + : 'bg-rose-50 text-rose-600 border-rose-200 hover:bg-rose-100' + }`} + > + + {isLiked ? 'Liked' : 'Like Club'} ({likesCount}) + +
+ ); + })()} + + {/* Club Detailed Description */} +
+
+ + About the Club +
+

+ {selectedClub.details || selectedClub.description} +

+
+ + {/* Leadership & Contact Information - Icon Based Color Cards */} +
+ {/* President Card - Indigo Theme */} +
+
+ +
+
+ President / Student Lead + {selectedClub.presidentName || 'Student President'} +
+
+ + {/* Year Card - Purple Theme */} +
+
+ +
+
+ Year & Department + {selectedClub.year || 'Senior Year'} +
+
+ + {/* Email Card - Emerald Theme */} + + + {/* Phone Card - Sky Theme */} +
+
+ +
+
+ Contact Phone + {selectedClub.contactPhone || '+91 98765 43210'} +
+
+
+ + {/* ─── Feature 5: Social & Community Link Hub (Dummy Links) ─────── */} +
+
+
+ + Community & Social Links +
+ ✓ Verified RIT Handle +
+ +
+ {selectedClub.socialLinks?.instagram && ( + + + Instagram + + )} + + {selectedClub.socialLinks?.website && ( + + + Linktree Hub + + )} + + {selectedClub.socialLinks?.linkedin && ( + + + LinkedIn + + )} + + {selectedClub.socialLinks?.whatsapp && ( + + + WhatsApp Group + + )} + + {selectedClub.socialLinks?.youtube && ( + + + YouTube Channel + + )} +
+
+ + {/* Close Button */} +
+ +
+
+
+ )} +
); } diff --git a/src/pages/Home/Home.tsx b/src/pages/Home/Home.tsx index edb4ecd..32b41d8 100644 --- a/src/pages/Home/Home.tsx +++ b/src/pages/Home/Home.tsx @@ -227,11 +227,11 @@ export default function Home() { { icon: 'Map', label: 'Campus Context', desc: 'RIT-specific answers' }, { icon: 'Zap', label: 'Instant Answers', desc: 'No wait time' }, ].map((item, i) => { - const Icon = (LucideIcons as Record>)[item.icon]; + const Icon = (LucideIcons as unknown as Record>)[item.icon]; return (
- {Icon && } + {Icon && }
{item.label}
@@ -331,7 +331,7 @@ export default function Home() { {/* Quick nav buttons */}
{CAMPUS_LOCATIONS.map((loc) => { - const Icon = (LucideIcons as Record>)[loc.icon]; + const Icon = (LucideIcons as unknown as Record>)[loc.icon]; return (
- +
= 2: + stop_name = tds[0].get_text(strip=True) + stop_time = tds[1].get_text(strip=True) + + stop_name = re.sub(r'\s+', ' ', stop_name).strip() + stop_time = re.sub(r'\s+', ' ', stop_time).strip() + + if stop_name and not stop_name.startswith("R-") and not "Boarding" in stop_name: + # Normalize time format + stop_time = stop_time.replace('.', ':') + if ':' in stop_time: + parts = stop_time.split() + time_part = parts[0] + ampm_part = parts[1].upper() if len(parts) > 1 else "AM" + h_m = time_part.split(':') + if len(h_m) == 2: + h, m = h_m[0].strip(), h_m[1].strip() + h = "".join(filter(str.isdigit, h)) + m = "".join(filter(str.isdigit, m)) + if h and m: + h_int = int(h) + h_str = f"{h_int:02d}" + m_str = f"{int(m):02d}" + stop_time = f"{h_str}:{m_str} {ampm_part}" + + stops.append({ + "name": stop_name, + "time": stop_time + }) + + if len(stops) > 0: + from_point = stops[0]['name'] + to_point = stops[-1]['name'] + departure_time = stops[0]['time'] + arrival_time = stops[-1]['time'] + else: + from_point = r['name'] + to_point = "RIT Campus" + departure_time = r['start_time'] + arrival_time = "07:40 AM" + + detailed_routes.append({ + "number": r['number'], + "name": r['name'] + " Route", + "from": from_point, + "to": to_point, + "departureTime": departure_time, + "arrivalTime": arrival_time, + "color": colors[i % len(colors)], + "stops": stops + }) + except Exception as e: + print(f"Error scraping {r['number']}: {e}") + + # Save directly to the backend resources folder + target_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "backend", "src", "main", "resources")) + if not os.path.exists(target_dir): + os.makedirs(target_dir, exist_ok=True) + output_path = os.path.join(target_dir, "bus_routes.json") + + with open(output_path, "w", encoding="utf-8") as f: + json.dump(detailed_routes, f, indent=2) + print(f"Scraping completed. Saved to {output_path}.") + +if __name__ == "__main__": + scrape_routes() diff --git a/test-filter.js b/test-filter.js new file mode 100644 index 0000000..4f0cd9f --- /dev/null +++ b/test-filter.js @@ -0,0 +1,28 @@ +const FACULTY_DATA = [ + { + id: '9', + name: 'Prof. R. Vijayakumar', + designation: 'Assistant Professor', + department: 'Mechanical Engineering', + office: 'MECH Block, Room 102', + specialization: 'CAD/CAM, Robotics', + email: 'vijayakumar@rit.edu', + } +]; + +const searchFaculty = ""; +const selectedDept = "Mechanical Engineering"; + +const filteredFaculty = FACULTY_DATA.filter((f) => { + const searchLower = searchFaculty.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; +}); + +console.log(filteredFaculty); diff --git a/test-render.js b/test-render.js new file mode 100644 index 0000000..31875a0 --- /dev/null +++ b/test-render.js @@ -0,0 +1 @@ +const { FACULTY_DATA } = require('./src/constants/index.ts'); // wait this is TS diff --git a/tsconfig.app.json b/tsconfig.app.json index 33eede1..8366888 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -17,6 +17,7 @@ "jsx": "react-jsx", /* Path aliases */ + "ignoreDeprecations": "6.0", "baseUrl": ".", "paths": { "@/*": ["./src/*"] diff --git a/vite.config.ts b/vite.config.ts index 3571c8c..5ef074a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -9,6 +9,15 @@ export default defineConfig({ react(), tailwindcss(), ], + server: { + watch: { + ignored: [ + '**/backend/**', + '**/telegram-bot/**', + '**/.git/**' + ] + } + }, resolve: { alias: { '@': path.resolve(__dirname, './src'),