diff --git a/Real-Estate-Project/mvnw b/Real-Estate-Project/mvnw new file mode 100644 index 0000000..97347cb --- /dev/null +++ b/Real-Estate-Project/mvnw @@ -0,0 +1,316 @@ +#!/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 +# +# https://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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + 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" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`\\unset -f command; \\command -v java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/Real-Estate-Project/mvnw.cmd b/Real-Estate-Project/mvnw.cmd new file mode 100644 index 0000000..2baaa67 --- /dev/null +++ b/Real-Estate-Project/mvnw.cmd @@ -0,0 +1,188 @@ +@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 https://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 Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/Real-Estate-Project/pom.xml b/Real-Estate-Project/pom.xml new file mode 100644 index 0000000..c0eae4a --- /dev/null +++ b/Real-Estate-Project/pom.xml @@ -0,0 +1,80 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.7.3 + + + com.realEstate + Real-Estate-Project + 0.0.1-SNAPSHOT + war + Real-Estate-Project + Demo project for Spring Boot + + 17 + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + mysql + mysql-connector-java + runtime + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + org.springframework.boot + spring-boot-starter-test + test + + + org.apache.tomcat.embed + tomcat-embed-jasper + provided + + + + javax.servlet + jstl + + + + org.hibernate + hibernate-core + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + \ No newline at end of file diff --git a/Real-Estate-Project/src/main/java/com/realEstate/RealEstateProject/RealEstateProjectApplication.java b/Real-Estate-Project/src/main/java/com/realEstate/RealEstateProject/RealEstateProjectApplication.java new file mode 100644 index 0000000..cd6b601 --- /dev/null +++ b/Real-Estate-Project/src/main/java/com/realEstate/RealEstateProject/RealEstateProjectApplication.java @@ -0,0 +1,15 @@ +package com.realEstate.RealEstateProject; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = "com.realEstate") +public class RealEstateProjectApplication { + + public static void main(String[] args) { + SpringApplication.run(RealEstateProjectApplication.class, args); + } + +} diff --git a/Real-Estate-Project/src/main/java/com/realEstate/RealEstateProject/ServletInitializer.java b/Real-Estate-Project/src/main/java/com/realEstate/RealEstateProject/ServletInitializer.java new file mode 100644 index 0000000..790374a --- /dev/null +++ b/Real-Estate-Project/src/main/java/com/realEstate/RealEstateProject/ServletInitializer.java @@ -0,0 +1,13 @@ +package com.realEstate.RealEstateProject; + +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +public class ServletInitializer extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(RealEstateProjectApplication.class); + } + +} diff --git a/Real-Estate-Project/src/main/java/com/realEstate/config/ApplicationConfig.java b/Real-Estate-Project/src/main/java/com/realEstate/config/ApplicationConfig.java new file mode 100644 index 0000000..d5e1bfe --- /dev/null +++ b/Real-Estate-Project/src/main/java/com/realEstate/config/ApplicationConfig.java @@ -0,0 +1,12 @@ +package com.realEstate.config; + +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; + +@Configuration +@EnableJpaRepositories(basePackages = "com.realEstate.repository") +@EntityScan(basePackages = "com.realEstate.entity") +public class ApplicationConfig { + +} \ No newline at end of file diff --git a/Real-Estate-Project/src/main/java/com/realEstate/controller/RealEstateController.java b/Real-Estate-Project/src/main/java/com/realEstate/controller/RealEstateController.java new file mode 100644 index 0000000..a6ea522 --- /dev/null +++ b/Real-Estate-Project/src/main/java/com/realEstate/controller/RealEstateController.java @@ -0,0 +1,125 @@ +package com.realEstate.controller; + +import java.util.List; + +import javax.servlet.http.HttpSession; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.servlet.ModelAndView; + +import com.realEstate.entity.Agent; +import com.realEstate.entity.Client; +import com.realEstate.entity.Property; +import com.realEstate.service.RealEstateService; + +@Controller +public class RealEstateController { + + @Autowired + RealEstateService realEstateService; + + @GetMapping("/") + public String welcome(Model model, HttpSession session) { + return "index"; + } + + @GetMapping("/signup") + public ModelAndView signUp(Model model, HttpSession session) { + + return new ModelAndView("signup", "client", new Client()); + } + + @PostMapping("/signup") + public String handleSignUp(Model model, HttpSession session, @ModelAttribute("client") Client c1) { + realEstateService.saveClient(c1); + System.out.println(c1); + session.setAttribute("setClient", c1); + model.addAttribute("newClient", c1); + return "thankyouclient"; + } + + @GetMapping("/clientLogin") + public ModelAndView clientLogin(Model model, HttpSession session) { + Client client = (Client) session.getAttribute("setClient"); + if (client != null) { + session.removeAttribute("setClient"); + } + return new ModelAndView("clientLogin", "client", new Client()); + } + + @PostMapping("/clientLogin") + public String handleLogin(Model model, HttpSession session, @ModelAttribute("client") Client c1) { + if (realEstateService.findClient(c1)) { + model.addAttribute("setClient", + realEstateService.getClientByEmailAndPassword(c1.getEmail(), c1.getPassword())); + session.setAttribute("setClient", c1); + return "thankyouclient"; + } else { + model.addAttribute("msg", "Invalid Login, please try again"); + + return "clientLogin"; + } + } + + @GetMapping("/agentLogin") + public ModelAndView agentLogin(Model model) { + + return new ModelAndView("agentLogin", "agent", realEstateService.defaultAgent()); + } + + @PostMapping("/agentLogin") + public String handleLogin(Model model, HttpSession session, @ModelAttribute("agent") Agent a1) { + if (realEstateService.findAgent(a1)) { + model.addAttribute("setAgent", + realEstateService.getAgentByEmailAndPassword(a1.getEmail(), a1.getPassword())); + session.setAttribute("setAgent", a1); + System.out.println(session.getAttribute("setAgent")); + return "thankyouagent"; + } else { + model.addAttribute("msg", "Invalid Login, please try again"); + + return "agentLogin"; + } + } + + @GetMapping("/agentProfile") + public String agentProfile(Model model, HttpSession session) { + Agent current = (Agent) session.getAttribute("setAgent"); + System.out.println("Session: " + current); + model.addAttribute("setAgent", + realEstateService.getAgentByEmailAndPassword(current.getEmail(), current.getPassword())); + return "agentProfile"; + } + + @GetMapping("/clientProfile") + public String clientProfile(Model model, HttpSession session) { + Client current = (Client) session.getAttribute("setClient"); + System.out.println("Session: " + current); + model.addAttribute("setClient", + realEstateService.getClientByEmailAndPassword(current.getEmail(), current.getPassword())); + return "clientProfile"; + } + + @GetMapping("/addhouse") + public String addProperty(Model model, HttpSession session) { + model.addAttribute("property", new Property()); + return "addhouse"; + } + + @PostMapping("/addhouse") + public ModelAndView handedAddedProperty(Model model, @ModelAttribute("property") Property property, + HttpSession session) { + realEstateService.saveProperty(property); + session.getAttribute("setAgent"); + List list = realEstateService.getProperties(); + System.out.println(list); + model.addAttribute("property", list); + System.out.println("PROPERTY ATTRIBUTE: " + model.addAttribute(list)); + return new ModelAndView("agentProfile"); + } +} \ No newline at end of file diff --git a/Real-Estate-Project/src/main/java/com/realEstate/entity/Agent.java b/Real-Estate-Project/src/main/java/com/realEstate/entity/Agent.java new file mode 100644 index 0000000..89643ee --- /dev/null +++ b/Real-Estate-Project/src/main/java/com/realEstate/entity/Agent.java @@ -0,0 +1,106 @@ +package com.realEstate.entity; + +import javax.persistence.*; + +@Entity +@Table(name = "agent") +public class Agent { + @Id + @Column(name = "id") + private Integer id; + + @Column(name = "first_name") + private String firstName; + + @Column(name = "last_name") + private String lastName; + + @Column(name = "agent_phone_number") + private long agentPhoneNum; + + @Column(name = "email") + private String email; + + @Column(name = "password") + private String password; + + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "property_id") + private Property property; + + public Agent() { + } + + public Agent(Integer id, String firstName, String lastName, long agentPhoneNum, String email, String password, Property property) { + super(); + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + this.agentPhoneNum = agentPhoneNum; + this.email = email; + this.password = password; + this.property = property; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public long getAgentPhoneNum() { + return agentPhoneNum; + } + + public void setAgentPhoneNum(long agentPhoneNum) { + this.agentPhoneNum = agentPhoneNum; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Property getProperty() { + return property; + } + + public void setProperty(Property property) { + this.property = property; + } + @Override + public String toString() { + return "Agent [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", agentPhoneNum=" + + agentPhoneNum + ", email=" + email + ", password=" + password + ", property=" + property + "]"; + } + +} \ No newline at end of file diff --git a/Real-Estate-Project/src/main/java/com/realEstate/entity/Client.java b/Real-Estate-Project/src/main/java/com/realEstate/entity/Client.java new file mode 100644 index 0000000..443cd62 --- /dev/null +++ b/Real-Estate-Project/src/main/java/com/realEstate/entity/Client.java @@ -0,0 +1,117 @@ +package com.realEstate.entity; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "client") +public class Client { + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.AUTO) + private Integer id; + + @Column(name = "email") + private String email; + + @Column(name = "first_name") + private String firstName; + + @Column(name = "last_name") + private String lastName; + + @Column(name = "phonenumber") + private long phoneNumber; + + @Column(name = "password") + private String password; + + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "property_id") + private Property property; + + public Client() { + } + + public Client(Integer id, String email, String firstName, String lastName, long phoneNumber, String password, + Property property) { + super(); + this.id = id; + this.email = email; + this.firstName = firstName; + this.lastName = lastName; + this.phoneNumber = phoneNumber; + this.password = password; + this.property = property; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public Long getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(Long phoneNumber) { + this.phoneNumber = phoneNumber; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Property getProperty() { + return property; + } + + public void setProperty(Property property) { + this.property = property; + } + + @Override + public String toString() { + return "Client [id=" + id + ", email=" + email + ", firstName=" + firstName + ", lastName=" + lastName + + ", phoneNumber=" + phoneNumber + ", password=" + password + ", property=" + property + "]"; + } + +} \ No newline at end of file diff --git a/Real-Estate-Project/src/main/java/com/realEstate/entity/Property.java b/Real-Estate-Project/src/main/java/com/realEstate/entity/Property.java new file mode 100644 index 0000000..0fef943 --- /dev/null +++ b/Real-Estate-Project/src/main/java/com/realEstate/entity/Property.java @@ -0,0 +1,151 @@ +package com.realEstate.entity; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name="property") +public class Property { + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.AUTO) + private Integer id; + + @Column(name = "street") + private String street; + + @Column(name = "city") + private String city; + + @Column(name = "state") + private String state; + + @Column(name = "zipcode") + private Integer zip; + + @Column(name = "date_posted") + private Integer datePosted; + + @Column(name = "house_size") + private Integer houseSize; + + @Column(name = "sale_price") + private static Integer salePrice; + + @Column(name = "isListed") + private Boolean isListed; + + public Property(){ + + } + + public Property(Integer id, String street, String city, String state, Integer zip, Integer datePosted, + Integer houseSize, Integer salePrice, Boolean isListed) { + super(); + this.id = id; + this.street = street; + this.city = city; + this.state = state; + this.zip = zip; + this.datePosted = datePosted; + this.houseSize = houseSize; + this.salePrice = salePrice; + this.isListed = isListed; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getStreet() { + return street; + } + + public void setStreet(String street) { + this.street = street; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public Integer getZip() { + return zip; + } + + public void setZip(Integer zip) { + this.zip = zip; + } + + public Integer getDatePosted() { + return datePosted; + } + + public void setDatePosted(Integer datePosted) { + this.datePosted = datePosted; + } + + public Integer getHouseSize() { + return houseSize; + } + + public void setHouseSize(Integer houseSize) { + this.houseSize = houseSize; + } + + public static Integer getSalePrice() { + return salePrice; + } + + public void setSalePrice(Integer salePrice) { + this.salePrice = salePrice; + } + + public Boolean getIsListed() { + return isListed; + } + + public void setIsListed(Boolean isListed) { + this.isListed = isListed; + } + + @Override + public String toString() { + return "Property [id=" + id + ", street=" + street + ", city=" + city + ", state=" + state + ", zip=" + zip + + ", datePosted=" + datePosted + ", houseSize=" + houseSize + ", salePrice=" + salePrice + ", isListed=" + + isListed + "]"; + } + + // UNFINISHED GET AND SET FOR PROPERTY + public void setProperty(Property p1) { + // TODO Auto-generated method stub + + } + + public Object getProperty() { + // TODO Auto-generated method stub + return null; + } + + +} diff --git a/Real-Estate-Project/src/main/java/com/realEstate/repository/AgentRepository.java b/Real-Estate-Project/src/main/java/com/realEstate/repository/AgentRepository.java new file mode 100644 index 0000000..4e29685 --- /dev/null +++ b/Real-Estate-Project/src/main/java/com/realEstate/repository/AgentRepository.java @@ -0,0 +1,12 @@ +package com.realEstate.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import com.realEstate.entity.Agent; + +public interface AgentRepository extends JpaRepository { + + @Query("SELECT a FROM Agent a WHERE a.email=?1 AND a.password=?2") + Agent login(String email, String password); +} diff --git a/Real-Estate-Project/src/main/java/com/realEstate/repository/ClientRepository.java b/Real-Estate-Project/src/main/java/com/realEstate/repository/ClientRepository.java new file mode 100644 index 0000000..e69fc98 --- /dev/null +++ b/Real-Estate-Project/src/main/java/com/realEstate/repository/ClientRepository.java @@ -0,0 +1,15 @@ +package com.realEstate.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import com.realEstate.entity.Client; + +@Repository +public interface ClientRepository extends JpaRepository { + + @Query("SELECT s FROM Client s WHERE s.email=?1 AND s.password=?2") + Client loginClient(String email, String password); + +} diff --git a/Real-Estate-Project/src/main/java/com/realEstate/repository/PropertyRepository.java b/Real-Estate-Project/src/main/java/com/realEstate/repository/PropertyRepository.java new file mode 100644 index 0000000..d2d0f2e --- /dev/null +++ b/Real-Estate-Project/src/main/java/com/realEstate/repository/PropertyRepository.java @@ -0,0 +1,13 @@ +package com.realEstate.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import com.realEstate.entity.Client; +import com.realEstate.entity.Property; + + @Repository + public interface PropertyRepository extends JpaRepository { + +} \ No newline at end of file diff --git a/Real-Estate-Project/src/main/java/com/realEstate/service/RealEstateService.java b/Real-Estate-Project/src/main/java/com/realEstate/service/RealEstateService.java new file mode 100644 index 0000000..76000e9 --- /dev/null +++ b/Real-Estate-Project/src/main/java/com/realEstate/service/RealEstateService.java @@ -0,0 +1,158 @@ +package com.realEstate.service; + +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; + +import javax.annotation.PostConstruct; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.realEstate.entity.Agent; +import com.realEstate.entity.Client; +import com.realEstate.entity.Property; +import com.realEstate.repository.AgentRepository; +import com.realEstate.repository.ClientRepository; +import com.realEstate.repository.PropertyRepository; + +@Service +public class RealEstateService { + + @Autowired + AgentRepository agentRepository; + + @Autowired + ClientRepository clientRepository; + + @Autowired + PropertyRepository propertyRepository; + + private List clients = new LinkedList<>(); + + private List properties = new LinkedList<>(); + + private List agents = new LinkedList<>(); + + + + + @PostConstruct + public Agent defaultAgent() { + + Agent a1 = new Agent(1, "Sarah", "Lawless", 7328567354L, "sarahlawless@claimrealty.com", "lawless", null); + agents.add(a1); + return a1; + + } + + public List getAgents() { + return agents; + } + + public void saveClient(Client c1) { + clientRepository.save(c1); + } + + public List getClients() { + return clientRepository.findAll(); + } + + public void deleteClientById(Integer id) { + clientRepository.deleteById(id); + } + + public void deleteAllClients() { + clientRepository.deleteAll(); + } + + public void saveProperty(Property p1) { + properties.add(p1); + } + + public List getProperties() { + return properties; + } + + + + public Client findClientLogin(String email, String password) { + return clientRepository.loginClient(email, password); + } + + public Agent retrieveAgent(String email, String password) { + return agentRepository.login(email, password); + } + + public boolean findClient(Client c1) { + for (int i = 0; i < clients.size(); i++) { + if (c1.getEmail().equals(clients.get(i).getEmail()) + && c1.getPassword().equals(clients.get(i).getPassword())) { + return true; + } + } + return false; + } + + public boolean findAgent(Agent a1) { + for (int i = 0; i < agents.size(); i++) { + if (a1.getEmail().equals(agents.get(i).getEmail()) + && a1.getPassword().equals(agents.get(i).getPassword())) { + return true; + } + } + return false; + } + + public Client getClientByEmailAndPassword(String email, String password) { + Client found = new Client(); + for (Client temp : clients) { + if (temp.getEmail().equals(email) && temp.getPassword().equals(password)) { + found = temp; + return found; + } + + } + return null; + } + + public Agent getAgentByEmailAndPassword(String email, String password) { + Agent found = new Agent(); + for (Agent temp : agents) { + if (temp.getEmail().equals(email) && temp.getPassword().equals(password)) { + found = temp; + return found; + } + + } + return null; + } + +// GET BY.... + public Optional getPropertyBySize(String size) { + return propertyRepository.findById(size); + } + public Optional getPropertyByCity(String city) { + return propertyRepository.findById(city); + } + public Optional getPropertyByState(String state) { + return propertyRepository.findById(state); + } + public Optional getPropertyByPrice(String price) { + return propertyRepository.findById(price); + } + +// public void propertyDiscount(Property property) { +// Optional found = propertyRepository.findById(property.getDaysListed()); +// if(found.isPresent() ) { +// Property edit = new Property(); +// edit.setSalePrice(Property.getSalePrice()); +// Property p1 = new Property(((Property) property.getProperty()).getSalePrice()); +// edit.setProperty(p1); +// propertyRepository.deleteById(found.get().getDaysListed()); +// propertyRepository.save(edit); +// } +//} +} + + diff --git a/Real-Estate-Project/src/main/resources/application.properties b/Real-Estate-Project/src/main/resources/application.properties new file mode 100644 index 0000000..664d43a --- /dev/null +++ b/Real-Estate-Project/src/main/resources/application.properties @@ -0,0 +1,26 @@ + +spring.mvc.view.prefix: /WEB-INF/jsp/ +spring.mvc.view.suffix: .jsp + +# DataSource settings: set here your own configurations for the database +# connection. + + spring.datasource.url=jdbc:mysql://localhost:3306/real_estate_db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC + + spring.datasource.username = root + spring.datasource.password = password + +# Show or not log for each sql query + spring.jpa.show-sql = true + +# Hibernate ddl auto (create, create-drop, update) + spring.jpa.hibernate.ddl-auto = update + +# Naming strategy +spring.jpa.hibernate.naming-strategy= org.hibernate.cfg.ImprovedNamingStrategy + +# Use spring.jpa.properties.* for Hibernate native properties (the prefix is +# stripped before adding them to the entity manager) + +# The SQL dialect makes Hibernate generate better SQL for the chosen database + spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect \ No newline at end of file diff --git a/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/addhouse.jsp b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/addhouse.jsp new file mode 100644 index 0000000..0c81996 --- /dev/null +++ b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/addhouse.jsp @@ -0,0 +1,107 @@ +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +House Details + + + + + + + + + + + + + + +
+

