├── README.md ├── ScreenShots ├── .img ├── Screenshot (7).png ├── Screenshot (8).png ├── Web capture_11-1-2024_143233_localhost.jpeg ├── Web capture_11-1-2024_143259_localhost.jpeg ├── Web capture_11-1-2024_143359_localhost.jpeg ├── Web capture_11-1-2024_143414_localhost.jpeg ├── Web capture_11-1-2024_143434_localhost.jpeg ├── Web capture_11-1-2024_143456_localhost.jpeg └── login page.PNG ├── emp_backend ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── demo │ │ │ ├── EmpBackendApplication.java │ │ │ ├── adminController │ │ │ └── adminController.java │ │ │ ├── adminModel │ │ │ └── adminModel.java │ │ │ ├── adminRepository │ │ │ └── adminRepository.java │ │ │ ├── controller │ │ │ └── EmployeeController.java │ │ │ ├── exception │ │ │ └── ResourceNotFoundException.java │ │ │ ├── model │ │ │ └── Employee.java │ │ │ └── repository │ │ │ └── EmployeeRepository.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── demo │ └── EmpBackendApplicationTests.java └── employee frontend final ├── .editorconfig ├── .gitignore ├── .vscode ├── extensions.json ├── launch.json └── tasks.json ├── README.md ├── angular.json ├── package-lock.json ├── package.json ├── src ├── app │ ├── add-employee │ │ ├── add-employee.component.css │ │ ├── add-employee.component.html │ │ ├── add-employee.component.spec.ts │ │ └── add-employee.component.ts │ ├── admin-login │ │ ├── admin-login.component.css │ │ ├── admin-login.component.html │ │ ├── admin-login.component.spec.ts │ │ └── admin-login.component.ts │ ├── app-routing.module.ts │ ├── app.component.css │ ├── app.component.html │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── employee-list │ │ ├── employee-list.component.css │ │ ├── employee-list.component.html │ │ ├── employee-list.component.spec.ts │ │ └── employee-list.component.ts │ ├── employee.service.spec.ts │ ├── employee.service.ts │ ├── employee.spec.ts │ ├── employee.ts │ ├── home │ │ ├── home.component.css │ │ ├── home.component.html │ │ ├── home.component.spec.ts │ │ └── home.component.ts │ ├── show-details │ │ ├── show-details.component.css │ │ ├── show-details.component.html │ │ ├── show-details.component.spec.ts │ │ └── show-details.component.ts │ └── update-employee │ │ ├── update-employee.component.css │ │ ├── update-employee.component.html │ │ ├── update-employee.component.spec.ts │ │ └── update-employee.component.ts ├── assets │ ├── .gitkeep │ ├── 1.jpg │ ├── 2.jpg │ ├── about-5.webp │ ├── download.jpg │ ├── gallery-3.webp │ ├── gallery-5.webp │ ├── login.jpg │ ├── noBgLogin.png │ ├── team1.jpg │ ├── team2.jpg │ └── team3.jpg ├── favicon.ico ├── index.html ├── main.ts └── styles.css ├── tsconfig.app.json ├── tsconfig.json └── tsconfig.spec.json /README.md: -------------------------------------------------------------------------------- 1 | # Employee Management System using Angular spring-boot mysql Full Stack Project 2 | 3 | 4 | 5 | The Employee Management System is a comprehensive web application designed to streamline and enhance the management of employee-related tasks within an organization. This system utilizes a modern and efficient technology stack, including Spring Boot for the backend, Angular for the frontend, and MySQL for the database. 6 | 7 | **Technology Stack:** 8 | 9 | *Backend:* 10 | - **Spring Boot:** The backend of the Employee Management System is built using Spring Boot, a Java-based framework known for its simplicity and ease of use. Spring Boot provides a robust and scalable foundation for developing enterprise-level applications. 11 | 12 | - **MySQL:** The database layer is powered by MySQL, a reliable relational database management system. MySQL is utilized for storing and retrieving employee-related data, ensuring data integrity and efficiency in data management. 13 | 14 | *Frontend:* 15 | - **Angular:** The frontend of the application is developed using Angular, a powerful and dynamic front-end framework. Angular facilitates the creation of a responsive and interactive user interface, enabling seamless communication with the backend. 16 | 17 | # Home Page 18 |  19 | 20 | # View all Employees Page 21 |  22 | 23 | # Update Existing Employee 24 |  25 | 26 | # Add New Employee 27 |  28 | 29 | # Delete Employee 30 |  31 | 32 | # Admin Login Page 33 |  34 | 35 | 36 | # View Details of Particular Employee 37 |  38 | 39 | 40 | 41 | **Key Features:** 42 | 43 | 1. **Home Page:** 44 | - The home page serves as the central hub, providing users with an intuitive and user-friendly interface. It includes quick links to essential features and announcements. 45 | 46 | 2. **View All Employee:** 47 | - Users, including administrators, can easily access a comprehensive list of all employees within the organization. The interface allows for efficient sorting, searching, and filtering of employee data. 48 | 49 | 3. **Add Employee Page:** 50 | - The system offers a dedicated page for adding new employees, featuring a well-designed form with form validation. This ensures that accurate and complete information is entered for each employee. 51 | 52 | 4. **Admin Panel:** 53 | - The admin panel is a secure section accessible only to authorized users. Admins have the authority to manage user roles, access control, and other administrative tasks. 54 | 55 | 5. **CRUD Operations:** 56 | - The system supports all essential CRUD (Create, Read, Update, Delete) operations. Users can add new employees, update existing records, delete unnecessary entries, and view detailed information about each employee. 57 | 58 | 6. **Form Validation:** 59 | - Robust form validation mechanisms are implemented to ensure the accuracy and completeness of data entered by users. This helps in maintaining data integrity and consistency. 60 | 61 | **Backend Technology:** 62 | 63 | The backend, powered by Spring Boot, handles data processing, business logic, and database interactions. It exposes RESTful APIs that the frontend consumes for seamless communication. Spring Boot's modular and organized structure simplifies code maintenance and promotes scalability. 64 | 65 | **Frontend Technology:** 66 | 67 | Angular, on the frontend, provides a dynamic and responsive user interface. It facilitates the creation of modular components and services, enhancing code maintainability and reusability. Angular's two-way data binding ensures real-time updates between the user interface and backend data. 68 | 69 | In conclusion, the Employee Management System offers a robust solution for organizations to efficiently manage their workforce. The use of Spring Boot, Angular, and MySQL ensures a scalable, secure, and user-friendly platform for handling various employee-related tasks. 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /ScreenShots/.img: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ScreenShots/Screenshot (7).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/ScreenShots/Screenshot (7).png -------------------------------------------------------------------------------- /ScreenShots/Screenshot (8).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/ScreenShots/Screenshot (8).png -------------------------------------------------------------------------------- /ScreenShots/Web capture_11-1-2024_143233_localhost.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/ScreenShots/Web capture_11-1-2024_143233_localhost.jpeg -------------------------------------------------------------------------------- /ScreenShots/Web capture_11-1-2024_143259_localhost.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/ScreenShots/Web capture_11-1-2024_143259_localhost.jpeg -------------------------------------------------------------------------------- /ScreenShots/Web capture_11-1-2024_143359_localhost.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/ScreenShots/Web capture_11-1-2024_143359_localhost.jpeg -------------------------------------------------------------------------------- /ScreenShots/Web capture_11-1-2024_143414_localhost.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/ScreenShots/Web capture_11-1-2024_143414_localhost.jpeg -------------------------------------------------------------------------------- /ScreenShots/Web capture_11-1-2024_143434_localhost.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/ScreenShots/Web capture_11-1-2024_143434_localhost.jpeg -------------------------------------------------------------------------------- /ScreenShots/Web capture_11-1-2024_143456_localhost.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/ScreenShots/Web capture_11-1-2024_143456_localhost.jpeg -------------------------------------------------------------------------------- /ScreenShots/login page.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/ScreenShots/login page.PNG -------------------------------------------------------------------------------- /emp_backend/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /emp_backend/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/emp_backend/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /emp_backend/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /emp_backend/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Apache Maven Wrapper startup batch script, version 3.2.0 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | # e.g. to debug Maven itself, use 32 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | # ---------------------------------------------------------------------------- 35 | 36 | if [ -z "$MAVEN_SKIP_RC" ] ; then 37 | 38 | if [ -f /usr/local/etc/mavenrc ] ; then 39 | . /usr/local/etc/mavenrc 40 | fi 41 | 42 | if [ -f /etc/mavenrc ] ; then 43 | . /etc/mavenrc 44 | fi 45 | 46 | if [ -f "$HOME/.mavenrc" ] ; then 47 | . "$HOME/.mavenrc" 48 | fi 49 | 50 | fi 51 | 52 | # OS specific support. $var _must_ be set to either true or false. 53 | cygwin=false; 54 | darwin=false; 55 | mingw=false 56 | case "$(uname)" in 57 | CYGWIN*) cygwin=true ;; 58 | MINGW*) mingw=true;; 59 | Darwin*) darwin=true 60 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 61 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 62 | if [ -z "$JAVA_HOME" ]; then 63 | if [ -x "/usr/libexec/java_home" ]; then 64 | JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME 65 | else 66 | JAVA_HOME="/Library/Java/Home"; export JAVA_HOME 67 | fi 68 | fi 69 | ;; 70 | esac 71 | 72 | if [ -z "$JAVA_HOME" ] ; then 73 | if [ -r /etc/gentoo-release ] ; then 74 | JAVA_HOME=$(java-config --jre-home) 75 | fi 76 | fi 77 | 78 | # For Cygwin, ensure paths are in UNIX format before anything is touched 79 | if $cygwin ; then 80 | [ -n "$JAVA_HOME" ] && 81 | JAVA_HOME=$(cygpath --unix "$JAVA_HOME") 82 | [ -n "$CLASSPATH" ] && 83 | CLASSPATH=$(cygpath --path --unix "$CLASSPATH") 84 | fi 85 | 86 | # For Mingw, ensure paths are in UNIX format before anything is touched 87 | if $mingw ; then 88 | [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && 89 | JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" 90 | fi 91 | 92 | if [ -z "$JAVA_HOME" ]; then 93 | javaExecutable="$(which javac)" 94 | if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then 95 | # readlink(1) is not available as standard on Solaris 10. 96 | readLink=$(which readlink) 97 | if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then 98 | if $darwin ; then 99 | javaHome="$(dirname "\"$javaExecutable\"")" 100 | javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" 101 | else 102 | javaExecutable="$(readlink -f "\"$javaExecutable\"")" 103 | fi 104 | javaHome="$(dirname "\"$javaExecutable\"")" 105 | javaHome=$(expr "$javaHome" : '\(.*\)/bin') 106 | JAVA_HOME="$javaHome" 107 | export JAVA_HOME 108 | fi 109 | fi 110 | fi 111 | 112 | if [ -z "$JAVACMD" ] ; then 113 | if [ -n "$JAVA_HOME" ] ; then 114 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 115 | # IBM's JDK on AIX uses strange locations for the executables 116 | JAVACMD="$JAVA_HOME/jre/sh/java" 117 | else 118 | JAVACMD="$JAVA_HOME/bin/java" 119 | fi 120 | else 121 | JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" 122 | fi 123 | fi 124 | 125 | if [ ! -x "$JAVACMD" ] ; then 126 | echo "Error: JAVA_HOME is not defined correctly." >&2 127 | echo " We cannot execute $JAVACMD" >&2 128 | exit 1 129 | fi 130 | 131 | if [ -z "$JAVA_HOME" ] ; then 132 | echo "Warning: JAVA_HOME environment variable is not set." 133 | fi 134 | 135 | # traverses directory structure from process work directory to filesystem root 136 | # first directory with .mvn subdirectory is considered project base directory 137 | find_maven_basedir() { 138 | if [ -z "$1" ] 139 | then 140 | echo "Path not specified to find_maven_basedir" 141 | return 1 142 | fi 143 | 144 | basedir="$1" 145 | wdir="$1" 146 | while [ "$wdir" != '/' ] ; do 147 | if [ -d "$wdir"/.mvn ] ; then 148 | basedir=$wdir 149 | break 150 | fi 151 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 152 | if [ -d "${wdir}" ]; then 153 | wdir=$(cd "$wdir/.." || exit 1; pwd) 154 | fi 155 | # end of workaround 156 | done 157 | printf '%s' "$(cd "$basedir" || exit 1; pwd)" 158 | } 159 | 160 | # concatenates all lines of a file 161 | concat_lines() { 162 | if [ -f "$1" ]; then 163 | # Remove \r in case we run on Windows within Git Bash 164 | # and check out the repository with auto CRLF management 165 | # enabled. Otherwise, we may read lines that are delimited with 166 | # \r\n and produce $'-Xarg\r' rather than -Xarg due to word 167 | # splitting rules. 168 | tr -s '\r\n' ' ' < "$1" 169 | fi 170 | } 171 | 172 | log() { 173 | if [ "$MVNW_VERBOSE" = true ]; then 174 | printf '%s\n' "$1" 175 | fi 176 | } 177 | 178 | BASE_DIR=$(find_maven_basedir "$(dirname "$0")") 179 | if [ -z "$BASE_DIR" ]; then 180 | exit 1; 181 | fi 182 | 183 | MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR 184 | log "$MAVEN_PROJECTBASEDIR" 185 | 186 | ########################################################################################## 187 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 188 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 189 | ########################################################################################## 190 | wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" 191 | if [ -r "$wrapperJarPath" ]; then 192 | log "Found $wrapperJarPath" 193 | else 194 | log "Couldn't find $wrapperJarPath, downloading it ..." 195 | 196 | if [ -n "$MVNW_REPOURL" ]; then 197 | wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" 198 | else 199 | wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" 200 | fi 201 | while IFS="=" read -r key value; do 202 | # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) 203 | safeValue=$(echo "$value" | tr -d '\r') 204 | case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; 205 | esac 206 | done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" 207 | log "Downloading from: $wrapperUrl" 208 | 209 | if $cygwin; then 210 | wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") 211 | fi 212 | 213 | if command -v wget > /dev/null; then 214 | log "Found wget ... using wget" 215 | [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" 216 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 217 | wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 218 | else 219 | wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 220 | fi 221 | elif command -v curl > /dev/null; then 222 | log "Found curl ... using curl" 223 | [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" 224 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 225 | curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" 226 | else 227 | curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" 228 | fi 229 | else 230 | log "Falling back to using Java to download" 231 | javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" 232 | javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" 233 | # For Cygwin, switch paths to Windows format before running javac 234 | if $cygwin; then 235 | javaSource=$(cygpath --path --windows "$javaSource") 236 | javaClass=$(cygpath --path --windows "$javaClass") 237 | fi 238 | if [ -e "$javaSource" ]; then 239 | if [ ! -e "$javaClass" ]; then 240 | log " - Compiling MavenWrapperDownloader.java ..." 241 | ("$JAVA_HOME/bin/javac" "$javaSource") 242 | fi 243 | if [ -e "$javaClass" ]; then 244 | log " - Running MavenWrapperDownloader.java ..." 245 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" 246 | fi 247 | fi 248 | fi 249 | fi 250 | ########################################################################################## 251 | # End of extension 252 | ########################################################################################## 253 | 254 | # If specified, validate the SHA-256 sum of the Maven wrapper jar file 255 | wrapperSha256Sum="" 256 | while IFS="=" read -r key value; do 257 | case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; 258 | esac 259 | done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" 260 | if [ -n "$wrapperSha256Sum" ]; then 261 | wrapperSha256Result=false 262 | if command -v sha256sum > /dev/null; then 263 | if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then 264 | wrapperSha256Result=true 265 | fi 266 | elif command -v shasum > /dev/null; then 267 | if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then 268 | wrapperSha256Result=true 269 | fi 270 | else 271 | echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." 272 | echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." 273 | exit 1 274 | fi 275 | if [ $wrapperSha256Result = false ]; then 276 | echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 277 | echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 278 | echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 279 | exit 1 280 | fi 281 | fi 282 | 283 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 284 | 285 | # For Cygwin, switch paths to Windows format before running java 286 | if $cygwin; then 287 | [ -n "$JAVA_HOME" ] && 288 | JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") 289 | [ -n "$CLASSPATH" ] && 290 | CLASSPATH=$(cygpath --path --windows "$CLASSPATH") 291 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 292 | MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") 293 | fi 294 | 295 | # Provide a "standardized" way to retrieve the CLI args that will 296 | # work with both Windows and non-Windows executions. 297 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" 298 | export MAVEN_CMD_LINE_ARGS 299 | 300 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 301 | 302 | # shellcheck disable=SC2086 # safe args 303 | exec "$JAVACMD" \ 304 | $MAVEN_OPTS \ 305 | $MAVEN_DEBUG_OPTS \ 306 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 307 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 308 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 309 | -------------------------------------------------------------------------------- /emp_backend/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Apache Maven Wrapper startup batch script, version 3.2.0 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 28 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 29 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 30 | @REM e.g. to debug Maven itself, use 31 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 32 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 33 | @REM ---------------------------------------------------------------------------- 34 | 35 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 36 | @echo off 37 | @REM set title of command window 38 | title %0 39 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 40 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 41 | 42 | @REM set %HOME% to equivalent of $HOME 43 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 44 | 45 | @REM Execute a user defined script before this one 46 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 47 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 48 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 49 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* 50 | :skipRcPre 51 | 52 | @setlocal 53 | 54 | set ERROR_CODE=0 55 | 56 | @REM To isolate internal variables from possible post scripts, we use another setlocal 57 | @setlocal 58 | 59 | @REM ==== START VALIDATION ==== 60 | if not "%JAVA_HOME%" == "" goto OkJHome 61 | 62 | echo. 63 | echo Error: JAVA_HOME not found in your environment. >&2 64 | echo Please set the JAVA_HOME variable in your environment to match the >&2 65 | echo location of your Java installation. >&2 66 | echo. 67 | goto error 68 | 69 | :OkJHome 70 | if exist "%JAVA_HOME%\bin\java.exe" goto init 71 | 72 | echo. 73 | echo Error: JAVA_HOME is set to an invalid directory. >&2 74 | echo JAVA_HOME = "%JAVA_HOME%" >&2 75 | echo Please set the JAVA_HOME variable in your environment to match the >&2 76 | echo location of your Java installation. >&2 77 | echo. 78 | goto error 79 | 80 | @REM ==== END VALIDATION ==== 81 | 82 | :init 83 | 84 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 85 | @REM Fallback to current working directory if not found. 86 | 87 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 88 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 89 | 90 | set EXEC_DIR=%CD% 91 | set WDIR=%EXEC_DIR% 92 | :findBaseDir 93 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 94 | cd .. 95 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 96 | set WDIR=%CD% 97 | goto findBaseDir 98 | 99 | :baseDirFound 100 | set MAVEN_PROJECTBASEDIR=%WDIR% 101 | cd "%EXEC_DIR%" 102 | goto endDetectBaseDir 103 | 104 | :baseDirNotFound 105 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 106 | cd "%EXEC_DIR%" 107 | 108 | :endDetectBaseDir 109 | 110 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 111 | 112 | @setlocal EnableExtensions EnableDelayedExpansion 113 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 114 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 115 | 116 | :endReadAdditionalConfig 117 | 118 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 119 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 120 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 121 | 122 | set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" 123 | 124 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 125 | IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B 126 | ) 127 | 128 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 129 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 130 | if exist %WRAPPER_JAR% ( 131 | if "%MVNW_VERBOSE%" == "true" ( 132 | echo Found %WRAPPER_JAR% 133 | ) 134 | ) else ( 135 | if not "%MVNW_REPOURL%" == "" ( 136 | SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" 137 | ) 138 | if "%MVNW_VERBOSE%" == "true" ( 139 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 140 | echo Downloading from: %WRAPPER_URL% 141 | ) 142 | 143 | powershell -Command "&{"^ 144 | "$webclient = new-object System.Net.WebClient;"^ 145 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 146 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 147 | "}"^ 148 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ 149 | "}" 150 | if "%MVNW_VERBOSE%" == "true" ( 151 | echo Finished downloading %WRAPPER_JAR% 152 | ) 153 | ) 154 | @REM End of extension 155 | 156 | @REM If specified, validate the SHA-256 sum of the Maven wrapper jar file 157 | SET WRAPPER_SHA_256_SUM="" 158 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 159 | IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B 160 | ) 161 | IF NOT %WRAPPER_SHA_256_SUM%=="" ( 162 | powershell -Command "&{"^ 163 | "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ 164 | "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ 165 | " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ 166 | " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ 167 | " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ 168 | " exit 1;"^ 169 | "}"^ 170 | "}" 171 | if ERRORLEVEL 1 goto error 172 | ) 173 | 174 | @REM Provide a "standardized" way to retrieve the CLI args that will 175 | @REM work with both Windows and non-Windows executions. 176 | set MAVEN_CMD_LINE_ARGS=%* 177 | 178 | %MAVEN_JAVA_EXE% ^ 179 | %JVM_CONFIG_MAVEN_PROPS% ^ 180 | %MAVEN_OPTS% ^ 181 | %MAVEN_DEBUG_OPTS% ^ 182 | -classpath %WRAPPER_JAR% ^ 183 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 184 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 185 | if ERRORLEVEL 1 goto error 186 | goto end 187 | 188 | :error 189 | set ERROR_CODE=1 190 | 191 | :end 192 | @endlocal & set ERROR_CODE=%ERROR_CODE% 193 | 194 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 195 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 196 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 197 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 198 | :skipRcPost 199 | 200 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 201 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 202 | 203 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 204 | 205 | cmd /C exit /B %ERROR_CODE% 206 | -------------------------------------------------------------------------------- /emp_backend/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 3.2.1 9 | 10 | 11 | com.example 12 | emp_backend 13 | 0.0.1-SNAPSHOT 14 | emp_backend 15 | Demo project for Spring Boot 16 | 17 | 17 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-devtools 32 | runtime 33 | true 34 | 35 | 36 | com.mysql 37 | mysql-connector-j 38 | runtime 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-test 43 | test 44 | 45 | 46 | 47 | 48 | 49 | 50 | javax.persistence 51 | javax.persistence-api 52 | 2.2 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | org.springframework.boot 65 | spring-boot-maven-plugin 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /emp_backend/src/main/java/com/example/demo/EmpBackendApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.web.bind.annotation.CrossOrigin; 6 | 7 | @SpringBootApplication 8 | @CrossOrigin(origins = "http://localhost:4200") 9 | public class EmpBackendApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(EmpBackendApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /emp_backend/src/main/java/com/example/demo/adminController/adminController.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.adminController; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.CrossOrigin; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import com.example.demo.adminModel.adminModel; 12 | import com.example.demo.adminRepository.adminRepository; 13 | 14 | 15 | @RestController 16 | @RequestMapping("/api/v1/") 17 | public class adminController { 18 | 19 | 20 | @Autowired 21 | private adminRepository repo; 22 | 23 | 24 | //get all 25 | 26 | @GetMapping("/admin") 27 | public List getAllAdmins(){ 28 | return repo.findAll(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /emp_backend/src/main/java/com/example/demo/adminModel/adminModel.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.adminModel; 2 | 3 | 4 | 5 | import jakarta.persistence.Column; 6 | import jakarta.persistence.Entity; 7 | import jakarta.persistence.GeneratedValue; 8 | import jakarta.persistence.GenerationType; 9 | import jakarta.persistence.Id; 10 | import jakarta.persistence.Table; 11 | 12 | @Entity 13 | @Table(name="admin") 14 | public class adminModel { 15 | 16 | 17 | public adminModel() {} 18 | 19 | 20 | public adminModel(String adminName, String adminPassword) { 21 | super(); 22 | this.adminName = adminName; 23 | this.adminPassword = adminPassword; 24 | } 25 | 26 | 27 | @Id 28 | @GeneratedValue(strategy = GenerationType.IDENTITY) 29 | private long adminID; 30 | 31 | @Column(name="adminName") 32 | private String adminName; 33 | 34 | @Column(name="adminPassword") 35 | private String adminPassword; 36 | 37 | 38 | 39 | 40 | public long getAdminID() { 41 | return adminID; 42 | } 43 | public void setAdminID(long adminID) { 44 | this.adminID = adminID; 45 | } 46 | public String getAdminName() { 47 | return adminName; 48 | } 49 | public void setAdminName(String adminName) { 50 | this.adminName = adminName; 51 | } 52 | public String getAdminPassword() { 53 | return adminPassword; 54 | } 55 | public void setAdminPassword(String adminPassword) { 56 | this.adminPassword = adminPassword; 57 | } 58 | 59 | 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /emp_backend/src/main/java/com/example/demo/adminRepository/adminRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.adminRepository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.example.demo.adminModel.adminModel; 7 | 8 | @Repository 9 | public interface adminRepository extends JpaRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /emp_backend/src/main/java/com/example/demo/controller/EmployeeController.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.CrossOrigin; 6 | import org.springframework.web.bind.annotation.DeleteMapping; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.PutMapping; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RestController; 14 | 15 | import com.example.demo.exception.ResourceNotFoundException; 16 | import com.example.demo.model.Employee; 17 | import com.example.demo.repository.EmployeeRepository; 18 | 19 | import java.util.HashMap; 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | @RestController 24 | @RequestMapping("/api/v1/") 25 | public class EmployeeController { 26 | 27 | @Autowired 28 | private EmployeeRepository employeeRepository; 29 | 30 | //get all data 31 | @CrossOrigin(origins = "http://localhost:4200") 32 | @GetMapping("/employees") 33 | public List getAllEmployees(){ 34 | return employeeRepository.findAll(); 35 | } 36 | 37 | 38 | 39 | //create 40 | @CrossOrigin(origins = "http://localhost:4200") 41 | @PostMapping("/employees") 42 | public Employee createEmployee(@RequestBody Employee employee) 43 | { 44 | return employeeRepository.save(employee); 45 | } 46 | 47 | 48 | // get data by id 49 | @CrossOrigin(origins = "http://localhost:4200") 50 | @GetMapping("/employees/{id}") 51 | public ResponseEntity getByID(@PathVariable Long id) { 52 | Employee employee = employeeRepository.findById(id). 53 | orElseThrow(()-> new ResourceNotFoundException("Employee with id "+id+"does not exists")); 54 | return ResponseEntity.ok(employee); 55 | } 56 | 57 | 58 | //update data 59 | @CrossOrigin(origins = "http://localhost:4200") 60 | @PutMapping ("/employees/{id}") 61 | public ResponseEntity updateEmployeeByID(@PathVariable Long id, @RequestBody Employee employeeDetails){ 62 | Employee employee = employeeRepository.findById(id). 63 | orElseThrow(()-> new ResourceNotFoundException("Employee with id "+id+"does not exists")); 64 | 65 | 66 | employee.setFname(employeeDetails.getFname()); 67 | employee.setLname(employeeDetails.getLname()); 68 | employee.setEmail(employeeDetails.getEmail()); 69 | employee.setDepartment(employeeDetails.getDepartment()); 70 | employee.setDesignation(employeeDetails.getDesignation()); 71 | employee.setJoiningDate(employeeDetails.getJoiningDate()); 72 | employee.setSalary(employeeDetails.getSalary()); 73 | 74 | Employee updatedEmployee=employeeRepository.save(employee); 75 | 76 | return ResponseEntity.ok(updatedEmployee); 77 | } 78 | 79 | 80 | 81 | @CrossOrigin(origins = "http://localhost:4200") 82 | @DeleteMapping("/employees/{id}") 83 | public ResponseEntity >deleteEmployee(@PathVariable Long id){ 84 | 85 | 86 | Employee employee = employeeRepository.findById(id). 87 | orElseThrow(()-> new ResourceNotFoundException("Employee with id "+id+"does not exists")); 88 | 89 | employeeRepository.delete(employee); 90 | 91 | Map response = new HashMap<>(); 92 | response.put("Deleted", Boolean.TRUE); 93 | return ResponseEntity.ok(response); 94 | 95 | } 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | } -------------------------------------------------------------------------------- /emp_backend/src/main/java/com/example/demo/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException { 8 | 9 | /** 10 | * 11 | */ 12 | private static final long serialVersionUID = 1L; 13 | 14 | public ResourceNotFoundException(String message) { 15 | 16 | super(message); 17 | 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /emp_backend/src/main/java/com/example/demo/model/Employee.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.model; 2 | import java.time.LocalDate; 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.GeneratedValue; 5 | import jakarta.persistence.GenerationType; 6 | import jakarta.persistence.Id; 7 | import jakarta.persistence.Table; 8 | import jakarta.persistence.Column; 9 | 10 | 11 | 12 | @Entity 13 | @Table(name="employees_table") 14 | public class Employee { 15 | 16 | 17 | public Employee() {} 18 | 19 | public Employee(String fname, String lname, String email, long salary, String department, String designation, 20 | LocalDate joiningDate) { 21 | super(); 22 | this.fname = fname; 23 | this.lname = lname; 24 | this.email = email; 25 | this.salary = salary; 26 | this.department = department; 27 | this.designation = designation; 28 | this.joiningDate = joiningDate; 29 | } 30 | 31 | @Id 32 | @GeneratedValue(strategy = GenerationType.IDENTITY) 33 | private long id; 34 | 35 | @Column(name="f_name") 36 | private String fname; 37 | 38 | @Column(name="l_name") 39 | private String lname; 40 | 41 | @Column(name="mail") 42 | private String email; 43 | 44 | @Column(name="sal") 45 | private long salary; 46 | 47 | @Column(name="dep") 48 | private String department; 49 | 50 | @Column(name="des") 51 | private String designation; 52 | 53 | @Column(name="jd") 54 | private LocalDate joiningDate; 55 | 56 | public long getId() { 57 | return id; 58 | } 59 | public void setId(long id) { 60 | this.id = id; 61 | } 62 | public String getFname() { 63 | return fname; 64 | } 65 | public void setFname(String fname) { 66 | this.fname = fname; 67 | } 68 | public String getLname() { 69 | return lname; 70 | } 71 | public void setLname(String lname) { 72 | this.lname = lname; 73 | } 74 | public String getEmail() { 75 | return email; 76 | } 77 | public void setEmail(String email) { 78 | this.email = email; 79 | } 80 | public long getSalary() { 81 | return salary; 82 | } 83 | public void setSalary(long salary) { 84 | this.salary = salary; 85 | } 86 | public String getDepartment() { 87 | return department; 88 | } 89 | public void setDepartment(String department) { 90 | this.department = department; 91 | } 92 | public String getDesignation() { 93 | return designation; 94 | } 95 | public void setDesignation(String designation) { 96 | this.designation = designation; 97 | } 98 | public LocalDate getJoiningDate() { 99 | return joiningDate; 100 | } 101 | public void setJoiningDate(LocalDate joiningDate) { 102 | this.joiningDate = joiningDate; 103 | } 104 | 105 | 106 | 107 | } 108 | -------------------------------------------------------------------------------- /emp_backend/src/main/java/com/example/demo/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.example.demo.model.Employee; 7 | 8 | @Repository 9 | public interface EmployeeRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /emp_backend/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/emp 2 | spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver 3 | spring.datasource.username=root 4 | spring.datasource.password= "\\enter your password" 5 | spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect 6 | 7 | 8 | spring.jpa.hibernate.ddl-auto = update 9 | -------------------------------------------------------------------------------- /emp_backend/src/test/java/com/example/demo/EmpBackendApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class EmpBackendApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /employee frontend final/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /employee frontend final/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /employee frontend final/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /employee frontend final/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /employee frontend final/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 3 | "version": "2.0.0", 4 | "tasks": [ 5 | { 6 | "type": "npm", 7 | "script": "start", 8 | "isBackground": true, 9 | "problemMatcher": { 10 | "owner": "typescript", 11 | "pattern": "$tsc", 12 | "background": { 13 | "activeOnStart": true, 14 | "beginsPattern": { 15 | "regexp": "(.*?)" 16 | }, 17 | "endsPattern": { 18 | "regexp": "bundle generation complete" 19 | } 20 | } 21 | } 22 | }, 23 | { 24 | "type": "npm", 25 | "script": "test", 26 | "isBackground": true, 27 | "problemMatcher": { 28 | "owner": "typescript", 29 | "pattern": "$tsc", 30 | "background": { 31 | "activeOnStart": true, 32 | "beginsPattern": { 33 | "regexp": "(.*?)" 34 | }, 35 | "endsPattern": { 36 | "regexp": "bundle generation complete" 37 | } 38 | } 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /employee frontend final/README.md: -------------------------------------------------------------------------------- 1 | # Frontend 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.2.11. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. 28 | -------------------------------------------------------------------------------- /employee frontend final/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "frontend": { 7 | "projectType": "application", 8 | "schematics": {}, 9 | "root": "", 10 | "sourceRoot": "src", 11 | "prefix": "app", 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/frontend", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": [ 20 | "zone.js" 21 | ], 22 | "tsConfig": "tsconfig.app.json", 23 | "assets": [ 24 | "src/favicon.ico", 25 | "src/assets" 26 | ], 27 | "styles": [ 28 | "@angular/material/prebuilt-themes/indigo-pink.css", 29 | "node_modules/bootstrap/dist/css/bootstrap.min.css", 30 | "src/styles.css" 31 | ], 32 | "scripts": [] 33 | }, 34 | "configurations": { 35 | "production": { 36 | "budgets": [ 37 | { 38 | "type": "initial", 39 | "maximumWarning": "500kb", 40 | "maximumError": "1mb" 41 | }, 42 | { 43 | "type": "anyComponentStyle", 44 | "maximumWarning": "2kb", 45 | "maximumError": "4kb" 46 | } 47 | ], 48 | "outputHashing": "all" 49 | }, 50 | "development": { 51 | "buildOptimizer": false, 52 | "optimization": false, 53 | "vendorChunk": true, 54 | "extractLicenses": false, 55 | "sourceMap": true, 56 | "namedChunks": true 57 | } 58 | }, 59 | "defaultConfiguration": "production" 60 | }, 61 | "serve": { 62 | "builder": "@angular-devkit/build-angular:dev-server", 63 | "configurations": { 64 | "production": { 65 | "browserTarget": "frontend:build:production" 66 | }, 67 | "development": { 68 | "browserTarget": "frontend:build:development" 69 | } 70 | }, 71 | "defaultConfiguration": "development" 72 | }, 73 | "extract-i18n": { 74 | "builder": "@angular-devkit/build-angular:extract-i18n", 75 | "options": { 76 | "browserTarget": "frontend:build" 77 | } 78 | }, 79 | "test": { 80 | "builder": "@angular-devkit/build-angular:karma", 81 | "options": { 82 | "polyfills": [ 83 | "zone.js", 84 | "zone.js/testing" 85 | ], 86 | "tsConfig": "tsconfig.spec.json", 87 | "assets": [ 88 | "src/favicon.ico", 89 | "src/assets" 90 | ], 91 | "styles": [ 92 | "@angular/material/prebuilt-themes/indigo-pink.css", 93 | "src/styles.css" 94 | ], 95 | "scripts": [] 96 | } 97 | } 98 | } 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /employee frontend final/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test" 10 | }, 11 | "private": true, 12 | "dependencies": { 13 | "@angular/animations": "^16.2.0", 14 | "@angular/cdk": "^16.2.12", 15 | "@angular/common": "^16.2.0", 16 | "@angular/compiler": "^16.2.0", 17 | "@angular/core": "^16.2.0", 18 | "@angular/forms": "^16.2.0", 19 | "@angular/material": "^16.2.12", 20 | "@angular/platform-browser": "^16.2.0", 21 | "@angular/platform-browser-dynamic": "^16.2.0", 22 | "@angular/router": "^16.2.0", 23 | "@ng-bootstrap/ng-bootstrap": "^15.1.2", 24 | "@popperjs/core": "^2.11.6", 25 | "bootstrap": "^5.2.3", 26 | "rxjs": "~7.8.0", 27 | "tslib": "^2.3.0", 28 | "zone.js": "~0.13.0" 29 | }, 30 | "devDependencies": { 31 | "@angular-devkit/build-angular": "^16.2.11", 32 | "@angular/cli": "^16.2.11", 33 | "@angular/compiler-cli": "^16.2.0", 34 | "@angular/localize": "^16.2.0", 35 | "@types/jasmine": "~4.3.0", 36 | "jasmine-core": "~4.6.0", 37 | "karma": "~6.4.0", 38 | "karma-chrome-launcher": "~3.2.0", 39 | "karma-coverage": "~2.2.0", 40 | "karma-jasmine": "~5.1.0", 41 | "karma-jasmine-html-reporter": "~2.1.0", 42 | "typescript": "~5.1.3" 43 | } 44 | } -------------------------------------------------------------------------------- /employee frontend final/src/app/add-employee/add-employee.component.css: -------------------------------------------------------------------------------- 1 | body{ 2 | min-height: 100vh; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | footer{ 7 | margin-top: auto; 8 | } 9 | 10 | .full-width-button { 11 | width: 100%; 12 | } 13 | 14 | 15 | form { 16 | /* border: 1px solid #454545; */ 17 | padding: 20px; /* Add some padding for better visual appearance */ 18 | box-shadow: 10px 4px 8px rgba(0, 0, 0, 0.1); 19 | } 20 | 21 | button{ 22 | box-shadow: 10px 4px 8px rgba(0, 0, 0, 0.1); 23 | } 24 | 25 | .form-container { 26 | border: 1px solid #000000; 27 | padding: 20px; /* Add some padding for better visual appearance */ 28 | } 29 | /* 30 | .lable{ 31 | border: 1px solid #000000; 32 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 33 | } */ 34 | 35 | input{ 36 | border: 1px solid #000000; 37 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 38 | } 39 | 40 | select{ 41 | border: 1px solid #000000; 42 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 43 | 44 | } -------------------------------------------------------------------------------- /employee frontend final/src/app/add-employee/add-employee.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | First Name 10 | 12 | 13 | 14 | First name is required 15 | First Name minimum 3 characters are required!!! 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Last Name 26 | 28 | 29 | 30 | Last name is required 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | Email Id 41 | 43 | 44 | Email is required 45 | Invalid email format 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | Department 59 | 61 | 62 | 63 | 64 | Department is required 65 | 66 | 67 | 68 | Choose.. 69 | IT 70 | HR 71 | Finance 72 | Marketing 73 | 74 | 75 | 76 | 77 | Designation 78 | 80 | 81 | 82 | 83 | Designation is required 84 | 85 | Choose... 86 | Developer 87 | Manager 88 | Analyst 89 | Accountant 90 | System Analyst 91 | 92 | 93 | 94 | 95 | 96 | 97 | Salary 98 | 101 | 102 | 103 | Salary is required 104 | 105 | Salary must be a number, more than 3 digits, and not starting with zero. 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 126 | 127 | 128 | 129 | 130 | 131 | Joining Date 132 | 135 | 136 | 137 | Joining Date is required 138 | 139 | 140 | 141 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | Submit 170 | 171 | 172 | 173 | Cancel 175 | 176 | 177 | 178 | 179 | 180 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /employee frontend final/src/app/add-employee/add-employee.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AddEmployeeComponent } from './add-employee.component'; 4 | 5 | describe('AddEmployeeComponent', () => { 6 | let component: AddEmployeeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [AddEmployeeComponent] 12 | }); 13 | fixture = TestBed.createComponent(AddEmployeeComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /employee frontend final/src/app/add-employee/add-employee.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Employee } from '../employee'; 3 | import { Observable } from 'rxjs'; 4 | import { EmployeeService } from '../employee.service'; 5 | import { Router } from '@angular/router'; 6 | import { FormsModule, NgForm } from '@angular/forms'; 7 | 8 | 9 | 10 | 11 | 12 | @Component({ 13 | selector: 'app-add-employee', 14 | templateUrl: './add-employee.component.html' 15 | , 16 | styleUrls: ['./add-employee.component.css'] 17 | }) 18 | export class AddEmployeeComponent //implements OnInit// 19 | { 20 | 21 | constructor( 22 | private employeeService: EmployeeService, 23 | private router: Router, 24 | 25 | ) { 26 | 27 | } 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | submitform!: NgForm; 36 | private baseURL = "http://localhost:8080/api/v1/employees"; 37 | employee: Employee = new Employee(); 38 | 39 | 40 | 41 | 42 | 43 | saveEmployee() { 44 | this.employeeService.addEmployee(this.employee).subscribe(data => { 45 | console.log(data); 46 | this.goToEmployeeList(); 47 | }, 48 | error => console.log(error)); 49 | } 50 | 51 | goToEmployeeList() { 52 | this.router.navigate(['/show-all-employees']); 53 | } 54 | 55 | ngOnInit(): void { } 56 | onSubmit() { 57 | console.log(this.employee); 58 | 59 | 60 | this.saveEmployee(); 61 | } 62 | 63 | 64 | } 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /employee frontend final/src/app/admin-login/admin-login.component.css: -------------------------------------------------------------------------------- 1 | .divider:after, 2 | .divider:before { 3 | content: ""; 4 | flex: 1; 5 | height: 1px; 6 | background: #eee; 7 | } 8 | .h-custom { 9 | height: calc(100% - 73px); 10 | } 11 | @media (max-width: 450px) { 12 | .h-custom { 13 | height: 100%; 14 | } 15 | } -------------------------------------------------------------------------------- /employee frontend final/src/app/admin-login/admin-login.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | Sign in with 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | OR 27 | 28 | 29 | 30 | 31 | 33 | Email address 34 | 35 | 36 | 37 | 38 | 40 | Password 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | Remember me 49 | 50 | 51 | Forgot password? 52 | 53 | 54 | 55 | Login 57 | Don't have an account? Register 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /employee frontend final/src/app/admin-login/admin-login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminLoginComponent } from './admin-login.component'; 4 | 5 | describe('AdminLoginComponent', () => { 6 | let component: AdminLoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [AdminLoginComponent] 12 | }); 13 | fixture = TestBed.createComponent(AdminLoginComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /employee frontend final/src/app/admin-login/admin-login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-admin-login', 5 | templateUrl: './admin-login.component.html', 6 | styleUrls: ['./admin-login.component.css'] 7 | }) 8 | export class AdminLoginComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /employee frontend final/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { EmployeeListComponent } from './employee-list/employee-list.component'; 4 | import { AddEmployeeComponent } from './add-employee/add-employee.component'; 5 | import { UpdateEmployeeComponent } from './update-employee/update-employee.component'; 6 | import { ShowDetailsComponent } from './show-details/show-details.component'; 7 | import { HomeComponent } from './home/home.component'; 8 | import { AdminLoginComponent } from './admin-login/admin-login.component'; 9 | 10 | 11 | 12 | const routes: Routes = [ 13 | 14 | {path:"show-all-employees",component: EmployeeListComponent}, 15 | {path:"add-employee", component: AddEmployeeComponent}, 16 | {path:'', redirectTo: "home", pathMatch:"full"}, 17 | {path:'updating-by-id/:id',component:UpdateEmployeeComponent}, 18 | {path:'details-of-employee/:id',component:ShowDetailsComponent}, 19 | {path:'home',component:HomeComponent}, 20 | {path:'login',component:AdminLoginComponent} 21 | ]; 22 | 23 | @NgModule({ 24 | imports: [RouterModule.forRoot(routes)], 25 | exports: [RouterModule] 26 | }) 27 | export class AppRoutingModule { } 28 | -------------------------------------------------------------------------------- /employee frontend final/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .nav-item{color:white; 2 | margin-left: 2.5rem ; 3 | font-size: 1rem; 4 | 5 | } 6 | 7 | 8 | 9 | .navbar{ 10 | color: white; 11 | 12 | background-color: black; 13 | position: sticky; 14 | top: 0; 15 | z-index: 100; 16 | font-size: 3rem; 17 | } 18 | 19 | 20 | .logout-option { 21 | display: none; 22 | } 23 | 24 | .nav-item:hover .logout-option { 25 | /* display: inline; */ 26 | 27 | display: block; 28 | } -------------------------------------------------------------------------------- /employee frontend final/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Home 5 | 6 | 7 | Employee List 8 | 9 | 10 | Add Employee 11 | 12 | 13 | 14 | 15 | Admin Login 16 | Logout 17 | 18 | 19 | 20 | 21 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 46 | 47 | -------------------------------------------------------------------------------- /employee frontend final/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(() => TestBed.configureTestingModule({ 7 | imports: [RouterTestingModule], 8 | declarations: [AppComponent] 9 | })); 10 | 11 | it('should create the app', () => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.componentInstance; 14 | expect(app).toBeTruthy(); 15 | }); 16 | 17 | it(`should have as title 'frontend'`, () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app.title).toEqual('frontend'); 21 | }); 22 | 23 | it('should render title', () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | fixture.detectChanges(); 26 | const compiled = fixture.nativeElement as HTMLElement; 27 | expect(compiled.querySelector('.content span')?.textContent).toContain('frontend app is running!'); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /employee frontend final/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'frontend'; 10 | } 11 | -------------------------------------------------------------------------------- /employee frontend final/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | 5 | import { HttpClientModule } from '@angular/common/http' 6 | import { AppRoutingModule } from './app-routing.module'; 7 | import { AppComponent } from './app.component'; 8 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; 9 | import { EmployeeListComponent } from './employee-list/employee-list.component'; 10 | import { AddEmployeeComponent } from './add-employee/add-employee.component'; 11 | import { FormsModule } from '@angular/forms'; 12 | 13 | import {MatDatepickerModule} from '@angular/material/datepicker'; 14 | import {MatInputModule} from '@angular/material/input'; 15 | import {MatFormFieldModule} from '@angular/material/form-field'; 16 | import {MatNativeDateModule} from '@angular/material/core'; 17 | 18 | 19 | import { UpdateEmployeeComponent } from './update-employee/update-employee.component'; 20 | import { ShowDetailsComponent } from './show-details/show-details.component'; 21 | import { HomeComponent } from './home/home.component'; 22 | import { AdminLoginComponent } from './admin-login/admin-login.component'; 23 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 24 | 25 | 26 | 27 | @NgModule({ 28 | declarations: [ 29 | AppComponent, 30 | EmployeeListComponent, 31 | 32 | AddEmployeeComponent, 33 | UpdateEmployeeComponent, 34 | ShowDetailsComponent, 35 | AdminLoginComponent 36 | ], 37 | imports: [ 38 | BrowserModule, 39 | AppRoutingModule, 40 | NgbModule, 41 | HttpClientModule,FormsModule,HomeComponent, BrowserAnimationsModule , 42 | MatFormFieldModule, MatInputModule,MatFormFieldModule, MatInputModule, MatDatepickerModule, 43 | MatNativeDateModule 44 | ], 45 | providers: [], 46 | bootstrap: [AppComponent] 47 | }) 48 | export class AppModule { } 49 | -------------------------------------------------------------------------------- /employee frontend final/src/app/employee-list/employee-list.component.css: -------------------------------------------------------------------------------- 1 | .btn{ 2 | margin-right: 20px; 3 | box-shadow: 10 4px 8px rgba(0, 0, 0, 0.1); 4 | 5 | } 6 | 7 | .inline{ 8 | display: flex; 9 | } 10 | 11 | 12 | .inline .btn{ 13 | margin-left: 1rem; 14 | } 15 | 16 | input{ 17 | border: 1px solid #000000; 18 | box-shadow: 10 4px 8px rgba(0, 0, 0, 0.1); 19 | } -------------------------------------------------------------------------------- /employee frontend final/src/app/employee-list/employee-list.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Search 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Id 25 | First Name 26 | Last Name 27 | Email 28 | 29 | Department 30 | Designation 31 | 32 | Actions 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | {{employee.id}} 41 | {{employee.fname}} 42 | {{employee.lname}} 43 | {{employee.email}} 44 | 45 | {{employee.department}} 46 | {{employee.designation}} 47 | 48 | 49 | Update 50 | Delete 51 | View 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /employee frontend final/src/app/employee-list/employee-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { EmployeeListComponent } from './employee-list.component'; 4 | 5 | describe('EmployeeListComponent', () => { 6 | let component: EmployeeListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [EmployeeListComponent] 12 | }); 13 | fixture = TestBed.createComponent(EmployeeListComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /employee frontend final/src/app/employee-list/employee-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Employee } from '../employee'; 3 | import { EmployeeService } from '../employee.service'; 4 | import{FormsModule} from '@angular/forms' 5 | 6 | import { Router } from '@angular/router'; 7 | @Component({ 8 | selector: 'app-employee-list', 9 | templateUrl: './employee-list.component.html', 10 | styleUrls: ['./employee-list.component.css'] 11 | }) 12 | export class EmployeeListComponent { 13 | 14 | employees: Employee[]; 15 | EnteredID!:number; 16 | 17 | constructor(private employeeService: EmployeeService, private router: Router) { 18 | this.employees=[]; 19 | 20 | } 21 | 22 | ngOnInit(): void { 23 | 24 | // this.employees = [ 25 | // { "id":1,fname: 'John', lname: 'Doe', email: 'john@example.com', salary: 50000, department: 'IT', designation: 'Developer' }, 26 | 27 | // ]; 28 | 29 | this.getEmployees(); 30 | } 31 | 32 | 33 | goToEmployee(){ 34 | 35 | 36 | console.log(this.EnteredID); 37 | this.router.navigate(['details-of-employee',this.EnteredID]); 38 | } 39 | 40 | getEmployees(){ 41 | this.employeeService.getEmployeesList().subscribe(data => {this.employees = data;}); 42 | 43 | 44 | } 45 | 46 | updateEmployee(id: number){ 47 | this.router.navigate(['updating-by-id', id]); 48 | } 49 | 50 | 51 | 52 | 53 | deleteEmployee(id: number){ 54 | 55 | if(confirm("Are you sure to delete Employee ID: "+id)){ 56 | this.employeeService.deleteEmployee(id).subscribe( data => { 57 | console.log(data); 58 | this.getEmployees(); 59 | })} 60 | } 61 | 62 | 63 | detailsOfEmployee(id: number){ 64 | this.router.navigate(['details-of-employee', id]); 65 | } 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /employee frontend final/src/app/employee.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { EmployeeService } from './employee.service'; 4 | 5 | describe('EmployeeService', () => { 6 | let service: EmployeeService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(EmployeeService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /employee frontend final/src/app/employee.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | 4 | import { Observable } from 'rxjs'; 5 | import { Employee } from './employee'; 6 | 7 | 8 | @Injectable({ 9 | providedIn: 'root' 10 | }) 11 | export class EmployeeService { 12 | 13 | 14 | 15 | private baseURL = "http://localhost:8080/api/v1/employees"; 16 | 17 | constructor(private httpClient: HttpClient) { } 18 | 19 | getEmployeesList(): Observable{ 20 | return this.httpClient.get(`${this.baseURL}`); 21 | } 22 | 23 | addEmployee(employee: Employee): Observable{ 24 | return this.httpClient.post(`${this.baseURL}`, employee); 25 | } 26 | 27 | getEmployeeById(id: number): Observable{ 28 | return this.httpClient.get(`${this.baseURL}/${id}`); 29 | } 30 | 31 | 32 | updateEmployee(id: number, employee: Employee): Observable{ 33 | return this.httpClient.put(`${this.baseURL}/${id}`, employee); 34 | } 35 | 36 | deleteEmployee(id: number): Observable{ 37 | return this.httpClient.delete(`${this.baseURL}/${id}`); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /employee frontend final/src/app/employee.spec.ts: -------------------------------------------------------------------------------- 1 | import { Employee } from './employee'; 2 | 3 | describe('Employee', () => { 4 | it('should create an instance', () => { 5 | expect(new Employee()).toBeTruthy(); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /employee frontend final/src/app/employee.ts: -------------------------------------------------------------------------------- 1 | import { DatePipe } from '@angular/common'; 2 | 3 | export class Employee { 4 | id!: number; 5 | fname!: string; 6 | lname!: string;; 7 | email!: string;; 8 | salary!: number; 9 | department: string; 10 | designation:string; 11 | joiningDate!: string; 12 | 13 | 14 | 15 | constructor() { 16 | // this.id = 0; 17 | // // this.fname=""; 18 | // this.lname=""; 19 | this.email="@gmail.com"; 20 | this.salary=0; 21 | this.department=""; 22 | this.designation=""; 23 | // this.joiningDate = new Date(); 24 | // // Set the default date value 25 | // const today = new Date(); 26 | // const year = today.getFullYear(); 27 | // const month = ('0' + (today.getMonth() + 1)).slice(-2); // Adding 1 because months are zero-based 28 | // const day = ('0' + today.getDate()).slice(-2); 29 | 30 | // this.joiningDate = `${year}-${month}-${day}`; 31 | }} 32 | -------------------------------------------------------------------------------- /employee frontend final/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | 2 | * { 3 | box-sizing: border-box; 4 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; 5 | 6 | } 7 | 8 | 9 | /* body{ 10 | background-color: black; 11 | } */ 12 | #p1{ 13 | font-size: 3.1rem; 14 | } 15 | 16 | #p2{ 17 | font-size: 2.5rem; 18 | } 19 | /* div { 20 | display: block; 21 | } */ 22 | .navigation{ 23 | display: flex; 24 | flex-wrap: wrap; 25 | justify-content: center; 26 | } 27 | .carousel-caption{ 28 | font-size: 2.9rem; 29 | height: 29rem; 30 | } 31 | /* ul { 32 | 33 | margin: 2rem 0; 34 | padding: 0; 35 | } 36 | 37 | li { 38 | list-style-type: style circle; 39 | font-size: 1.2rem; 40 | margin-bottom: 0.5rem; Margin using rem units for spacing 41 | } */ 42 | 43 | /* .s1{ 44 | 45 | background-image: linear-gradient(to right,white,black); 46 | } */ 47 | 48 | 49 | .divMain{ 50 | display: flex; 51 | 52 | background-color: black; 53 | color: white; 54 | } 55 | 56 | 57 | 58 | 59 | 60 | section { 61 | position: relative; 62 | width: 100%; 63 | 64 | background-size: cover; 65 | background-attachment: fixed; 66 | background-position: center; 67 | } 68 | 69 | 70 | .section-2 { 71 | background-color: white; 72 | height: -20rem; 73 | 74 | } 75 | .section-2 .fit-image{ 76 | 77 | height: 40rem; 78 | 79 | } 80 | 81 | 82 | 83 | .text{ 84 | justify-content: center; 85 | align-items: center; 86 | margin-top: 2.5rem; 87 | margin-left: 2rem; 88 | } 89 | 90 | .text #t1{ 91 | 92 | margin-left: 7rem; 93 | font-size: 1.5rem; 94 | 95 | } 96 | 97 | 98 | ul { 99 | list-style-type: none; /* Remove default list style */ 100 | margin: 1rem 3rem; /* Add some margin using rem units for spacing */ 101 | padding: 0; /* Remove default padding */ 102 | } 103 | 104 | li { 105 | font-size: 1.5rem; /* Font size using rem units */ 106 | margin-bottom: 0.2rem; /* Margin using rem units for spacing */ 107 | } 108 | 109 | ul.category { 110 | margin-left: 0; /* Reset margin for the category list */ 111 | } 112 | 113 | ul.category li { 114 | font-weight: bold; /* Make category items bold */ 115 | font-size: 1.5rem; /* Font size for category items */ 116 | margin-bottom: 0.2rem; /* Adjust margin for category items */ 117 | } 118 | 119 | ul.subcategory { 120 | list-style-type: disc; /* Use 'disc' for filled circles for subcategories */ 121 | margin-left: 2rem; /* Indent subcategories */ 122 | } 123 | 124 | ul.subcategory li { 125 | font-weight: normal; /* Reset font weight for subcategory items */ 126 | font-size: 1.3rem; /* Font size for subcategory items */ 127 | } 128 | 129 | 130 | 131 | .about{ 132 | background-color: white; 133 | } 134 | body { 135 | font-family: Arial, Helvetica, sans-serif; 136 | margin: 0; 137 | } 138 | 139 | html { 140 | box-sizing: border-box; 141 | } 142 | 143 | *, *:before, *:after { 144 | box-sizing: inherit; 145 | } 146 | 147 | .column { 148 | float: left; 149 | width: 33.3%; 150 | margin-bottom: 16px; 151 | padding: 0 8px; 152 | } 153 | 154 | .card { 155 | box-shadow: 10px 4px 8px 0 rgba(0, 0, 0, 0.2); 156 | margin: 18px; 157 | } 158 | 159 | .about-section { 160 | padding: 50px; 161 | text-align: center; 162 | background-color:black; 163 | color: white; 164 | } 165 | 166 | .container { 167 | padding: 0 16px; 168 | } 169 | 170 | .container::after, .row::after { 171 | content: ""; 172 | clear: both; 173 | display: table; 174 | } 175 | 176 | .title { 177 | color: grey; 178 | } 179 | 180 | .button { 181 | border: none; 182 | outline: 0; 183 | display: inline-block; 184 | padding: 8px; 185 | color: white; 186 | background-color: #000; 187 | text-align: center; 188 | cursor: pointer; 189 | width: 100%; 190 | } 191 | 192 | .button:hover { 193 | background-color: #555; 194 | } 195 | 196 | @media screen and (max-width: 650px) { 197 | .column { 198 | width: 100%; 199 | display: block; 200 | } 201 | } 202 | 203 | 204 | 205 | 206 | 207 | -------------------------------------------------------------------------------- /employee frontend final/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Inspiring leadership innovation. 11 | Employee Management System 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Second slide label 20 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 21 | 22 | 23 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | Techknowlogy Stack Used: 42 | 43 | 44 | Backend Techknowlogy 45 | 46 | Java 47 | Spring Boot 48 | 49 | 50 | Frontend Techknowlogy 51 | 52 | Angular 53 | 54 | 55 | Database Techknowlogy 56 | 57 | MySQL 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 103 | 104 | 105 | 106 | 107 | 108 | About Us Page 109 | 110 | 111 | Effectively and systematically manage and document the pertinent details and information of your employees to ensure a thorough and accurate record-keeping system within your organizational framework. 112 | 113 | 114 | Our Team 115 | 116 | 117 | 118 | 119 | 120 | 121 | Jane Doe 122 | CEO & Founder 123 | Some text that describes me lorem ipsum ipsum lorem. 124 | jane@example.com 125 | Contact 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | Mike Ross 135 | Art Director 136 | Some text that describes me lorem ipsum ipsum lorem. 137 | mike@example.com 138 | Contact 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | John Doe 148 | Designer 149 | Some text that describes me lorem ipsum ipsum lorem. 150 | john@example.com 151 | Contact 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /employee frontend final/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [HomeComponent] 12 | }); 13 | fixture = TestBed.createComponent(HomeComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /employee frontend final/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { NgbCarouselModule } from '@ng-bootstrap/ng-bootstrap'; 3 | import { Router } from '@angular/router'; 4 | 5 | @Component({ 6 | selector: 'app-home', 7 | templateUrl: './home.component.html', 8 | styleUrls: ['./home.component.css'], 9 | standalone: true, 10 | imports: [NgbCarouselModule] 11 | }) 12 | export class HomeComponent { 13 | 14 | constructor( 15 | 16 | private router: Router) { 17 | 18 | } 19 | goToEmployeeList(){ 20 | this.router.navigate(['/show-all-employees']); 21 | } 22 | // images = [944, 1011, 984].map((n) => `https://picsum.photos/id/${n}/2000/600`); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /employee frontend final/src/app/show-details/show-details.component.css: -------------------------------------------------------------------------------- 1 | table { 2 | width: 40%; 3 | margin-left: 8rem; 4 | margin-top: 0.5rem; 5 | border-collapse: collapse; 6 | outline: 1px solid black; 7 | } 8 | #btn1{ 9 | margin-left: 8rem; 10 | 11 | } 12 | 13 | #btn2{ 14 | margin-left: 1rem; 15 | } 16 | .box{ 17 | width: 100%; 18 | display: flex; 19 | flex-wrap: wrap; 20 | 21 | } 22 | 23 | img{ 24 | margin-top: 0.3rem; 25 | width: 15rem; 26 | height: 12rem; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /employee frontend final/src/app/show-details/show-details.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Employee Details 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Attribute 19 | Value 20 | 21 | 22 | 23 | 24 | 25 | 26 | Id 27 | {{employee.id}} 28 | 29 | 30 | First Name 31 | {{employee.fname}} 32 | 33 | 34 | Last Name 35 | {{employee.lname}} 36 | 37 | 38 | Email 39 | {{employee.email}} 40 | 41 | 42 | Salary 43 | {{employee.salary}} 44 | 45 | 46 | Department 47 | {{employee.department}} 48 | 49 | 50 | Designation 51 | {{employee.designation}} 52 | 53 | 54 | Joining Date 55 | {{employee.joiningDate}} 56 | 57 | 58 | 59 | 60 | 61 | Update Details 62 | Back 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /employee frontend final/src/app/show-details/show-details.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ShowDetailsComponent } from './show-details.component'; 4 | 5 | describe('ShowDetailsComponent', () => { 6 | let component: ShowDetailsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ShowDetailsComponent] 12 | }); 13 | fixture = TestBed.createComponent(ShowDetailsComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /employee frontend final/src/app/show-details/show-details.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Employee } from '../employee'; 3 | import { EmployeeService } from '../employee.service'; 4 | import { ActivatedRoute } from '@angular/router'; 5 | 6 | 7 | 8 | @Component({ 9 | selector: 'app-show-details', 10 | templateUrl: './show-details.component.html', 11 | styleUrls: ['./show-details.component.css'] 12 | }) 13 | export class ShowDetailsComponent { 14 | 15 | 16 | 17 | id: number 18 | employee!: Employee 19 | constructor(private route: ActivatedRoute, private employeService: EmployeeService) { 20 | 21 | this.id=0 22 | } 23 | 24 | ngOnInit(): void { 25 | this.id = this.route.snapshot.params['id']; 26 | 27 | this.employee = new Employee(); 28 | this.employeService.getEmployeeById(this.id).subscribe( data => { 29 | this.employee = data; 30 | }); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /employee frontend final/src/app/update-employee/update-employee.component.css: -------------------------------------------------------------------------------- 1 | form { 2 | border: 1px solid #454545; /* Add a 1px solid border with a light gray color */ 3 | padding: 20px; /* Add some padding for better visual appearance */ 4 | } 5 | 6 | .full-width-button { 7 | width: 100%; 8 | } 9 | 10 | .form-container { 11 | box-shadow: 10px 4px 8px rgba(0, 0, 0, 0.1); 12 | padding: 20px; /* Add some padding for better visual appearance */ 13 | } 14 | 15 | input{ 16 | border: 1px solid #000000; 17 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 18 | } 19 | button{box-shadow: 10px 4px 8px rgba(0, 0, 0, 0.1);} 20 | 21 | select{ 22 | border: 1px solid #000000; 23 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 24 | 25 | } -------------------------------------------------------------------------------- /employee frontend final/src/app/update-employee/update-employee.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | First Name 9 | 11 | 12 | First name is required 13 | First Name minimum 3 characters are required!!! 14 | 15 | 16 | 17 | 18 | 19 | 20 | Last Name 21 | 23 | 24 | 25 | Last name is required 26 | 27 | 28 | 29 | 30 | 31 | 32 | Email Id 33 | 35 | 36 | 37 | Email is required 38 | Invalid email format 39 | 40 | 41 | 42 | 43 | 44 | 45 | Department 46 | 48 | 49 | 50 | 51 | Department is required 52 | 53 | Choose... 54 | IT 55 | HR 56 | Finance 57 | Marketing 58 | 59 | 60 | 61 | 62 | Designation 63 | 65 | 66 | 67 | 68 | Designation is required 69 | 70 | Choose... 71 | Developer 72 | Manager 73 | Analyst 74 | Accountant 75 | Accountant 76 | 77 | 78 | 79 | 80 | 81 | 82 | Salary 83 | 85 | 86 | 87 | 88 | Salary is required 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 107 | 108 | 109 | 110 | Joining Date 111 | 114 | 115 | Joining Date is required 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | Submit 149 | 150 | 151 | 152 | Cancel 154 | 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /employee frontend final/src/app/update-employee/update-employee.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { UpdateEmployeeComponent } from './update-employee.component'; 4 | 5 | describe('UpdateEmployeeComponent', () => { 6 | let component: UpdateEmployeeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [UpdateEmployeeComponent] 12 | }); 13 | fixture = TestBed.createComponent(UpdateEmployeeComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /employee frontend final/src/app/update-employee/update-employee.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Employee } from '../employee'; 3 | import { Router } from '@angular/router'; 4 | import { EmployeeService } from '../employee.service'; 5 | import { ActivatedRoute } from '@angular/router'; 6 | 7 | 8 | @Component({ 9 | selector: 'app-update-employee', 10 | templateUrl: './update-employee.component.html', 11 | styleUrls: ['./update-employee.component.css'] 12 | }) 13 | export class UpdateEmployeeComponent { 14 | 15 | 16 | 17 | 18 | 19 | 20 | id: number; 21 | employee: Employee = new Employee(); 22 | 23 | 24 | constructor(private employeeService: EmployeeService, 25 | private route: ActivatedRoute, 26 | private router: Router) { 27 | this.id=0 28 | } 29 | //loading the data into form 30 | ngOnInit(): void { 31 | this.id = this.route.snapshot.params['id']; 32 | 33 | this.employeeService.getEmployeeById(this.id).subscribe(data => { 34 | this.employee = data; 35 | }, error => console.log(error)); 36 | 37 | 38 | } 39 | 40 | onSubmit(){ 41 | this.employeeService.updateEmployee(this.id, this.employee).subscribe( data =>{ 42 | this.goToEmployeeList(); 43 | } 44 | , error => console.log(error)); 45 | } 46 | 47 | goToEmployeeList(){ 48 | this.router.navigate(['/show-all-employees']); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /employee frontend final/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/assets/.gitkeep -------------------------------------------------------------------------------- /employee frontend final/src/assets/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/assets/1.jpg -------------------------------------------------------------------------------- /employee frontend final/src/assets/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/assets/2.jpg -------------------------------------------------------------------------------- /employee frontend final/src/assets/about-5.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/assets/about-5.webp -------------------------------------------------------------------------------- /employee frontend final/src/assets/download.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/assets/download.jpg -------------------------------------------------------------------------------- /employee frontend final/src/assets/gallery-3.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/assets/gallery-3.webp -------------------------------------------------------------------------------- /employee frontend final/src/assets/gallery-5.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/assets/gallery-5.webp -------------------------------------------------------------------------------- /employee frontend final/src/assets/login.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/assets/login.jpg -------------------------------------------------------------------------------- /employee frontend final/src/assets/noBgLogin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/assets/noBgLogin.png -------------------------------------------------------------------------------- /employee frontend final/src/assets/team1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/assets/team1.jpg -------------------------------------------------------------------------------- /employee frontend final/src/assets/team2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/assets/team2.jpg -------------------------------------------------------------------------------- /employee frontend final/src/assets/team3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/assets/team3.jpg -------------------------------------------------------------------------------- /employee frontend final/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityasurya4103/employee-management-system-angular-spring-boot-mysql/c9b0e7d312c50685f556e4013f521f4e5eb2d43a/employee frontend final/src/favicon.ico -------------------------------------------------------------------------------- /employee frontend final/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Frontend 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /employee frontend final/src/main.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | 5 | import { AppModule } from './app/app.module'; 6 | 7 | 8 | platformBrowserDynamic().bootstrapModule(AppModule) 9 | .catch(err => console.error(err)); 10 | -------------------------------------------------------------------------------- /employee frontend final/src/styles.css: -------------------------------------------------------------------------------- 1 | body{ 2 | min-height: 100vh; 3 | display: flex; 4 | flex-direction: column; 5 | background-color: rgb(240, 238, 238); 6 | } 7 | 8 | .footer { 9 | margin-top: auto; 10 | position: fixed; 11 | bottom: 0; 12 | width:100%; 13 | /* height: 40px; */ 14 | background-color: black; 15 | text-align: center; 16 | color: white; 17 | padding-top: 1.5rem; 18 | padding-bottom: 1.5rem; 19 | font-size: 1rem; 20 | } 21 | 22 | 23 | /* .container{ 24 | background-color: white; 25 | } */ 26 | html, body { height: 100%; } 27 | body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; } 28 | -------------------------------------------------------------------------------- /employee frontend final/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [ 7 | "@angular/localize" 8 | ] 9 | }, 10 | "files": [ 11 | "src/main.ts" 12 | ], 13 | "include": [ 14 | "src/**/*.d.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /employee frontend final/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitOverride": true, 10 | "noPropertyAccessFromIndexSignature": true, 11 | "noImplicitReturns": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "downlevelIteration": true, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "useDefineForClassFields": false, 22 | "lib": [ 23 | "ES2022", 24 | "dom" 25 | ] 26 | }, 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /employee frontend final/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine", 8 | "@angular/localize" 9 | ] 10 | }, 11 | "include": [ 12 | "src/**/*.spec.ts", 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | --------------------------------------------------------------------------------
Sign in with
OR
Don't have an account? Register
Employee Management System
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Effectively and systematically manage and document the pertinent details and information of your employees to ensure a thorough and accurate record-keeping system within your organizational framework.
CEO & Founder
Some text that describes me lorem ipsum ipsum lorem.
jane@example.com
Contact
Art Director
mike@example.com
Designer
john@example.com