Add New Property

+
+
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+
+ + +
+ Select Image : + + + + + +
+
+
+ +
+ +
+ + + + \ No newline at end of file diff --git a/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/agentLogin.jsp b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/agentLogin.jsp new file mode 100644 index 0000000..3133e28 --- /dev/null +++ b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/agentLogin.jsp @@ -0,0 +1,93 @@ +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Agent Portal + + + + + + + + + + + + + + +
+
+
+

Claim's Real Estate Site.

+ +
+
+ +
+ + + + +

${msg}

+ +
+ + +
+ +
+
+ + +
+
+ + + +
+ + +
+ +
+
+

+ A David Tsacnaris Works +

+
+
+
+ + + + + + diff --git a/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/agentProfile.jsp b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/agentProfile.jsp new file mode 100644 index 0000000..4b13bf6 --- /dev/null +++ b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/agentProfile.jsp @@ -0,0 +1,79 @@ +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + +${setAgent.firstName}'s Profile + + + + + + + + + + + + + + +
+
+
+

Claim's Real Estate Site.

+ +
+
+ +
+
+ Person Name +
${setAgent.firstName} + ${setAgent.lastName}
+ Email + +
${setAgent.email}
+ +
+
+
+ +
+
+

A David Tsacnaris Works

+
+
+
+ + + + + + diff --git a/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/clientLogin.jsp b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/clientLogin.jsp new file mode 100644 index 0000000..a04cf2d --- /dev/null +++ b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/clientLogin.jsp @@ -0,0 +1,92 @@ +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Client Portal + + + + + + + + + + + + + + +
+
+
+

Claim's Real Estate Site.

+ +
+
+ +
+ + + + +

${msg}

+ +
+ + +
+ +
+
+ + +
+
+ + + +
+ + +
+ +
+
+

A David Tsacnaris Works

+
+
+
+ + + + + + diff --git a/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/clientProfile.jsp b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/clientProfile.jsp new file mode 100644 index 0000000..aeb84b4 --- /dev/null +++ b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/clientProfile.jsp @@ -0,0 +1,129 @@ +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +${setClient.firstName}'s Profile + + + + + + + + + + + + + + +
+
+
+

Claim's Real Estate Site.

+ +
+
+ +
+
+ Person Name +
${setClient.firstName} + ${setClient.lastName}
+ Email + +
${setClient.email}
+ Phone Number +
${setClient.phoneNumber}
+
+
+ +
+ +

${setClient.firstName}'s Purchased Houses

+ + + + + + + + + + + + + + + + + + + +
Course IDCourse NameProfessorStart DateStart Time
+
+

Available Houses

+ + + + + + + + + + + + + + + + + + + + +
Course IDLogoCourse NameStart DateActions
logo goes here
+
+
+ + +
+
+

A David Tsacnaris Works

+
+
+
+ + + + + + diff --git a/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/index.jsp b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/index.jsp new file mode 100644 index 0000000..e52f593 --- /dev/null +++ b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/index.jsp @@ -0,0 +1,33 @@ + +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + + + + + + The Best Real Estate Project + + +
+ +
+ + + diff --git a/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/signup.jsp b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/signup.jsp new file mode 100644 index 0000000..05ddc6a --- /dev/null +++ b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/signup.jsp @@ -0,0 +1,78 @@ +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +The Best Real Estate Project + + + + + + +
+ +
+ + + +
+
Client Registration
+
+ +
+
+ First Name + +
+
+ Last Name + +
+ +
+ Email + +
+ + + + +
+ Password + +
+
+
+ +
+ +
+
+

A Claim Academy Product

+
+
+
+ + + diff --git a/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/thankyouagent.jsp b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/thankyouagent.jsp new file mode 100644 index 0000000..8327d41 --- /dev/null +++ b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/thankyouagent.jsp @@ -0,0 +1,74 @@ +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Agent Portal + + + + + + + + + + + + + + +
+
+
+

Claim's Real Estate Site.

+ +
+
+ +
+

Agent Profile.

+

Thank you ${newAgent.firstName} + ${newAgent.lastName}. Welcome back!

+ +

+ Profile +

+
+ +
+
+

+ A David Tsacnaris Works +

+
+
+
+ + + + + + + diff --git a/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/thankyouclient.jsp b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/thankyouclient.jsp new file mode 100644 index 0000000..443f656 --- /dev/null +++ b/Real-Estate-Project/src/main/webapp/WEB-INF/jsp/thankyouclient.jsp @@ -0,0 +1,75 @@ +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Thank you ${newClient.firstName} + + + + + + + + + + + + + + +
+
+
+

Claim's Real Estate Site.

+ +
+
+ +
+

THANK YOU!

+

Thank you ${newClient.firstName} + ${newClient.lastName} for being a part of Claim Realty.

+

You can sign into your account with email + ${newClient.email}.

+

+ Profile +

+
+ +
+
+

+ A David Tsacnaris Works +

+
+
+
+ + + + + + + diff --git a/Real-Estate-Project/src/main/webapp/assets/css/realEstateStyle.css b/Real-Estate-Project/src/main/webapp/assets/css/realEstateStyle.css new file mode 100644 index 0000000..1cf6680 --- /dev/null +++ b/Real-Estate-Project/src/main/webapp/assets/css/realEstateStyle.css @@ -0,0 +1,69 @@ +*{ + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: 'Josefin Sans', sans-serif; +} +.hero{ + display: flex; + height: 100vh; + width: 100%; + background: URL(/assets/images/realestatebackground.jpg); + background-size: cover; + background-position: center; +} +nav{ + display: flex !important; + justify-content: space-between; + padding-top: 40px; + padding-left: 10%; + padding-right: 10%; +} +.logo{ + color: white; + font-size: 28px; +} +span{ + color: #f0d3ca; +} +nav ul li{ + align-items: center; + list-style-type: none; + display: inline-block; + padding: 10px 20px; +} +nav ul li a{ + color: black; + text-decoration: none; + font-weight: bold; +} +nav ul li a:hover{ + color: #f0d3ca; + transition: 0.3s; +} +button{ + height: 60px; + border: none; + background: #f0d3ca; + padding: 12px 30px; + border-radius: 30px; + color: black; + font-weight: bold; + font-size: 15px; + transition: 0.4s; +} +button:hover{ + transform: scale(1.3); + cursor: pointer; +} +label{ + display: flex; + float: left; + clear: left; + width: 250px; + text-align: right; +} +input { + display: flex; + float: left; +} diff --git a/Real-Estate-Project/src/main/webapp/assets/css/signup.css b/Real-Estate-Project/src/main/webapp/assets/css/signup.css new file mode 100644 index 0000000..2ea69f0 --- /dev/null +++ b/Real-Estate-Project/src/main/webapp/assets/css/signup.css @@ -0,0 +1,199 @@ +@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap'); + + +nav{ + display: flex; + align-items: center; + justify-content: space-between; + +} +.logo{ + color: white; + font-size: 28px; +} +span{ + color: #f0d3ca; +} +nav ul li{ + list-style-type: none; + display: inline-block; + padding: 10px 20px; +} +nav ul li a{ + color: black; + text-decoration: none; + font-weight: bold; +} +nav ul li a:hover{ + color: #f0d3ca; + transition: 0.3s; +} +button{ + border: none; + background: #f0d3ca; + padding: 12px 30px; + border-radius: 30px; + color: black; + font-weight: bold; + font-size: 15px; + transition: 0.4s; +} +button:hover{ + transform: scale(1.3); + cursor: pointer; +} +label{ + display: flex; + float: left; + clear: left; + width: 250px; + text-align: right; +} +input { + display: flex; + float: left; +} +*{ + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Poppins',sans-serif; +} +body{ + background: URL(/assets/images/realestatebackground.jpg); + background-size: cover; + background-position: center; + height: 100vh; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + padding: 10px; + +} +.container{ + max-width: 700px; + width: 100%; + background-color: rgba(0,0,0, 0.5); + padding: 25px 30px; + border-radius: 5px; + box-shadow: 0 5px 10px rgba(0,0,0,0.15); +} +.container .title{ + font-size: 25px; + font-weight: 500; + position: relative; +} +.container .title::before{ + content: ""; + position: absolute; + left: 0; + bottom: 0; + height: 3px; + width: 30px; + border-radius: 5px; + background: black; +} +.content form .user-details{ + display: flex; + flex-wrap: wrap; + justify-content: space-between; + margin: 20px 0 12px 0; +} +form .user-details .input-box{ + margin-bottom: 15px; + width: calc(100% / 2 - 20px); +} +form .input-box span.details{ + display: block; + font-weight: 500; + margin-bottom: 5px; +} +.user-details .input-box input{ + height: 45px; + width: 100%; + outline: none; + font-size: 16px; + border-radius: 5px; + padding-left: 15px; + border: 1px solid #ccc; + border-bottom-width: 2px; + transition: all 0.3s ease; +} +.user-details .input-box input:focus, +.user-details .input-box input:valid{ + border-color: black; +} + + form .category{ + display: flex; + width: 80%; + margin: 14px 0 ; + justify-content: space-between; + } + form .category label{ + display: flex; + align-items: center; + cursor: pointer; + } + form .category label .dot{ + height: 18px; + width: 18px; + border-radius: 50%; + margin-right: 10px; + background: #d9d9d9; + border: 5px solid transparent; + transition: all 0.3s ease; +} + + form input[type="radio"]{ + display: none; + } + form .button{ + height: 45px; + margin: 35px 0 + } + form .button input{ + height: 100%; + width: 100%; + border-radius: 5px; + border: none; + color: #ffffff; + font-size: 18px; + font-weight: 500; + letter-spacing: 1px; + cursor: pointer; + transition: all 0.3s ease; + background: black; + } + form .button input:hover{ + /* transform: scale(0.99); */ + background: black; + } + @media(max-width: 584px){ + .container{ + max-width: 100%; +} +form .user-details .input-box{ + margin-bottom: 15px; + width: 100%; + } + form .category{ + width: 100%; + } + .content form .user-details{ + max-height: 300px; + overflow-y: scroll; + } + .user-details::-webkit-scrollbar{ + width: 5px; + } + } + @media(max-width: 459px){ + .container .content .category{ + flex-direction: column; + } +} +.title{ + color:#f0d3ca; +} \ No newline at end of file diff --git a/Real-Estate-Project/src/main/webapp/assets/images/charlie.jpg b/Real-Estate-Project/src/main/webapp/assets/images/charlie.jpg new file mode 100644 index 0000000..e8c7127 Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/charlie.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/danny.png b/Real-Estate-Project/src/main/webapp/assets/images/danny.png new file mode 100644 index 0000000..a3f2092 Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/danny.png differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house1.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house1.jpg new file mode 100644 index 0000000..8739b63 Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house1.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house10.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house10.jpg new file mode 100644 index 0000000..c98fefc Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house10.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house11.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house11.jpg new file mode 100644 index 0000000..1699623 Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house11.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house12.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house12.jpg new file mode 100644 index 0000000..644c727 Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house12.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house13.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house13.jpg new file mode 100644 index 0000000..ffde82b Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house13.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house14.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house14.jpg new file mode 100644 index 0000000..072dcb3 Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house14.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house15.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house15.jpg new file mode 100644 index 0000000..c74855c Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house15.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house2.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house2.jpg new file mode 100644 index 0000000..e783407 Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house2.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house3.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house3.jpg new file mode 100644 index 0000000..5d18e6a Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house3.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house4.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house4.jpg new file mode 100644 index 0000000..4ceb63b Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house4.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house5.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house5.jpg new file mode 100644 index 0000000..47f1887 Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house5.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house6.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house6.jpg new file mode 100644 index 0000000..4318c87 Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house6.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house7.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house7.jpg new file mode 100644 index 0000000..79ab6ac Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house7.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house8.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house8.jpg new file mode 100644 index 0000000..c0ef86f Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house8.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/house9.jpg b/Real-Estate-Project/src/main/webapp/assets/images/house9.jpg new file mode 100644 index 0000000..02d2eaf Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/house9.jpg differ diff --git a/Real-Estate-Project/src/main/webapp/assets/images/realestatebackground.jpg b/Real-Estate-Project/src/main/webapp/assets/images/realestatebackground.jpg new file mode 100644 index 0000000..0abfc92 Binary files /dev/null and b/Real-Estate-Project/src/main/webapp/assets/images/realestatebackground.jpg differ diff --git a/Real-Estate-Project/src/test/java/com/realEstate/RealEstateProject/RealEstateProjectApplicationTests.java b/Real-Estate-Project/src/test/java/com/realEstate/RealEstateProject/RealEstateProjectApplicationTests.java new file mode 100644 index 0000000..27ae626 --- /dev/null +++ b/Real-Estate-Project/src/test/java/com/realEstate/RealEstateProject/RealEstateProjectApplicationTests.java @@ -0,0 +1,13 @@ +package com.realEstate.RealEstateProject; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class RealEstateProjectApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/Real-Estate-Project/target/classes/application.properties b/Real-Estate-Project/target/classes/application.properties new file mode 100644 index 0000000..664d43a --- /dev/null +++ b/Real-Estate-Project/target/classes/application.properties @@ -0,0 +1,26 @@ + +spring.mvc.view.prefix: /WEB-INF/jsp/ +spring.mvc.view.suffix: .jsp + +# DataSource settings: set here your own configurations for the database +# connection. + + spring.datasource.url=jdbc:mysql://localhost:3306/real_estate_db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC + + spring.datasource.username = root + spring.datasource.password = password + +# Show or not log for each sql query + spring.jpa.show-sql = true + +# Hibernate ddl auto (create, create-drop, update) + spring.jpa.hibernate.ddl-auto = update + +# Naming strategy +spring.jpa.hibernate.naming-strategy= org.hibernate.cfg.ImprovedNamingStrategy + +# Use spring.jpa.properties.* for Hibernate native properties (the prefix is +# stripped before adding them to the entity manager) + +# The SQL dialect makes Hibernate generate better SQL for the chosen database + spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect \ No newline at end of file diff --git a/Real-Estate-Project/target/classes/com/realEstate/RealEstateProject/RealEstateProjectApplication.class b/Real-Estate-Project/target/classes/com/realEstate/RealEstateProject/RealEstateProjectApplication.class new file mode 100644 index 0000000..f6ae885 Binary files /dev/null and b/Real-Estate-Project/target/classes/com/realEstate/RealEstateProject/RealEstateProjectApplication.class differ diff --git a/Real-Estate-Project/target/classes/com/realEstate/RealEstateProject/ServletInitializer.class b/Real-Estate-Project/target/classes/com/realEstate/RealEstateProject/ServletInitializer.class new file mode 100644 index 0000000..4f81ca7 Binary files /dev/null and b/Real-Estate-Project/target/classes/com/realEstate/RealEstateProject/ServletInitializer.class differ diff --git a/Real-Estate-Project/target/classes/com/realEstate/config/ApplicationConfig.class b/Real-Estate-Project/target/classes/com/realEstate/config/ApplicationConfig.class new file mode 100644 index 0000000..249a550 Binary files /dev/null and b/Real-Estate-Project/target/classes/com/realEstate/config/ApplicationConfig.class differ diff --git a/Real-Estate-Project/target/classes/com/realEstate/controller/RealEstateController.class b/Real-Estate-Project/target/classes/com/realEstate/controller/RealEstateController.class new file mode 100644 index 0000000..b9ede2b Binary files /dev/null and b/Real-Estate-Project/target/classes/com/realEstate/controller/RealEstateController.class differ diff --git a/Real-Estate-Project/target/classes/com/realEstate/entity/Agent.class b/Real-Estate-Project/target/classes/com/realEstate/entity/Agent.class new file mode 100644 index 0000000..b9ffab3 Binary files /dev/null and b/Real-Estate-Project/target/classes/com/realEstate/entity/Agent.class differ diff --git a/Real-Estate-Project/target/classes/com/realEstate/entity/Client.class b/Real-Estate-Project/target/classes/com/realEstate/entity/Client.class new file mode 100644 index 0000000..65c2bbd Binary files /dev/null and b/Real-Estate-Project/target/classes/com/realEstate/entity/Client.class differ diff --git a/Real-Estate-Project/target/classes/com/realEstate/entity/Property.class b/Real-Estate-Project/target/classes/com/realEstate/entity/Property.class new file mode 100644 index 0000000..fb8d29b Binary files /dev/null and b/Real-Estate-Project/target/classes/com/realEstate/entity/Property.class differ diff --git a/Real-Estate-Project/target/classes/com/realEstate/repository/AgentRepository.class b/Real-Estate-Project/target/classes/com/realEstate/repository/AgentRepository.class new file mode 100644 index 0000000..ec481dd Binary files /dev/null and b/Real-Estate-Project/target/classes/com/realEstate/repository/AgentRepository.class differ diff --git a/Real-Estate-Project/target/classes/com/realEstate/repository/ClientRepository.class b/Real-Estate-Project/target/classes/com/realEstate/repository/ClientRepository.class new file mode 100644 index 0000000..b5efd4d Binary files /dev/null and b/Real-Estate-Project/target/classes/com/realEstate/repository/ClientRepository.class differ diff --git a/Real-Estate-Project/target/classes/com/realEstate/repository/PropertyRepository.class b/Real-Estate-Project/target/classes/com/realEstate/repository/PropertyRepository.class new file mode 100644 index 0000000..ff849c2 Binary files /dev/null and b/Real-Estate-Project/target/classes/com/realEstate/repository/PropertyRepository.class differ diff --git a/Real-Estate-Project/target/classes/com/realEstate/service/RealEstateService.class b/Real-Estate-Project/target/classes/com/realEstate/service/RealEstateService.class new file mode 100644 index 0000000..5bde6be Binary files /dev/null and b/Real-Estate-Project/target/classes/com/realEstate/service/RealEstateService.class differ diff --git a/Real-Estate-Project/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF b/Real-Estate-Project/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF new file mode 100644 index 0000000..113bbbf --- /dev/null +++ b/Real-Estate-Project/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 18 +Implementation-Title: Real-Estate-Project +Implementation-Version: 0.0.1-SNAPSHOT +Created-By: Maven Integration for Eclipse + diff --git a/Real-Estate-Project/target/m2e-wtp/web-resources/META-INF/maven/com.realEstate/Real-Estate-Project/pom.properties b/Real-Estate-Project/target/m2e-wtp/web-resources/META-INF/maven/com.realEstate/Real-Estate-Project/pom.properties new file mode 100644 index 0000000..95b323e --- /dev/null +++ b/Real-Estate-Project/target/m2e-wtp/web-resources/META-INF/maven/com.realEstate/Real-Estate-Project/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Tue Oct 04 14:57:30 CDT 2022 +artifactId=Real-Estate-Project +groupId=com.realEstate +m2e.projectLocation=C\:\\Users\\since\\eclipse-workspace\\RealEstateUpdated\\RealEstateProject2\\Real-Estate-Project\\Real-Estate-Project +m2e.projectName=Real-Estate-Project +version=0.0.1-SNAPSHOT diff --git a/Real-Estate-Project/target/m2e-wtp/web-resources/META-INF/maven/com.realEstate/Real-Estate-Project/pom.xml b/Real-Estate-Project/target/m2e-wtp/web-resources/META-INF/maven/com.realEstate/Real-Estate-Project/pom.xml new file mode 100644 index 0000000..c0eae4a --- /dev/null +++ b/Real-Estate-Project/target/m2e-wtp/web-resources/META-INF/maven/com.realEstate/Real-Estate-Project/pom.xml @@ -0,0 +1,80 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.7.3 + + + com.realEstate + Real-Estate-Project + 0.0.1-SNAPSHOT + war + Real-Estate-Project + Demo project for Spring Boot + + 17 + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + mysql + mysql-connector-java + runtime + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + org.springframework.boot + spring-boot-starter-test + test + + + org.apache.tomcat.embed + tomcat-embed-jasper + provided + + + + javax.servlet + jstl + + + + org.hibernate + hibernate-core + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + \ No newline at end of file diff --git a/Real-Estate-Project/target/test-classes/com/realEstate/RealEstateProject/RealEstateProjectApplicationTests.class b/Real-Estate-Project/target/test-classes/com/realEstate/RealEstateProject/RealEstateProjectApplicationTests.class new file mode 100644 index 0000000..caf398e Binary files /dev/null and b/Real-Estate-Project/target/test-classes/com/realEstate/RealEstateProject/RealEstateProjectApplicationTests.class differ