├── Jenkinsfile ├── README.md ├── ansible ├── ansible.cfg ├── site.yml ├── templates │ ├── application.j2 │ ├── epel6-svcfile.j2 │ ├── epel7-svcfile.j2 │ ├── ubuntu14_15-svcfile.j2 │ └── ubuntu16-svcfile.j2 ├── tomcat_setup.yml └── vpro-app-setup.yml ├── pom.xml ├── src ├── main │ ├── java │ │ └── com │ │ │ └── visualpathit │ │ │ └── account │ │ │ ├── AuthenticationFailureHandler.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ ├── UserNotFoundException.java │ │ │ ├── beans │ │ │ └── Components.java │ │ │ ├── controller │ │ │ ├── ElasticSearchController.java │ │ │ ├── FileUploadController.java │ │ │ ├── RabbitMqController.java │ │ │ └── UserController.java │ │ │ ├── model │ │ │ ├── Role.java │ │ │ └── User.java │ │ │ ├── repository │ │ │ ├── RoleRepository.java │ │ │ └── UserRepository.java │ │ │ ├── service │ │ │ ├── ConsumerService.java │ │ │ ├── ConsumerServiceImpl.java │ │ │ ├── ProducerService.java │ │ │ ├── ProducerServiceImpl.java │ │ │ ├── SecurityService.java │ │ │ ├── SecurityServiceImpl.java │ │ │ ├── UserDetailsServiceImpl.java │ │ │ ├── UserService.java │ │ │ └── UserServiceImpl.java │ │ │ ├── utils │ │ │ ├── ElasticsearchUtil.java │ │ │ ├── MemcachedUtils.java │ │ │ └── RabbitMqUtil.java │ │ │ └── validator │ │ │ └── UserValidator.java │ ├── resources │ │ ├── accountsdb.sql │ │ ├── application.properties │ │ ├── db_backup.sql │ │ ├── logback.xml │ │ └── validation.properties │ └── webapp │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ ├── WEB-INF │ │ ├── appconfig-data.xml │ │ ├── appconfig-mvc.xml │ │ ├── appconfig-rabbitmq.xml │ │ ├── appconfig-root.xml │ │ ├── appconfig-security.xml │ │ ├── views │ │ │ ├── elasticeSearchRes.jsp │ │ │ ├── error │ │ │ │ ├── 404.jsp │ │ │ │ ├── 500.jsp │ │ │ │ └── database-error.jsp │ │ │ ├── index_home.jsp │ │ │ ├── login.jsp │ │ │ ├── rabbitmq-error.jsp │ │ │ ├── rabbitmq.jsp │ │ │ ├── registration.jsp │ │ │ ├── upload.jsp │ │ │ ├── user.jsp │ │ │ ├── userList.jsp │ │ │ ├── userUpdate.jsp │ │ │ └── welcome.jsp │ │ └── web.xml │ │ └── resources │ │ ├── Images │ │ ├── background.png │ │ ├── background1.jpg │ │ ├── bg-01.jpg │ │ ├── dev_img.jpeg │ │ ├── devops_img.png │ │ ├── header.jpg │ │ ├── icons │ │ │ └── favicon.ico │ │ ├── login-background.png │ │ ├── new-background.png │ │ ├── new-logo1.png │ │ ├── technologies │ │ │ ├── Ansible_logo.png │ │ │ ├── Vagrant.png │ │ │ ├── aws.png │ │ │ ├── docker.png │ │ │ ├── git.jpg │ │ │ ├── jenkins.png │ │ │ ├── puppet.jpg │ │ │ └── python-logo.png │ │ ├── user.png │ │ ├── user │ │ │ ├── giphy.gif │ │ │ ├── logo.png │ │ │ ├── user.png │ │ │ ├── user2.png │ │ │ └── user3.png │ │ ├── visualpath.png │ │ ├── visualpathlogo2.png │ │ └── visualpathlogo3.png │ │ ├── css │ │ ├── bootstrap.min.css │ │ ├── common.css │ │ ├── login.css │ │ ├── main.css │ │ ├── profile.css │ │ ├── util.css │ │ └── w3.css │ │ ├── fonts │ │ ├── font-awesome-4.7.0 │ │ │ ├── HELP-US-OUT.txt │ │ │ ├── css │ │ │ │ ├── font-awesome.css │ │ │ │ └── font-awesome.min.css │ │ │ ├── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.svg │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ └── fontawesome-webfont.woff2 │ │ │ ├── less │ │ │ │ ├── animated.less │ │ │ │ ├── bordered-pulled.less │ │ │ │ ├── core.less │ │ │ │ ├── fixed-width.less │ │ │ │ ├── font-awesome.less │ │ │ │ ├── icons.less │ │ │ │ ├── larger.less │ │ │ │ ├── list.less │ │ │ │ ├── mixins.less │ │ │ │ ├── path.less │ │ │ │ ├── rotated-flipped.less │ │ │ │ ├── screen-reader.less │ │ │ │ ├── stacked.less │ │ │ │ └── variables.less │ │ │ └── scss │ │ │ │ ├── _animated.scss │ │ │ │ ├── _bordered-pulled.scss │ │ │ │ ├── _core.scss │ │ │ │ ├── _fixed-width.scss │ │ │ │ ├── _icons.scss │ │ │ │ ├── _larger.scss │ │ │ │ ├── _list.scss │ │ │ │ ├── _mixins.scss │ │ │ │ ├── _path.scss │ │ │ │ ├── _rotated-flipped.scss │ │ │ │ ├── _screen-reader.scss │ │ │ │ ├── _stacked.scss │ │ │ │ ├── _variables.scss │ │ │ │ └── font-awesome.scss │ │ ├── iconic │ │ │ ├── css │ │ │ │ ├── material-design-iconic-font.css │ │ │ │ └── material-design-iconic-font.min.css │ │ │ └── fonts │ │ │ │ ├── Material-Design-Iconic-Font.eot │ │ │ │ ├── Material-Design-Iconic-Font.svg │ │ │ │ ├── Material-Design-Iconic-Font.ttf │ │ │ │ ├── Material-Design-Iconic-Font.woff │ │ │ │ └── Material-Design-Iconic-Font.woff2 │ │ └── poppins │ │ │ ├── Poppins-Black.ttf │ │ │ ├── Poppins-BlackItalic.ttf │ │ │ ├── Poppins-Bold.ttf │ │ │ ├── Poppins-BoldItalic.ttf │ │ │ ├── Poppins-ExtraBold.ttf │ │ │ ├── Poppins-ExtraBoldItalic.ttf │ │ │ ├── Poppins-ExtraLight.ttf │ │ │ ├── Poppins-ExtraLightItalic.ttf │ │ │ ├── Poppins-Italic.ttf │ │ │ ├── Poppins-Light.ttf │ │ │ ├── Poppins-LightItalic.ttf │ │ │ ├── Poppins-Medium.ttf │ │ │ ├── Poppins-MediumItalic.ttf │ │ │ ├── Poppins-Regular.ttf │ │ │ ├── Poppins-SemiBold.ttf │ │ │ ├── Poppins-SemiBoldItalic.ttf │ │ │ ├── Poppins-Thin.ttf │ │ │ └── Poppins-ThinItalic.ttf │ │ ├── js │ │ ├── bootstrap.min.js │ │ └── main.js │ │ └── vendor │ │ ├── animate │ │ └── animate.css │ │ ├── animsition │ │ ├── css │ │ │ ├── animsition.css │ │ │ └── animsition.min.css │ │ └── js │ │ │ ├── animsition.js │ │ │ └── animsition.min.js │ │ ├── bootstrap │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ └── js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ ├── popper.js │ │ │ ├── popper.min.js │ │ │ └── tooltip.js │ │ ├── countdowntime │ │ └── countdowntime.js │ │ ├── css-hamburgers │ │ ├── hamburgers.css │ │ └── hamburgers.min.css │ │ ├── daterangepicker │ │ ├── daterangepicker.css │ │ ├── daterangepicker.js │ │ ├── moment.js │ │ └── moment.min.js │ │ ├── jquery │ │ └── jquery-3.2.1.min.js │ │ ├── perfect-scrollbar │ │ ├── perfect-scrollbar.css │ │ └── perfect-scrollbar.min.js │ │ └── select2 │ │ ├── select2.css │ │ ├── select2.js │ │ ├── select2.min.css │ │ └── select2.min.js └── test │ └── java │ └── com │ └── visualpathit │ └── account │ ├── controllerTest │ ├── SampleTest.java │ └── UserControllerTest.java │ ├── modelTest │ ├── RoleTest.java │ └── UserTest.java │ └── setup │ └── StandaloneMvcTestViewResolver.java └── vagrant ├── Automated_provisioning_MacOSM1 ├── Vagrantfile ├── backend.sh ├── memcache.sh ├── mysql.sh ├── nginx.sh ├── rabbitmq.sh ├── tomcat.sh └── tomcat_ubuntu.sh ├── Automated_provisioning_WinMacIntel ├── Vagrantfile ├── application.properties ├── backend.sh ├── memcache.sh ├── mysql.sh ├── nginx.sh ├── rabbitmq.sh ├── tomcat.sh └── tomcat_ubuntu.sh ├── Manual_provisioning_MacOSM1 ├── Vagrantfile └── VprofileProjectSetupMacM1M2.pdf └── Manual_provisioning_WinMacIntel ├── Vagrantfile └── VprofileProjectSetupWindowsAndMacIntel.pdf /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | 3 | agent any 4 | 5 | tools { 6 | jdk "JDK17" 7 | maven "MAVEN3.9" 8 | } 9 | 10 | environment { 11 | NEXUS_VERSION = "nexus3" 12 | NEXUS_PROTOCOL = "http" 13 | NEXUS_URL = "172.31.40.209:8081" 14 | NEXUS_REPOSITORY = "vprofile-release" 15 | NEXUS_REPO_ID = "vprofile-release" 16 | NEXUS_CREDENTIAL_ID = "nexuslogin" 17 | ARTVERSION = "${env.BUILD_ID}" 18 | } 19 | 20 | stages{ 21 | 22 | stage('BUILD'){ 23 | steps { 24 | sh 'mvn clean install -DskipTests' 25 | } 26 | post { 27 | success { 28 | echo 'Now Archiving...' 29 | archiveArtifacts artifacts: '**/target/*.war' 30 | } 31 | } 32 | } 33 | 34 | stage('UNIT TEST'){ 35 | steps { 36 | sh 'mvn test' 37 | } 38 | } 39 | 40 | stage('INTEGRATION TEST'){ 41 | steps { 42 | sh 'mvn verify -DskipUnitTests' 43 | } 44 | } 45 | 46 | stage ('CODE ANALYSIS WITH CHECKSTYLE'){ 47 | steps { 48 | sh 'mvn checkstyle:checkstyle' 49 | } 50 | post { 51 | success { 52 | echo 'Generated Analysis Result' 53 | } 54 | } 55 | } 56 | 57 | stage('CODE ANALYSIS with SONARQUBE') { 58 | 59 | environment { 60 | scannerHome = tool 'sonarscanner4' 61 | } 62 | 63 | steps { 64 | withSonarQubeEnv('sonar-pro') { 65 | sh '''${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=vprofile \ 66 | -Dsonar.projectName=vprofile-repo \ 67 | -Dsonar.projectVersion=1.0 \ 68 | -Dsonar.sources=src/ \ 69 | -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \ 70 | -Dsonar.junit.reportsPath=target/surefire-reports/ \ 71 | -Dsonar.jacoco.reportsPath=target/jacoco.exec \ 72 | -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' 73 | } 74 | 75 | timeout(time: 10, unit: 'MINUTES') { 76 | waitForQualityGate abortPipeline: true 77 | } 78 | } 79 | } 80 | 81 | stage("Publish to Nexus Repository Manager") { 82 | steps { 83 | script { 84 | pom = readMavenPom file: "pom.xml"; 85 | filesByGlob = findFiles(glob: "target/*.${pom.packaging}"); 86 | echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}" 87 | artifactPath = filesByGlob[0].path; 88 | artifactExists = fileExists artifactPath; 89 | if(artifactExists) { 90 | echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version} ARTVERSION"; 91 | nexusArtifactUploader( 92 | nexusVersion: NEXUS_VERSION, 93 | protocol: NEXUS_PROTOCOL, 94 | nexusUrl: NEXUS_URL, 95 | groupId: pom.groupId, 96 | version: ARTVERSION, 97 | repository: NEXUS_REPOSITORY, 98 | credentialsId: NEXUS_CREDENTIAL_ID, 99 | artifacts: [ 100 | [artifactId: pom.artifactId, 101 | classifier: '', 102 | file: artifactPath, 103 | type: pom.packaging], 104 | [artifactId: pom.artifactId, 105 | classifier: '', 106 | file: "pom.xml", 107 | type: "pom"] 108 | ] 109 | ); 110 | } 111 | else { 112 | error "*** File: ${artifactPath}, could not be found"; 113 | } 114 | } 115 | } 116 | } 117 | 118 | 119 | } 120 | 121 | 122 | } 123 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | # 3 | - JDK 17 or 21 4 | - Maven 3.9 5 | - MySQL 8 6 | 7 | # Technologies 8 | - Spring MVC 9 | - Spring Security 10 | - Spring Data JPA 11 | - Maven 12 | - JSP 13 | - Tomcat 14 | - MySQL 15 | - Memcached 16 | - Rabbitmq 17 | - ElasticSearch 18 | # Database 19 | Here,we used Mysql DB 20 | sql dump file: 21 | - /src/main/resources/db_backup.sql 22 | - db_backup.sql file is a mysql dump file.we have to import this dump to mysql db server 23 | - > mysql -u -p accounts < db_backup.sql 24 | 25 | 26 | -------------------------------------------------------------------------------- /ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | host_key_checking = False 3 | timeout = 35 4 | -------------------------------------------------------------------------------- /ansible/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - import_playbook: tomcat_setup.yml 3 | - import_playbook: vpro-app-setup.yml 4 | 5 | #### 6 | -------------------------------------------------------------------------------- /ansible/templates/application.j2: -------------------------------------------------------------------------------- 1 | #JDBC Configutation for Database Connection 2 | jdbc.driverClassName=com.mysql.jdbc.Driver 3 | jdbc.url=jdbc:mysql://dbhost:3306/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 4 | jdbc.username=db_user 5 | jdbc.password=db_password 6 | 7 | #Memcached Configuration For Active and StandBy Host 8 | #For Active Host 9 | memcached.active.host=127.0.0.1 10 | memcached.active.port=11211 11 | #For StandBy Host 12 | memcached.standBy.host=127.0.0.2 13 | memcached.standBy.port=11211 14 | 15 | #RabbitMq Configuration 16 | rabbitmq.address=18.220.62.126 17 | rabbitmq.port=5672 18 | rabbitmq.username=test 19 | rabbitmq.password=test 20 | 21 | #Elasticesearch Configuration 22 | elasticsearch.host =192.168.1.85 23 | elasticsearch.port =9300 24 | elasticsearch.cluster=vprofile 25 | elasticsearch.node=vprofilenode 26 | -------------------------------------------------------------------------------- /ansible/templates/epel6-svcfile.j2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### BEGIN INIT INFO 4 | # Provides: tomcat7 5 | # Required-Start: $network 6 | # Required-Stop: $network 7 | # Default-Start: 2 3 4 5 8 | # Default-Stop: 0 1 6 9 | # Short-Description: Start/Stop Tomcat server 10 | ### END INIT INFO 11 | 12 | PATH=/sbin:/bin:/usr/sbin:/usr/bin 13 | 14 | start() { 15 | sh /usr/local/tomcat8/bin/startup.sh 16 | } 17 | 18 | stop() { 19 | sh /usr/local/tomcat8/bin/shutdown.sh 20 | } 21 | 22 | status() { 23 | pid=$(ps -fe | grep '/usr/local/tomcat8' | grep -v grep | tr -s " " | cut -d" " -f2) 24 | if [ -n "$pid" ]; then 25 | echo -e "\e[00;32mTomcat is running with pid: $pid\e[00m" 26 | else 27 | echo -e "\e[00;31mTomcat is not running\e[00m" 28 | fi 29 | } 30 | 31 | case $1 in 32 | start|stop|status) $1;; 33 | restart) stop; start;; 34 | *) echo "Run as $0 "; exit 1;; 35 | esac 36 | exit 0 37 | 38 | 39 | -------------------------------------------------------------------------------- /ansible/templates/epel7-svcfile.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Tomcat 3 | After=network.target 4 | 5 | [Service] 6 | User=tomcat 7 | WorkingDirectory=/usr/local/tomcat8 8 | Environment=JRE_HOME=/usr/lib/jvm/jre 9 | Environment=JAVA_HOME=/usr/lib/jvm/jre 10 | Environment=CATALINA_HOME=/usr/local/tomcat8 11 | Environment=CATALINE_BASE=/usr/local/tomcat8 12 | ExecStart=/usr/local/tomcat8/bin/catalina.sh run 13 | ExecStop=/usr/local/tomcat8/bin/shutdown.sh 14 | SyslogIdentifier=tomcat-%i 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | 19 | -------------------------------------------------------------------------------- /ansible/templates/ubuntu14_15-svcfile.j2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### BEGIN INIT INFO 4 | # Provides: tomcat7 5 | # Required-Start: $network 6 | # Required-Stop: $network 7 | # Default-Start: 2 3 4 5 8 | # Default-Stop: 0 1 6 9 | # Short-Description: Start/Stop Tomcat server 10 | ### END INIT INFO 11 | 12 | PATH=/sbin:/bin:/usr/sbin:/usr/bin 13 | 14 | start() { 15 | sh /usr/local/tomcat8/bin/startup.sh 16 | } 17 | 18 | stop() { 19 | sh /usr/local/tomcat8/bin/shutdown.sh 20 | } 21 | 22 | status() { 23 | pid=$(ps -fe | grep '/usr/local/tomcat8' | grep -v grep | tr -s " " | cut -d" " -f2) 24 | if [ -n "$pid" ]; then 25 | echo -e "\e[00;32mTomcat is running with pid: $pid\e[00m" 26 | else 27 | echo -e "\e[00;31mTomcat is not running\e[00m" 28 | fi 29 | } 30 | 31 | case $1 in 32 | start|stop|status) $1;; 33 | restart) stop; start;; 34 | *) echo "Run as $0 "; exit 1;; 35 | esac 36 | exit 0 37 | 38 | 39 | -------------------------------------------------------------------------------- /ansible/templates/ubuntu16-svcfile.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Tomcat 3 | After=network.target 4 | 5 | [Service] 6 | User=tomcat 7 | WorkingDirectory=/usr/local/tomcat8 8 | Environment=JRE_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre 9 | Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre 10 | Environment=CATALINA_HOME=/usr/local/tomcat8 11 | Environment=CATALINE_BASE=/usr/local/tomcat8 12 | ExecStart=/usr/local/tomcat8/bin/catalina.sh run 13 | ExecStop=/usr/local/tomcat8/bin/shutdown.sh 14 | SyslogIdentifier=tomcat-%i 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | 19 | -------------------------------------------------------------------------------- /ansible/tomcat_setup.yml: -------------------------------------------------------------------------------- 1 | - name: Common tool setup on all the servers 2 | hosts: appsrvgrp 3 | become: yes 4 | vars: 5 | tom_url: https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.37/bin/apache-tomcat-8.5.37.tar.gz 6 | 7 | tasks: 8 | - name: Install JDK on Centos 6/7 9 | yum: 10 | name: java-1.8.0-openjdk.x86_64 11 | state: present 12 | when: ansible_distribution == 'CentOS' 13 | 14 | - name: Install JDK on Ubuntu 14/15/16/18 15 | apt: 16 | name: openjdk-8-jdk 17 | state: present 18 | update_cache: yes 19 | when: ansible_distribution == 'Ubuntu' 20 | 21 | - name: Download Tomcat Tar Ball/Binaries 22 | get_url: 23 | url: "{{tom_url}}" 24 | dest: /tmp/tomcat-8.tar.gz 25 | 26 | - name: Add tomcat group 27 | group: 28 | name: tomcat 29 | state: present 30 | 31 | - name: Add tomcat user 32 | user: 33 | name: tomcat 34 | group: tomcat 35 | shell: /bin/nologin 36 | home: /usr/local/tomcat8 37 | 38 | - file: 39 | path: /tmp/tomcat8 40 | state: directory 41 | 42 | - name: Extract tomcat 43 | unarchive: 44 | src: /tmp/tomcat-8.tar.gz 45 | dest: /tmp/tomcat8/ 46 | remote_src: yes 47 | list_files: yes 48 | register: unarchive_info 49 | 50 | - debug: 51 | msg: "{{unarchive_info.files[0].split('/')[0]}}" 52 | 53 | - name: Synchronize /tmp/tomcat8/tomcat_cont /usr/local/tomcat8. 54 | synchronize: 55 | src: "/tmp/tomcat8/{{unarchive_info.files[0].split('/')[0]}}/" 56 | dest: /usr/local/tomcat8/ 57 | delegate_to: "{{ inventory_hostname }}" 58 | 59 | - name: Change ownership of /usr/local/tomcat8 60 | file: 61 | path: /usr/local/tomcat8 62 | owner: tomcat 63 | group: tomcat 64 | recurse: yes 65 | 66 | - name: Setup tomcat SVC file on Centos 7 67 | template: 68 | src: templates/epel7-svcfile.j2 69 | dest: /etc/systemd/system/tomcat.service 70 | mode: "a+x" 71 | when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' 72 | 73 | - name: Setup tomcat SVC file on Centos 6 74 | template: 75 | src: templates/epel6-svcfile.j2 76 | dest: /etc/init.d/tomcat 77 | mode: "a+x" 78 | when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6' 79 | 80 | - name: Setup tomcat SVC file on ubuntu 14/15 81 | template: 82 | src: templates/ubuntu14_15-svcfile.j2 83 | dest: /etc/init.d/tomcat 84 | mode: "a+x" 85 | when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version < '16' 86 | 87 | - name: Setup tomcat SVC file on ubuntu 16 and 18 88 | template: 89 | src: templates/ubuntu16-svcfile.j2 90 | dest: /etc/systemd/system/tomcat.service 91 | mode: "a+x" 92 | when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version >= '16' 93 | 94 | - name: Reload tomcat svc config in ubuntu 14/15 95 | command: update-rc.d tomcat defaults 96 | when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version < '16' 97 | 98 | - name: Reload tomcat svc config in Centos 6 99 | command: chkconfig --add tomcat 100 | when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6' 101 | 102 | - name: just force systemd to reread configs (2.4 and above) 103 | systemd: 104 | daemon_reload: yes 105 | when: ansible_distribution_major_version > '6' or ansible_distribution_major_version > '15' 106 | 107 | - name: Start & Enable TOmcat 8 108 | service: 109 | name: tomcat 110 | state: started 111 | enabled: yes 112 | 113 | 114 | -------------------------------------------------------------------------------- /ansible/vpro-app-setup.yml: -------------------------------------------------------------------------------- 1 | 2 | - name: Setup Tomcat8 & Deploy Artifact 3 | hosts: appsrvgrp 4 | become: yes 5 | vars: 6 | timestamp: "{{ansible_date_time.date}}_{{ansible_date_time.hour}}_{{ansible_date_time.minute}}" 7 | tasks: 8 | - name: Download latest VProfile.war from nexus 9 | get_url: 10 | url: "http://{{USER}}:{{PASS}}@{{nexusip}}:8081/repository/{{reponame}}/{{groupid}}/{{time}}/{{build}}/{{vprofile_version}}" 11 | dest: "/tmp/vproapp-{{vprofile_version}}" 12 | register: wardeploy 13 | tags: 14 | - deploy 15 | 16 | - stat: 17 | path: /usr/local/tomcat8/webapps/ROOT 18 | register: artifact_stat 19 | tags: 20 | - deploy 21 | 22 | - name: Stop tomcat svc 23 | service: 24 | name: tomcat 25 | state: stopped 26 | tags: 27 | - deploy 28 | 29 | - name: Try Backup and Deploy 30 | block: 31 | - name: Archive ROOT dir with timestamp 32 | archive: 33 | path: /usr/local/tomcat8/webapps/ROOT 34 | dest: "/opt/ROOT_{{timestamp}}.tgz" 35 | when: artifact_stat.stat.exists 36 | register: archive_info 37 | tags: 38 | - deploy 39 | 40 | - name: copy ROOT dir with old_ROOT name 41 | shell: cp -r ROOT old_ROOT 42 | args: 43 | chdir: /usr/local/tomcat8/webapps/ 44 | 45 | - name: Delete current artifact 46 | file: 47 | path: "{{item}}" 48 | state: absent 49 | when: archive_info.changed 50 | loop: 51 | - /usr/local/tomcat8/webapps/ROOT 52 | - /usr/local/tomcat8/webapps/ROOT.war 53 | tags: 54 | - deploy 55 | 56 | - name: Try deploy artifact else restore from previos old_ROOT 57 | block: 58 | - name: Deploy vprofile artifact 59 | copy: 60 | src: "/tmp/vproapp-{{vprofile_version}}" 61 | dest: /usr/local/tomcat8/webapps/ROOT.war 62 | remote_src: yes 63 | register: deploy_info 64 | tags: 65 | - deploy 66 | rescue: 67 | - shell: cp -r old_ROOT ROOT 68 | args: 69 | chdir: /usr/local/tomcat8/webapps/ 70 | 71 | rescue: 72 | - name: Start tomcat svc 73 | service: 74 | name: tomcat 75 | state: started 76 | 77 | - name: Start tomcat svc 78 | service: 79 | name: tomcat 80 | state: started 81 | when: deploy_info.changed 82 | tags: 83 | - deploy 84 | 85 | - name: Wait until ROOT.war is extracted to ROOT directory 86 | wait_for: 87 | path: /usr/local/tomcat8/webapps/ROOT 88 | tags: 89 | - deploy 90 | 91 | # - name: Deploy web configuration file 92 | # template: 93 | # src: templates/application.j2 94 | # dest: /usr/local/tomcat8/webapps/ROOT/WEB-INF/classes/application.properties 95 | # force: yes 96 | # notify: 97 | # - Restart Tomcat 98 | # tags: 99 | # - deploy 100 | 101 | handlers: 102 | - name: Restart Tomcat 103 | service: 104 | name: tomcat 105 | state: restarted 106 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/AuthenticationFailureHandler.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account; 2 | 3 | import jakarta.servlet.http.HttpServletRequest; 4 | import jakarta.servlet.http.HttpServletResponse; 5 | import org.springframework.security.core.AuthenticationException; 6 | import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler; 7 | 8 | import java.io.IOException; 9 | 10 | public class AuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler { 11 | 12 | @Override 13 | public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, 14 | AuthenticationException exception) throws IOException { 15 | // Redirect to custom error page 16 | getRedirectStrategy().sendRedirect(request, response, "/login?error"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account; 2 | 3 | import jakarta.servlet.http.HttpServletRequest; 4 | import org.springframework.security.authentication.BadCredentialsException; 5 | import org.springframework.web.bind.annotation.ControllerAdvice; 6 | import org.springframework.web.bind.annotation.ExceptionHandler; 7 | 8 | @ControllerAdvice 9 | public class GlobalExceptionHandler { 10 | 11 | @ExceptionHandler(UserNotFoundException.class) 12 | public String handleUserNotFoundException(UserNotFoundException ex, HttpServletRequest request) { 13 | request.setAttribute("errorMessage", ex.getMessage()); 14 | return "forward:/WEB-INF/views/error/404.jsp"; 15 | } 16 | 17 | @ExceptionHandler(BadCredentialsException.class) 18 | public String handleBadCredentialsException(BadCredentialsException ex, HttpServletRequest request) { 19 | request.setAttribute("errorMessage", "Invalid username or password."); 20 | return "forward:/WEB-INF/views/error/500.jsp"; // You can choose a different page for BadCredentialsException if preferred 21 | } 22 | 23 | @ExceptionHandler(Exception.class) 24 | public String handleGenericException(Exception ex, HttpServletRequest request) { 25 | request.setAttribute("errorMessage", "An unexpected error occurred. Please try again later."); 26 | return "forward:/WEB-INF/views/error/500.jsp"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/UserNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account; 2 | 3 | public class UserNotFoundException extends RuntimeException { 4 | public UserNotFoundException(String message) { 5 | super(message); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/beans/Components.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.beans; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class Components { 8 | 9 | @Value("${memcached.active.host}") 10 | private String activeHost; 11 | @Value("${memcached.active.port}") 12 | private String activePort; 13 | @Value("${memcached.standBy.host}") 14 | private String standByHost; 15 | @Value("${memcached.standBy.port}") 16 | private String standByPort; 17 | 18 | @Value("${rabbitmq.address}") 19 | private String rabbitMqHost; 20 | @Value("${rabbitmq.port}") 21 | private String rabbitMqPort; 22 | @Value("${rabbitmq.username}") 23 | private String rabbitMqUser; 24 | @Value("${rabbitmq.password}") 25 | private String rabbitMqPassword; 26 | 27 | @Value("${elasticsearch.host}") 28 | private String elasticsearchHost; 29 | @Value("${elasticsearch.port}") 30 | private String elasticsearchPort; 31 | @Value("${elasticsearch.cluster}") 32 | private String elasticsearchCluster; 33 | @Value("${elasticsearch.node}") 34 | private String elasticsearchNode; 35 | 36 | 37 | public String getActiveHost() { 38 | return activeHost; 39 | } 40 | public String getActivePort() { 41 | return activePort; 42 | } 43 | public String getStandByHost() { 44 | return standByHost; 45 | } 46 | public String getStandByPort() { 47 | return standByPort; 48 | } 49 | public void setActiveHost(String activeHost) { 50 | this.activeHost = activeHost; 51 | } 52 | public void setActivePort(String activePort) { 53 | this.activePort = activePort; 54 | } 55 | public void setStandByHost(String standByHost) { 56 | this.standByHost = standByHost; 57 | } 58 | public void setStandByPort(String standByPort) { 59 | this.standByPort = standByPort; 60 | } 61 | public String getRabbitMqHost() { 62 | return rabbitMqHost; 63 | } 64 | public void setRabbitMqHost(String rabbitMqHost) { 65 | this.rabbitMqHost = rabbitMqHost; 66 | } 67 | public String getRabbitMqPort() { 68 | return rabbitMqPort; 69 | } 70 | public void setRabbitMqPort(String rabbitMqPort) { 71 | this.rabbitMqPort = rabbitMqPort; 72 | } 73 | public String getRabbitMqUser() { 74 | return rabbitMqUser; 75 | } 76 | public void setRabbitMqUser(String rabbitMqUser) { 77 | this.rabbitMqUser = rabbitMqUser; 78 | } 79 | public String getRabbitMqPassword() { 80 | return rabbitMqPassword; 81 | } 82 | public void setRabbitMqPassword(String rabbitMqPassword) { 83 | this.rabbitMqPassword = rabbitMqPassword; 84 | } 85 | public String getElasticsearchHost() { 86 | return elasticsearchHost; 87 | } 88 | public void setElasticsearchHost(String elasticsearchHost) { 89 | this.elasticsearchHost = elasticsearchHost; 90 | } 91 | public String getElasticsearchPort() { 92 | return elasticsearchPort; 93 | } 94 | public void setElasticsearchPort(String elasticsearchPort) { 95 | this.elasticsearchPort = elasticsearchPort; 96 | } 97 | public String getElasticsearchCluster() { 98 | return elasticsearchCluster; 99 | } 100 | public void setElasticsearchCluster(String elasticsearchCluster) { 101 | this.elasticsearchCluster = elasticsearchCluster; 102 | } 103 | public String getElasticsearchNode() { 104 | return elasticsearchNode; 105 | } 106 | public void setElasticsearchNode(String elasticsearchNode) { 107 | this.elasticsearchNode = elasticsearchNode; 108 | } 109 | 110 | 111 | } 112 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/controller/ElasticSearchController.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controller; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | import org.apache.http.HttpHost; 7 | import org.elasticsearch.action.delete.DeleteRequest; 8 | import org.elasticsearch.action.delete.DeleteResponse; 9 | import org.elasticsearch.action.get.GetRequest; 10 | import org.elasticsearch.action.get.GetResponse; 11 | import org.elasticsearch.action.index.IndexRequest; 12 | import org.elasticsearch.action.index.IndexResponse; 13 | import org.elasticsearch.action.update.UpdateRequest; 14 | import org.elasticsearch.action.update.UpdateResponse; 15 | import org.elasticsearch.client.RequestOptions; 16 | import org.elasticsearch.client.RestHighLevelClient; 17 | import org.elasticsearch.common.xcontent.XContentBuilder; 18 | import org.elasticsearch.common.xcontent.XContentFactory; 19 | import org.springframework.beans.factory.annotation.Autowired; 20 | import org.springframework.stereotype.Controller; 21 | import org.springframework.ui.Model; 22 | import org.springframework.web.bind.annotation.PathVariable; 23 | import org.springframework.web.bind.annotation.RequestMapping; 24 | import org.springframework.web.bind.annotation.RequestMethod; 25 | 26 | import com.visualpathit.account.model.User; 27 | import com.visualpathit.account.service.UserService; 28 | import com.visualpathit.account.utils.ElasticsearchUtil; 29 | 30 | @Controller 31 | public class ElasticSearchController { 32 | 33 | @Autowired 34 | private UserService userService; 35 | 36 | @RequestMapping(value = "/user/elasticsearch", method = RequestMethod.GET) 37 | public String insert(final Model model) throws IOException { 38 | List users = userService.getList(); 39 | 40 | try (RestHighLevelClient client = ElasticsearchUtil.getRestHighLevelClient()) { 41 | for (User user : users) { 42 | IndexRequest indexRequest = new IndexRequest("users", "_doc", String.valueOf(user.getId())) 43 | .source(XContentFactory.jsonBuilder() 44 | .startObject() 45 | .field("name", user.getUsername()) 46 | .field("DOB", user.getDateOfBirth()) 47 | .field("fatherName", user.getFatherName()) 48 | .field("motherName", user.getMotherName()) 49 | .field("gender", user.getGender()) 50 | .field("nationality", user.getNationality()) 51 | .field("phoneNumber", user.getPhoneNumber()) 52 | .endObject()); 53 | 54 | IndexResponse response = client.index(indexRequest, RequestOptions.DEFAULT); 55 | String res = response.getResult().toString(); 56 | System.out.println(res); 57 | } 58 | } 59 | 60 | model.addAttribute("result", "Users indexed successfully"); 61 | return "elasticeSearchRes"; 62 | } 63 | 64 | @RequestMapping(value = "/rest/users/view/{id}", method = RequestMethod.GET) 65 | public String view(@PathVariable final String id, final Model model) throws IOException { 66 | try (RestHighLevelClient client = ElasticsearchUtil.getRestHighLevelClient()) { 67 | GetRequest getRequest = new GetRequest("users", "_doc", id); 68 | GetResponse getResponse = client.get(getRequest, RequestOptions.DEFAULT); 69 | 70 | System.out.println(getResponse.getSourceAsString()); 71 | model.addAttribute("res", getResponse.getSource().get("name")); 72 | } 73 | 74 | return "elasticeSearchRes"; 75 | } 76 | 77 | @RequestMapping(value = "/rest/users/update/{id}", method = RequestMethod.GET) 78 | public String update(@PathVariable final String id, final Model model) throws IOException { 79 | try (RestHighLevelClient client = ElasticsearchUtil.getRestHighLevelClient()) { 80 | UpdateRequest updateRequest = new UpdateRequest("users", "_doc", id) 81 | .doc(XContentFactory.jsonBuilder() 82 | .startObject() 83 | .field("gender", "male") 84 | .endObject()); 85 | 86 | UpdateResponse updateResponse = client.update(updateRequest, RequestOptions.DEFAULT); 87 | System.out.println(updateResponse.status()); 88 | model.addAttribute("res", updateResponse.status()); 89 | } 90 | 91 | return "elasticeSearchRes"; 92 | } 93 | 94 | @RequestMapping(value = "/rest/users/delete/{id}", method = RequestMethod.GET) 95 | public String delete(@PathVariable final String id, final Model model) throws IOException { 96 | try (RestHighLevelClient client = ElasticsearchUtil.getRestHighLevelClient()) { 97 | DeleteRequest deleteRequest = new DeleteRequest("users", "_doc", id); 98 | DeleteResponse deleteResponse = client.delete(deleteRequest, RequestOptions.DEFAULT); 99 | 100 | System.out.println(deleteResponse.getResult().toString()); 101 | model.addAttribute("res", deleteResponse.getResult().toString()); 102 | } 103 | 104 | return "elasticeSearchRes"; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/controller/FileUploadController.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controller; 2 | 3 | import java.io.BufferedOutputStream; 4 | import java.io.File; 5 | import java.io.FileOutputStream; 6 | import java.util.List; 7 | 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.ui.Model; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RequestMethod; 15 | import org.springframework.web.bind.annotation.RequestParam; 16 | import org.springframework.web.bind.annotation.ResponseBody; 17 | import org.springframework.web.multipart.MultipartFile; 18 | 19 | import com.visualpathit.account.model.User; 20 | import com.visualpathit.account.service.UserService; 21 | 22 | @Controller 23 | public class FileUploadController { 24 | @Autowired 25 | private UserService userService; 26 | private static final Logger logger = LoggerFactory 27 | .getLogger(FileUploadController.class); 28 | 29 | /** 30 | * Upload single file using Spring Controller 31 | */ 32 | @RequestMapping(value = { "/upload"} , method = RequestMethod.GET) 33 | public final String upload(final Model model) { 34 | return "upload"; 35 | } 36 | @RequestMapping(value = "/uploadFile", method = RequestMethod.POST) 37 | public @ResponseBody 38 | String uploadFileHandler(@RequestParam("name") String name,@RequestParam("userName") String userName, 39 | @RequestParam("file") MultipartFile file) { 40 | 41 | System.out.println("Called the upload file :::" ); 42 | if (!file.isEmpty()) { 43 | try { 44 | byte[] bytes = file.getBytes(); 45 | 46 | // Creating the directory to store file 47 | String rootPath = System.getProperty("catalina.home"); 48 | System.out.println("Path ::::" +rootPath); 49 | File dir = new File(rootPath + File.separator + "tmpFiles"); 50 | if (!dir.exists()) 51 | dir.mkdirs(); 52 | 53 | // Create the file on server 54 | File serverFile = new File(dir.getAbsolutePath() 55 | + File.separator + name+".png"); 56 | //image saving 57 | User user = userService.findByUsername(userName); 58 | user.setProfileImg(name +".png"); 59 | user.setProfileImgPath(serverFile.getAbsolutePath()); 60 | userService.save(user); 61 | 62 | BufferedOutputStream stream = new BufferedOutputStream( 63 | new FileOutputStream(serverFile)); 64 | stream.write(bytes); 65 | stream.close(); 66 | 67 | logger.info("Server File Location=" 68 | + serverFile.getAbsolutePath()); 69 | 70 | return "You successfully uploaded file=" + name +".png"; 71 | } catch (Exception e) { 72 | return "You failed to upload " + name +".png" + " => " + e.getMessage(); 73 | } 74 | } else { 75 | return "You failed to upload " + name +".png" 76 | + " because the file was empty."; 77 | } 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/controller/RabbitMqController.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.servlet.ModelAndView; 7 | 8 | import com.rabbitmq.client.Connection; 9 | import com.rabbitmq.client.ConnectionFactory; 10 | import com.visualpathit.account.utils.RabbitMqUtil; 11 | 12 | import java.io.IOException; 13 | import java.util.concurrent.TimeoutException; 14 | 15 | @Controller 16 | public class RabbitMqController { 17 | 18 | @Autowired 19 | private RabbitMqUtil rabbitMqUtil; 20 | 21 | @GetMapping("/user/rabbit") 22 | public ModelAndView checkRabbitMqStatus() { 23 | ModelAndView modelAndView = new ModelAndView(); 24 | ConnectionFactory factory = new ConnectionFactory(); 25 | factory.setHost(RabbitMqUtil.getRabbitMqHost()); 26 | factory.setPort(Integer.parseInt(RabbitMqUtil.getRabbitMqPort())); 27 | factory.setUsername(RabbitMqUtil.getRabbitMqUser()); 28 | factory.setPassword(RabbitMqUtil.getRabbitMqPassword()); 29 | 30 | Connection connection = null; 31 | try { 32 | connection = factory.newConnection(); 33 | if (connection.isOpen()) { 34 | modelAndView.setViewName("rabbitmq"); 35 | } else { 36 | modelAndView.setViewName("rabbitmq-error"); 37 | } 38 | } catch (IOException | TimeoutException e) { 39 | modelAndView.setViewName("rabbitmq-error"); 40 | } finally { 41 | if (connection != null) { 42 | try { 43 | connection.close(); 44 | } catch (IOException e) { 45 | // Log the exception if needed 46 | } 47 | } 48 | } 49 | return modelAndView; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controller; 2 | 3 | import com.visualpathit.account.model.User; 4 | import com.visualpathit.account.service.ProducerService; 5 | import com.visualpathit.account.service.SecurityService; 6 | import com.visualpathit.account.service.UserService; 7 | import com.visualpathit.account.utils.MemcachedUtils; 8 | import com.visualpathit.account.validator.UserValidator; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.ui.Model; 12 | import org.springframework.validation.BindingResult; 13 | import org.springframework.web.bind.annotation.*; 14 | 15 | import javax.validation.Valid; 16 | import java.util.List; 17 | import java.util.UUID; 18 | 19 | @Controller 20 | public class UserController { 21 | 22 | @Autowired 23 | private UserService userService; 24 | 25 | @Autowired 26 | private SecurityService securityService; 27 | 28 | @Autowired 29 | private UserValidator userValidator; 30 | 31 | @Autowired 32 | private ProducerService producerService; 33 | 34 | @GetMapping("/registration") 35 | public String registration(Model model) { 36 | model.addAttribute("userForm", new User()); 37 | return "registration"; 38 | } 39 | 40 | @PostMapping("/registration") 41 | public String registration(@ModelAttribute("userForm") @Valid User userForm, BindingResult bindingResult, Model model) { 42 | userValidator.validate(userForm, bindingResult); 43 | 44 | if (bindingResult.hasErrors()) { 45 | return "registration"; 46 | } 47 | 48 | userService.save(userForm); 49 | boolean loginSuccessful = securityService.autologin(userForm.getUsername(), userForm.getPasswordConfirm()); 50 | if (!loginSuccessful) { 51 | return "redirect:/login?error"; 52 | } 53 | 54 | return "redirect:/welcome"; 55 | } 56 | 57 | @GetMapping("/") 58 | public String login(Model model, @RequestParam(value = "error", required = false) String error, 59 | @RequestParam(value = "logout", required = false) String logout) { 60 | if (error != null) { 61 | model.addAttribute("error", "Your username and password is invalid."); 62 | } 63 | if (logout != null) { 64 | model.addAttribute("message", "You have been logged out successfully."); 65 | } 66 | return "login"; 67 | } 68 | 69 | @PostMapping("/login") 70 | public String loginPost(@ModelAttribute("user") User user, Model model) { 71 | boolean loginSuccessful = securityService.autologin(user.getUsername(), user.getPassword()); 72 | if (!loginSuccessful) { 73 | model.addAttribute("error", "Your username and password is invalid."); 74 | return "login"; 75 | } 76 | return "redirect:/welcome"; 77 | } 78 | 79 | @GetMapping("/welcome") 80 | public String welcome(Model model) { 81 | return "welcome"; 82 | } 83 | 84 | @GetMapping("/index") 85 | public String indexHome(Model model) { 86 | return "index_home"; 87 | } 88 | 89 | @GetMapping("/users") 90 | public String getAllUsers(Model model) { 91 | List users = userService.getList(); 92 | model.addAttribute("users", users); 93 | return "userList"; 94 | } 95 | 96 | @GetMapping("/users/{id}") 97 | public String getOneUser(@PathVariable("id") String id, Model model) { 98 | String result; 99 | try { 100 | User userData = MemcachedUtils.memcachedGetData(id); 101 | if (userData != null) { 102 | result = "Data is From Cache"; 103 | model.addAttribute("user", userData); 104 | } else { 105 | User user = userService.findById(Long.parseLong(id)); 106 | result = MemcachedUtils.memcachedSetData(user, id); 107 | if (result == null) { 108 | result = "Memcached Connection Failure !!"; 109 | } 110 | model.addAttribute("user", user); 111 | } 112 | model.addAttribute("Result", result); 113 | } catch (Exception e) { 114 | e.printStackTrace(); 115 | } 116 | return "user"; 117 | } 118 | 119 | @GetMapping("/user/{username}") 120 | public String userUpdate(@PathVariable("username") String username, Model model) { 121 | User user = userService.findByUsername(username); 122 | model.addAttribute("user", user); 123 | return "userUpdate"; 124 | } 125 | 126 | @PostMapping("/user/{username}") 127 | public String userUpdateProfile(@PathVariable("username") String username, @ModelAttribute("user") User userForm) { 128 | User user = userService.findByUsername(username); 129 | updateUserDetails(user, userForm); 130 | userService.save(user); 131 | return "welcome"; 132 | } 133 | 134 | // @GetMapping("/user/rabbit") 135 | // public String rabbitmqSetUp() { 136 | // for (int i = 0; i < 20; i++) { 137 | // producerService.produceMessage(generateString()); 138 | // } 139 | // return "rabbitmq"; 140 | // } 141 | 142 | private void updateUserDetails(User user, User userForm) { 143 | user.setUsername(userForm.getUsername()); 144 | user.setUserEmail(userForm.getUserEmail()); 145 | user.setDateOfBirth(userForm.getDateOfBirth()); 146 | user.setFatherName(userForm.getFatherName()); 147 | user.setMotherName(userForm.getMotherName()); 148 | user.setGender(userForm.getGender()); 149 | user.setLanguage(userForm.getLanguage()); 150 | user.setMaritalStatus(userForm.getMaritalStatus()); 151 | user.setNationality(userForm.getNationality()); 152 | user.setPermanentAddress(userForm.getPermanentAddress()); 153 | user.setTempAddress(userForm.getTempAddress()); 154 | user.setPhoneNumber(userForm.getPhoneNumber()); 155 | user.setSecondaryPhoneNumber(userForm.getSecondaryPhoneNumber()); 156 | user.setPrimaryOccupation(userForm.getPrimaryOccupation()); 157 | user.setSecondaryOccupation(userForm.getSecondaryOccupation()); 158 | user.setSkills(userForm.getSkills()); 159 | user.setWorkingExperience(userForm.getWorkingExperience()); 160 | } 161 | 162 | private static String generateString() { 163 | return "uuid = " + UUID.randomUUID().toString(); 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/model/Role.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.model; 2 | 3 | import jakarta.persistence.*; 4 | 5 | import java.util.Set; 6 | /**{@author imrant} !*/ 7 | @Entity 8 | @Table(name = "role") 9 | public class Role { 10 | /** the id field !*/ 11 | private Long id; 12 | /** the name field !*/ 13 | private String name; 14 | /** the user field !*/ 15 | private Set users; 16 | /** {@inheritDoc}} !*/ 17 | @Id 18 | @GeneratedValue(strategy = GenerationType.IDENTITY) 19 | /** 20 | * {@link Role#id} 21 | !*/ 22 | public Long getId() { 23 | return id; 24 | } 25 | /** {@inheritDoc}} !*/ 26 | public void setId(final Long id) { 27 | this.id = id; 28 | } 29 | /** 30 | * {@link Role#name} 31 | !*/ 32 | public String getName() { 33 | return name; 34 | } 35 | /** {@inheritDoc}} !*/ 36 | public void setName(final String name) { 37 | this.name = name; 38 | } 39 | /** 40 | * {@inheritDoc}} 41 | !*/ 42 | @ManyToMany(fetch = FetchType.EAGER, mappedBy = "roles",cascade = CascadeType.ALL) 43 | /** 44 | * {@link Role#id} 45 | !*/ 46 | public Set getUsers() { 47 | return users; 48 | } 49 | /** 50 | * {@inheritDoc}} 51 | !*/ 52 | public final void setUsers(Set users) { 53 | this.users = users; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/model/User.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.model; 2 | 3 | 4 | import jakarta.persistence.*; 5 | 6 | import java.io.Serializable; 7 | import java.util.Set; 8 | /**{@author imrant} !*/ 9 | @Entity 10 | @Table(name = "user") 11 | public class User implements Serializable { 12 | /** the id field !*/ 13 | private Long id; 14 | /** the user name field !*/ 15 | private String username; 16 | /** the password field !*/ 17 | private String password; 18 | /** the userEmail field !*/ 19 | private String userEmail; 20 | /** the passwordConfirm field !*/ 21 | private String passwordConfirm; 22 | /** the profileImg field !*/ 23 | private String profileImg; 24 | /** the profileImgPath field !*/ 25 | private String profileImgPath; 26 | private String dateOfBirth; 27 | private String fatherName; 28 | private String motherName; 29 | private String gender; 30 | private String maritalStatus; 31 | private String permanentAddress; 32 | private String tempAddress; 33 | private String primaryOccupation; 34 | private String secondaryOccupation; 35 | private String skills; 36 | private String phoneNumber; 37 | private String secondaryPhoneNumber; 38 | private String nationality; 39 | private String language; 40 | private String workingExperience; 41 | 42 | 43 | /** the roles field !*/ 44 | private Set roles; 45 | /** {@inheritDoc}} !*/ 46 | @Id 47 | @GeneratedValue(strategy = GenerationType.IDENTITY) 48 | /** {@link User#id} */ 49 | public Long getId() { 50 | return id; 51 | } 52 | /** {@inheritDoc}} !*/ 53 | public void setId(final Long id) { 54 | this.id = id; 55 | } 56 | /**{@inheritDoc}} !*/ 57 | public String getUsername() { 58 | return username; 59 | } 60 | /** {@inheritDoc}} !*/ 61 | public void setUsername(final String username) { 62 | this.username = username; 63 | } 64 | /** 65 | * {@link User#password} 66 | * @return The {@link String} instance representing password 67 | !*/ 68 | public String getPassword() { 69 | return password; 70 | } 71 | /** 72 | * {@inheritDoc}} 73 | !*/ 74 | public void setPassword(final String password) { 75 | this.password = password; 76 | } 77 | /** 78 | * {@link User#userEmail} 79 | * @return The {@link String} instance representing userEmail. 80 | !*/ 81 | public String getUserEmail() { 82 | return userEmail; 83 | } 84 | /** {@inheritDoc}} !*/ 85 | public void setUserEmail(final String userEmail) { 86 | this.userEmail = userEmail; 87 | } 88 | 89 | /** {@inheritDoc}} !*/ 90 | @Transient 91 | /** 92 | * {@link User#passwordConfirm} 93 | !*/ 94 | public String getPasswordConfirm() { 95 | return passwordConfirm; 96 | } 97 | /** {@inheritDoc}} !*/ 98 | public void setPasswordConfirm(final String passwordConfirm) { 99 | this.passwordConfirm = passwordConfirm; 100 | } 101 | /** {@inheritDoc}} !*/ 102 | @ManyToMany 103 | @JoinTable(name = "user_role", joinColumns = @JoinColumn(name = "user_id"), inverseJoinColumns = @JoinColumn(name = "role_id")) 104 | public Set getRoles() { 105 | return roles; 106 | } 107 | /** {@inheritDoc}} !*/ 108 | public void setRoles(final Set roles) { 109 | this.roles = roles; 110 | } 111 | public String getProfileImg() { 112 | return profileImg; 113 | } 114 | public void setProfileImg(String profileImg) { 115 | this.profileImg = profileImg; 116 | } 117 | public String getProfileImgPath() { 118 | return profileImgPath; 119 | } 120 | public void setProfileImgPath(String profileImgPath) { 121 | this.profileImgPath = profileImgPath; 122 | } 123 | public String getDateOfBirth() { 124 | return dateOfBirth; 125 | } 126 | public void setDateOfBirth(String dateOfBirth) { 127 | this.dateOfBirth = dateOfBirth; 128 | } 129 | public String getFatherName() { 130 | return fatherName; 131 | } 132 | public void setFatherName(String fatherName) { 133 | this.fatherName = fatherName; 134 | } 135 | public String getMotherName() { 136 | return motherName; 137 | } 138 | public void setMotherName(String motherName) { 139 | this.motherName = motherName; 140 | } 141 | public String getGender() { 142 | return gender; 143 | } 144 | public void setGender(String gender) { 145 | this.gender = gender; 146 | } 147 | public String getMaritalStatus() { 148 | return maritalStatus; 149 | } 150 | public void setMaritalStatus(String maritalStatus) { 151 | this.maritalStatus = maritalStatus; 152 | } 153 | public String getPermanentAddress() { 154 | return permanentAddress; 155 | } 156 | public void setPermanentAddress(String permanentAddress) { 157 | this.permanentAddress = permanentAddress; 158 | } 159 | public String getTempAddress() { 160 | return tempAddress; 161 | } 162 | public void setTempAddress(String tempAddress) { 163 | this.tempAddress = tempAddress; 164 | } 165 | public String getPrimaryOccupation() { 166 | return primaryOccupation; 167 | } 168 | public void setPrimaryOccupation(String primaryOccupation) { 169 | this.primaryOccupation = primaryOccupation; 170 | } 171 | public String getSecondaryOccupation() { 172 | return secondaryOccupation; 173 | } 174 | public void setSecondaryOccupation(String secondaryOccupation) { 175 | this.secondaryOccupation = secondaryOccupation; 176 | } 177 | public String getSkills() { 178 | return skills; 179 | } 180 | public void setSkills(String skills) { 181 | this.skills = skills; 182 | } 183 | public String getPhoneNumber() { 184 | return phoneNumber; 185 | } 186 | public void setPhoneNumber(String phoneNumber) { 187 | this.phoneNumber = phoneNumber; 188 | } 189 | public String getSecondaryPhoneNumber() { 190 | return secondaryPhoneNumber; 191 | } 192 | public void setSecondaryPhoneNumber(String secondaryPhoneNumber) { 193 | this.secondaryPhoneNumber = secondaryPhoneNumber; 194 | } 195 | public String getNationality() { 196 | return nationality; 197 | } 198 | public void setNationality(String nationality) { 199 | this.nationality = nationality; 200 | } 201 | public String getLanguage() { 202 | return language; 203 | } 204 | public void setLanguage(String language) { 205 | this.language = language; 206 | } 207 | public String getWorkingExperience() { 208 | return workingExperience; 209 | } 210 | public void setWorkingExperience(String workingExperience) { 211 | this.workingExperience = workingExperience; 212 | } 213 | 214 | 215 | } 216 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.visualpathit.account.model.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import com.visualpathit.account.model.User; 8 | 9 | public interface UserRepository extends JpaRepository { 10 | User findByUsername(String username); 11 | User findById(long id); 12 | /*public void updateUser(User user)*/; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/ConsumerService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | public interface ConsumerService { 4 | 5 | void consumerMessage(byte[] data); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/ConsumerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import org.springframework.amqp.core.ExchangeTypes; 4 | import org.springframework.amqp.rabbit.annotation.Exchange; 5 | import org.springframework.amqp.rabbit.annotation.Queue; 6 | import org.springframework.amqp.rabbit.annotation.QueueBinding; 7 | import org.springframework.amqp.rabbit.annotation.RabbitListener; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service 11 | public class ConsumerServiceImpl implements ConsumerService { 12 | 13 | /** 14 | The name of the exchange. 15 | */ 16 | private static final String EXCHANGE_NAME = "messages"; 17 | 18 | /** 19 | * The function that consumes messages from the broker(RabbitMQ) 20 | * @param data 21 | */ 22 | @Override 23 | @RabbitListener(bindings = @QueueBinding( value = @Queue(), 24 | exchange = @Exchange(value = EXCHANGE_NAME, type = ExchangeTypes.FANOUT))) 25 | public void consumerMessage(byte[] data) { 26 | String consumedMessage = new String(data); 27 | System.out.println(" [x] Consumed '" + consumedMessage + "'"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/ProducerService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | public interface ProducerService { 4 | 5 | public String produceMessage(String message); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/ProducerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import com.rabbitmq.client.Connection; 4 | import com.rabbitmq.client.ConnectionFactory; 5 | import com.visualpathit.account.utils.RabbitMqUtil; 6 | 7 | import org.springframework.stereotype.Service; 8 | import com.rabbitmq.client.Channel; 9 | 10 | import java.io.IOException; 11 | import java.util.concurrent.TimeoutException; 12 | 13 | @Service 14 | public class ProducerServiceImpl implements ProducerService { 15 | 16 | /** 17 | * The name of the Exchange 18 | */ 19 | private static final String EXCHANGE_NAME = "messages"; 20 | 21 | /** 22 | * This method publishes a message 23 | * @param message 24 | */ 25 | @Override 26 | public String produceMessage(String message) { 27 | try { 28 | ConnectionFactory factory = new ConnectionFactory(); 29 | /** 30 | * System.out.println("Rabitmq host: ::" + RabbitMqUtil.getRabbitMqHost()); 31 | * System.out.println("Rabitmq port: ::" + RabbitMqUtil.getRabbitMqPort()); 32 | * System.out.println("Rabitmq user: ::" + RabbitMqUtil.getRabbitMqUser()); 33 | * System.out.println("Rabitmq password: ::" + RabbitMqUtil.getRabbitMqPassword()); 34 | **/ 35 | factory.setHost(RabbitMqUtil.getRabbitMqHost()); 36 | factory.setPort(Integer.parseInt(RabbitMqUtil.getRabbitMqPort())); 37 | factory.setUsername(RabbitMqUtil.getRabbitMqUser()); 38 | factory.setPassword(RabbitMqUtil.getRabbitMqPassword()); 39 | Connection connection = factory.newConnection(); 40 | System.out.println("Connection open status"+connection.isOpen()); 41 | Channel channel = connection.createChannel(); 42 | channel.exchangeDeclare(EXCHANGE_NAME, "fanout"); 43 | channel.basicPublish(EXCHANGE_NAME, "", null, message.getBytes()); 44 | System.out.println(" [x] Sent '" + message + "'"); 45 | channel.close(); 46 | connection.close(); 47 | } catch (IOException io) { 48 | System.out.println("IOException"); 49 | io.printStackTrace(); 50 | } catch (TimeoutException toe) { 51 | System.out.println("TimeoutException : " + toe.getMessage()); 52 | toe.printStackTrace(); 53 | } 54 | return "response"; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/SecurityService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | /** method for finding already added user !*/ 4 | public interface SecurityService { 5 | /** {@inheritDoc}} !*/ 6 | String findLoggedInUsername(); 7 | 8 | boolean autologin(String username, String password); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/SecurityServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.security.authentication.AuthenticationManager; 7 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 8 | import org.springframework.security.core.context.SecurityContextHolder; 9 | import org.springframework.security.core.userdetails.UserDetails; 10 | import org.springframework.security.core.userdetails.UserDetailsService; 11 | import org.springframework.stereotype.Service; 12 | 13 | @Service 14 | public class SecurityServiceImpl implements SecurityService { 15 | @Autowired 16 | private AuthenticationManager authenticationManager; 17 | 18 | @Autowired 19 | private UserDetailsService userDetailsService; 20 | 21 | private static final Logger logger = LoggerFactory.getLogger(SecurityServiceImpl.class); 22 | 23 | @Override 24 | public String findLoggedInUsername() { 25 | Object userDetails = SecurityContextHolder.getContext().getAuthentication().getDetails(); 26 | if (userDetails instanceof UserDetails) { 27 | return ((UserDetails) userDetails).getUsername(); 28 | } 29 | return null; 30 | } 31 | 32 | @Override 33 | public boolean autologin(final String username, final String password) { 34 | UserDetails userDetails = userDetailsService.loadUserByUsername(username); 35 | UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = 36 | new UsernamePasswordAuthenticationToken(userDetails, password, userDetails.getAuthorities()); 37 | 38 | authenticationManager.authenticate(usernamePasswordAuthenticationToken); 39 | 40 | if (usernamePasswordAuthenticationToken.isAuthenticated()) { 41 | SecurityContextHolder.getContext().setAuthentication(usernamePasswordAuthenticationToken); 42 | logger.debug(String.format("Auto login %s successfully!", username)); 43 | return true; 44 | } 45 | logger.debug(String.format("Auto login %s failed!", username)); 46 | return false; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/UserDetailsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import com.visualpathit.account.model.Role; 4 | import com.visualpathit.account.model.User; 5 | import com.visualpathit.account.repository.UserRepository; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.security.core.GrantedAuthority; 8 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 9 | import org.springframework.security.core.userdetails.UserDetails; 10 | import org.springframework.security.core.userdetails.UserDetailsService; 11 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 12 | import org.springframework.stereotype.Service; 13 | import org.springframework.transaction.annotation.Transactional; 14 | 15 | import java.util.HashSet; 16 | import java.util.Set; 17 | 18 | /** {@author imrant} !*/ 19 | @Service 20 | public class UserDetailsServiceImpl implements UserDetailsService { 21 | @Autowired 22 | /** userRepository !*/ 23 | private UserRepository userRepository; 24 | 25 | @Override 26 | @Transactional(readOnly = true) 27 | public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException { 28 | User user = userRepository.findByUsername(username); 29 | 30 | if (user == null) { 31 | throw new UsernameNotFoundException("User not found with username: " + username); 32 | } 33 | 34 | Set grantedAuthorities = new HashSet<>(); 35 | for (Role role : user.getRoles()) { 36 | grantedAuthorities.add(new SimpleGrantedAuthority(role.getName())); 37 | } 38 | 39 | return new org.springframework.security.core.userdetails.User(user.getUsername(), user.getPassword(), grantedAuthorities); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import java.util.List; 4 | 5 | import com.visualpathit.account.model.User; 6 | 7 | /** {@author imrant}!*/ 8 | public interface UserService { 9 | /** {@inheritDoc}} !*/ 10 | void save(User user); 11 | /** {@inheritDoc}} !*/ 12 | User findByUsername(String username); 13 | User findById(long id); 14 | /*public void updateUser(User user);*/ 15 | public List getList(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import com.visualpathit.account.model.User; 4 | import com.visualpathit.account.repository.RoleRepository; 5 | import com.visualpathit.account.repository.UserRepository; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.HashSet; 12 | import java.util.List; 13 | 14 | /** {@author imrant}!*/ 15 | @Service 16 | public class UserServiceImpl implements UserService { 17 | @Autowired 18 | /** userRepository !*/ 19 | private UserRepository userRepository; 20 | @Autowired 21 | /** roleRepository !*/ 22 | private RoleRepository roleRepository; 23 | @Autowired 24 | /** bCryptPasswordEncoder !*/ 25 | private BCryptPasswordEncoder bCryptPasswordEncoder; 26 | 27 | @Override 28 | public void save(final User user) { 29 | user.setPassword(bCryptPasswordEncoder.encode(user.getPassword())); 30 | user.setRoles(new HashSet<>(roleRepository.findAll())); 31 | userRepository.save(user); 32 | } 33 | 34 | @Override 35 | public User findByUsername(final String username) { 36 | return userRepository.findByUsername(username); 37 | } 38 | 39 | @Override 40 | public List getList() { 41 | return userRepository.findAll(); 42 | } 43 | @Override 44 | public User findById(long id){ 45 | return userRepository.findById(id); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/utils/ElasticsearchUtil.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.utils; 2 | 3 | import java.io.IOException; 4 | import java.net.InetSocketAddress; 5 | 6 | import org.apache.http.HttpHost; 7 | import org.elasticsearch.client.RequestOptions; 8 | import org.elasticsearch.client.RestClient; 9 | import org.elasticsearch.client.RestHighLevelClient; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | 13 | import com.visualpathit.account.beans.Components; 14 | 15 | @Service 16 | public class ElasticsearchUtil { 17 | 18 | private static Components object; 19 | 20 | @Autowired 21 | public void setComponents(Components object) { 22 | ElasticsearchUtil.object = object; 23 | } 24 | 25 | public static RestHighLevelClient getRestHighLevelClient() { 26 | System.out.println("Creating Elasticsearch client..."); 27 | String elasticsearchHost = object.getElasticsearchHost(); 28 | String elasticsearchPort = object.getElasticsearchPort(); 29 | 30 | System.out.println("Elasticsearch Host: " + elasticsearchHost); 31 | System.out.println("Elasticsearch Port: " + elasticsearchPort); 32 | 33 | RestHighLevelClient client = null; 34 | try { 35 | client = new RestHighLevelClient( 36 | RestClient.builder( 37 | new HttpHost(elasticsearchHost, Integer.parseInt(elasticsearchPort), "http") 38 | ) 39 | ); 40 | } catch (Exception e) { 41 | e.printStackTrace(); 42 | } 43 | return client; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/utils/MemcachedUtils.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.utils; 2 | 3 | import java.net.InetSocketAddress; 4 | import java.net.SocketAddress; 5 | import java.util.concurrent.Future; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.visualpathit.account.beans.Components; 11 | import com.visualpathit.account.model.User; 12 | 13 | import net.spy.memcached.MemcachedClient; 14 | @Service 15 | public class MemcachedUtils { 16 | 17 | private static Components object; 18 | @Autowired 19 | public void setComponents(Components object){ 20 | MemcachedUtils.object = object; 21 | } 22 | public static String memcachedSetData(User user,String key){ 23 | String Result = ""; 24 | int expireTime = 900; 25 | try{ 26 | MemcachedClient mactiveClient = memcachedConnection(); 27 | System.out.println("--------------------------------------------"); 28 | System.out.println("Client is ::"+ mactiveClient.getStats()); 29 | System.out.println("--------------------------------------------"); 30 | Future future = mactiveClient.set(key,expireTime, user); 31 | System.out.println("set status:" + future.get()); 32 | Result =" Data is From DB and Data Inserted In Cache !!"; 33 | mactiveClient.shutdown(); 34 | 35 | 36 | } catch (Exception e) { 37 | System.out.println( e.getMessage() ); 38 | } 39 | return Result; 40 | } 41 | public static User memcachedGetData(String key){ 42 | String Result = ""; 43 | User userData = null; 44 | try{ 45 | MemcachedClient mclient = memcachedConnection(); 46 | System.out.println("--------------------------------------------"); 47 | System.out.println("Client Status :: "+mclient.getStats()); 48 | System.out.println("--------------------------------------------"); 49 | userData = (User) mclient.get(key); 50 | System.out.println("user value in cache - " + mclient.get(key)); 51 | Result =" Data Retrieval From Cache !!"; 52 | System.out.println(Result); 53 | mclient.shutdown(); 54 | 55 | } catch (Exception e) { 56 | System.out.println( e.getMessage() ); 57 | } 58 | return userData; 59 | } 60 | public static MemcachedClient memcachedConnection(){ 61 | MemcachedClient mcconn = null; 62 | boolean active = true; 63 | String key="pid"; 64 | String port = ""; 65 | String activeHost =object.getActiveHost(); 66 | String activePort =object.getActivePort(); 67 | try{ 68 | if(!activeHost.isEmpty() && !activePort.isEmpty() && active){ 69 | mcconn = new MemcachedClient(new InetSocketAddress(activeHost,Integer.parseInt(activePort))); 70 | for(SocketAddress innerKey:mcconn.getStats().keySet()){ 71 | System.out.println("Connection SocketAddress ::" + innerKey); 72 | //System.out.println("Connection port ::" + mcconn.getStats().get(innerKey).get(key)); 73 | port = mcconn.getStats().get(innerKey).get(key); 74 | } 75 | if(port == null){ 76 | System.out.println("Port::"+ port); 77 | mcconn.shutdown(); 78 | System.out.println("--------------------------------------------"); 79 | System.out.println("Connection Failure By Active Host ::" + activeHost); 80 | System.out.println("--------------------------------------------"); 81 | mcconn = null; 82 | active =false; 83 | return mcconn = standByMemcachedConn(); 84 | } 85 | if(!port.isEmpty()){ 86 | System.out.println("--------------------------------------------"); 87 | System.out.println("Connection to server sucessfull for active Host ::"+activeHost); 88 | System.out.println("--------------------------------------------"); 89 | active =true; 90 | return mcconn; 91 | } 92 | }else if(!activeHost.isEmpty() && !activePort.isEmpty() && !active){ 93 | return mcconn = standByMemcachedConn(); 94 | }else { 95 | System.out.println("--------------------------------------------"); 96 | System.out.println("Connection to Failure Due to Incorrect or Empty Host:: "); 97 | System.out.println("--------------------------------------------"); 98 | } 99 | } 100 | catch (Exception e) { 101 | System.out.println( e.getMessage() ); 102 | } 103 | return mcconn; 104 | } 105 | public static MemcachedClient standByMemcachedConn(){ 106 | MemcachedClient mcconn = null; 107 | String port = ""; 108 | String key="pid"; 109 | String standByHost = object.getStandByHost(); 110 | String standByPort = object.getStandByPort(); 111 | try{ 112 | if(!standByHost.isEmpty() && !standByPort.isEmpty() && mcconn == null && port.isEmpty()){ 113 | mcconn = new MemcachedClient(new InetSocketAddress(standByHost,Integer.parseInt(standByPort))); 114 | for(SocketAddress innerKey:mcconn.getStats().keySet()){ 115 | port = mcconn.getStats().get(innerKey).get(key); 116 | } 117 | if(!port.isEmpty()){ 118 | System.out.println("--------------------------------------------"); 119 | System.out.println("Connection to server sucessful by StandBy Host::" + standByHost); 120 | System.out.println("--------------------------------------------"); 121 | return mcconn; 122 | }else { 123 | mcconn.shutdown(); 124 | System.out.println("--------------------------------------------"); 125 | System.out.println("Connection Failure By StandBy Host ::" +standByHost); 126 | System.out.println("--------------------------------------------"); 127 | } 128 | } 129 | }catch (Exception e) { 130 | System.out.println( e.getMessage() ); 131 | } 132 | return mcconn; 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/utils/RabbitMqUtil.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.utils; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.visualpathit.account.beans.Components; 7 | 8 | @Service 9 | public class RabbitMqUtil { 10 | private static Components object; 11 | 12 | public RabbitMqUtil() {} 13 | 14 | @Autowired 15 | public void setComponents(Components object) { 16 | RabbitMqUtil.object = object; 17 | } 18 | 19 | public static String getRabbitMqHost() { return object.getRabbitMqHost(); } 20 | 21 | public static String getRabbitMqPort() { 22 | return object.getRabbitMqPort(); 23 | } 24 | 25 | public static String getRabbitMqUser() { return object.getRabbitMqUser(); } 26 | 27 | public static String getRabbitMqPassword() { 28 | return object.getRabbitMqPassword(); 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/validator/UserValidator.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.validator; 2 | 3 | import com.visualpathit.account.model.User; 4 | import com.visualpathit.account.service.UserService; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.validation.Errors; 9 | import org.springframework.validation.ValidationUtils; 10 | import org.springframework.validation.Validator; 11 | 12 | @Component 13 | public class UserValidator implements Validator { 14 | @Autowired 15 | private UserService userService; 16 | 17 | @Override 18 | public boolean supports(Class aClass) { 19 | return User.class.equals(aClass); 20 | } 21 | 22 | @Override 23 | public void validate(Object o, Errors errors) { 24 | User user = (User) o; 25 | 26 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "username", "NotEmpty"); 27 | if (user.getUsername().length() < 6 || user.getUsername().length() > 32) { 28 | errors.rejectValue("username", "Size.userForm.username"); 29 | } 30 | if (userService.findByUsername(user.getUsername()) != null) { 31 | errors.rejectValue("username", "Duplicate.userForm.username"); 32 | } 33 | 34 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "NotEmpty"); 35 | if (user.getPassword().length() < 8 || user.getPassword().length() > 32) { 36 | errors.rejectValue("password", "Size.userForm.password"); 37 | } 38 | 39 | if (!user.getPasswordConfirm().equals(user.getPassword())) { 40 | errors.rejectValue("passwordConfirm", "Diff.userForm.passwordConfirm"); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/resources/accountsdb.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.7.18, for Linux (x86_64) 2 | -- 3 | -- Host: localhost Database: accounts 4 | -- ------------------------------------------------------ 5 | -- Server version 5.7.18-0ubuntu0.16.10.1 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `role` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `role`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `role` ( 26 | `id` int(11) NOT NULL AUTO_INCREMENT, 27 | `name` varchar(45) DEFAULT NULL, 28 | PRIMARY KEY (`id`) 29 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; 30 | /*!40101 SET character_set_client = @saved_cs_client */; 31 | 32 | -- 33 | -- Dumping data for table `role` 34 | -- 35 | 36 | LOCK TABLES `role` WRITE; 37 | /*!40000 ALTER TABLE `role` DISABLE KEYS */; 38 | INSERT INTO `role` VALUES (1,'ROLE_USER'); 39 | INSERT INTO `role` VALUES (2,'ROLE_ADMIN'); 40 | /*!40000 ALTER TABLE `role` ENABLE KEYS */; 41 | UNLOCK TABLES; 42 | 43 | -- 44 | -- Table structure for table `user` 45 | -- 46 | 47 | DROP TABLE IF EXISTS `user`; 48 | /*!40101 SET @saved_cs_client = @@CHARACTER_SET_CLIENT */; 49 | /*!40101 SET CHARACTER_SET_CLIENT = utf8 */; 50 | CREATE TABLE `user` ( 51 | `id` int(11) NOT NULL AUTO_INCREMENT, 52 | `username` varchar(255) DEFAULT NULL, 53 | `userEmail` varchar(255) DEFAULT NULL, 54 | `password` varchar(255) DEFAULT NULL, 55 | PRIMARY KEY (`id`) 56 | ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; 57 | /*!40101 SET CHARACTER_SET_CLIENT = @saved_cs_client */; 58 | 59 | -- 60 | -- Dumping data for table `user` 61 | -- 62 | 63 | LOCK TABLES `user` WRITE; 64 | /*!40000 ALTER TABLE `user` DISABLE KEYS */; 65 | INSERT INTO `user` VALUES (4,'admin_vp','admin@visualpathit.com','$2a$11$DSEIKJNrgPjG.iCYUwErvOkREtC67mqzQ.ogkZbc/KOW1OPOpZfY6'); 66 | /*!40000 ALTER TABLE `user` ENABLE KEYS */; 67 | UNLOCK TABLES; 68 | 69 | -- 70 | -- Table structure for table `user_role` 71 | -- 72 | 73 | DROP TABLE IF EXISTS `user_role`; 74 | /*!40101 SET @saved_cs_client = @@CHARACTER_SET_CLIENT */; 75 | /*!40101 SET CHARACTER_SET_CLIENT = utf8 */; 76 | CREATE TABLE `user_role` ( 77 | `user_id` int(11) NOT NULL, 78 | `role_id` int(11) NOT NULL, 79 | PRIMARY KEY (`user_id`,`role_id`), 80 | KEY `fk_user_role_roleid_idx` (`role_id`), 81 | CONSTRAINT `fk_user_role_roleid` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, 82 | CONSTRAINT `fk_user_role_userid` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE 83 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 84 | /*!40101 SET CHARACTER_SET_CLIENT = @saved_cs_client */; 85 | 86 | -- 87 | -- Dumping data for table `user_role` 88 | -- 89 | 90 | LOCK TABLES `user_role` WRITE; 91 | /*!40000 ALTER TABLE `user_role` DISABLE KEYS */; 92 | INSERT INTO `user_role` VALUES (4,1); -- ROLE_USER 93 | INSERT INTO `user_role` VALUES (4,2); -- ROLE_ADMIN 94 | /*!40000 ALTER TABLE `user_role` ENABLE KEYS */; 95 | UNLOCK TABLES; 96 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 97 | 98 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 99 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 100 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 101 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 102 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 103 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 104 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 105 | 106 | -- Dump completed on 2017-08-28 10:50:51 107 | -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #JDBC Configutation for Database Connection 2 | jdbc.driverClassName=com.mysql.cj.jdbc.Driver 3 | jdbc.url=jdbc:mysql://db01:3306/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 4 | jdbc.username=admin 5 | jdbc.password=admin123 6 | 7 | #Memcached Configuration For Active and StandBy Host 8 | #For Active Host 9 | memcached.active.host=mc01 10 | memcached.active.port=11211 11 | #For StandBy Host 12 | memcached.standBy.host=127.0.0.2 13 | memcached.standBy.port=11211 14 | 15 | #RabbitMq Configuration 16 | rabbitmq.address=rmq01 17 | rabbitmq.port=5672 18 | rabbitmq.username=test 19 | rabbitmq.password=test 20 | 21 | #Elasticesearch Configuration 22 | elasticsearch.host=localhost 23 | elasticsearch.port=9300 24 | elasticsearch.cluster=vprofile 25 | elasticsearch.node=vprofilenode 26 | 27 | 28 | spring.servlet.multipart.max-file-size=128KB 29 | spring.servlet.multipart.max-request-size=128KB 30 | 31 | logging.level.org.springframework.security=DEBUG 32 | 33 | 34 | # application.properties 35 | spring.security.user.name=admin_vp 36 | spring.security.user.password=admin_vp 37 | spring.security.user.roles=ADMIN 38 | 39 | 40 | spring.mvc.view.prefix=/WEB-INF/views/ 41 | spring.mvc.view.suffix=.jsp 42 | 43 | #logging.level.root=OFF 44 | #logging.level.org.springframework.web=OFF 45 | #spring.main.banner-mode=OFF 46 | 47 | # Hibernate SQL Queries 48 | spring.jpa.show-sql=false 49 | spring.jpa.properties.hibernate.format_sql=false 50 | logging.level.org.hibernate.SQL=OFF 51 | logging.level.org.hibernate.type=OFF 52 | 53 | 54 | # Debug Logging for SecurityServiceImpl 55 | logging.level.com.visualpathit.account.service.SecurityServiceImpl=OFF 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/main/resources/db_backup.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.7.18, for Linux (x86_64) 2 | -- 3 | -- Host: localhost Database: accounts 4 | -- ------------------------------------------------------ 5 | -- Server version 5.7.18-0ubuntu0.16.10.1 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `role` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `role`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `role` ( 26 | `id` int(11) NOT NULL AUTO_INCREMENT, 27 | `name` varchar(45) DEFAULT NULL, 28 | PRIMARY KEY (`id`) 29 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; 30 | /*!40101 SET character_set_client = @saved_cs_client */; 31 | 32 | -- 33 | -- Dumping data for table `role` 34 | -- 35 | 36 | LOCK TABLES `role` WRITE; 37 | /*!40000 ALTER TABLE `role` DISABLE KEYS */; 38 | INSERT INTO `role` VALUES (1,'ROLE_USER'); 39 | /*!40000 ALTER TABLE `role` ENABLE KEYS */; 40 | UNLOCK TABLES; 41 | 42 | -- 43 | -- Table structure for table `user` 44 | -- 45 | 46 | DROP TABLE IF EXISTS `user`; 47 | /*!40101 SET @saved_cs_client = @@character_set_client */; 48 | /*!40101 SET character_set_client = utf8 */; 49 | CREATE TABLE `user` ( 50 | `id` int(11) NOT NULL AUTO_INCREMENT, 51 | `username` varchar(255) DEFAULT NULL, 52 | `userEmail` varchar(255) DEFAULT NULL, 53 | `profileImg` varchar(255) DEFAULT NULL, 54 | `profileImgPath` varchar(255) DEFAULT NULL, 55 | `dateOfBirth` varchar(255) DEFAULT NULL, 56 | `fatherName` varchar(255) DEFAULT NULL, 57 | `motherName` varchar(255) DEFAULT NULL, 58 | `gender` varchar(255) DEFAULT NULL, 59 | `maritalStatus` varchar(255) DEFAULT NULL, 60 | `permanentAddress` varchar(255) DEFAULT NULL, 61 | `tempAddress` varchar(255) DEFAULT NULL, 62 | `primaryOccupation` varchar(255) DEFAULT NULL, 63 | `secondaryOccupation` varchar(255) DEFAULT NULL, 64 | `skills` varchar(255) DEFAULT NULL, 65 | `phoneNumber` varchar(255) DEFAULT NULL, 66 | `secondaryPhoneNumber` varchar(255) DEFAULT NULL, 67 | `nationality` varchar(255) DEFAULT NULL, 68 | `language` varchar(255) DEFAULT NULL, 69 | `workingExperience` varchar(255) DEFAULT NULL, 70 | `password` varchar(255) DEFAULT NULL, 71 | PRIMARY KEY (`id`) 72 | ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; 73 | /*!40101 SET character_set_client = @saved_cs_client */; 74 | 75 | -- 76 | -- Dumping data for table `user` 77 | -- 78 | 79 | LOCK TABLES `user` WRITE; 80 | /*!40000 ALTER TABLE `user` DISABLE KEYS */; 81 | 82 | INSERT INTO `user` VALUES (7,'admin_vp','admin@hkhinfo.com',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'$2a$11$0a7VdTr4rfCQqtsvpng6GuJnzUmQ7gZiHXgzGPgm5hkRa3avXgBLK') 83 | ,(8,'Abrar Nirban','abrar.nirban74@gmail.com',NULL,NULL,'27/01/2002','A nirban','T nirban','male','unMarried','Dubai,UAE','Dubai,UAE','Software Engineer','Software Engineer','Java HTML CSS ','8888888888','8888888888','Indian','english','2 ','$2a$11$UgG9TkHcgl02LxlqxRHYhOf7Xv4CxFmFEgS0FpUdk42OeslI.6JAW'), 84 | (9,'Amayra Fatima','amayra@gmail.com',NULL,NULL,'20/06/1993','K','L','female','unMarried','Dubai,UAE','Dubai,UAE','Software Engineer','Software Engineer','Java HTML CSS ','9999999999','9999999999','India','english','5','$2a$11$gwvsvUrFU.YirMM1Yb7NweFudLUM91AzH5BDFnhkNzfzpjG.FplYO'), 85 | (10,'Aron','aron.DSilva@gmail.com',NULL,NULL,'27/01/2002','M nirban','R nirban','male','unMarried','Dubai,UAE','Dubai,UAE','Software Engineer','Software Engineer','Java HTML CSS ','7777777777','777777777','India','english','7','$2a$11$6oZEgfGGQAH23EaXLVZ2WOSKxcEJFnBSw2N2aghab0s2kcxSQwjhC'), 86 | (11,'Kiran Kumar','kiran@gmail.com',NULL,NULL,'8/12/1993','K K','RK','male','unMarried','SanFrancisco','James Street','Software Engineer','Software Engineer','Java HTML CSS ','1010101010','1010101010','India','english','10','$2a$11$EXwpna1MlFFlKW5ut1iVi.AoeIulkPPmcOHFO8pOoQt1IYU9COU0m'), 87 | (12,'Balbir Singh','balbir@gmail.com',NULL,NULL,'20/06/1993','balbir RK','balbir AK','male','unMarried','SanFrancisco','US','Software Engineer','Software Engineer','Java HTML CSS AWS','8888888111','8888888111','India','english','8','$2a$11$pzWNzzR.HUkHzz2zhAgqOeCl0WaTgY33NxxJ7n0l.rnEqjB9JO7vy'), 88 | (4,'Hibo Prince','hibo.prince@gmail.com',NULL,NULL,'6/09/2000','Abara','Queen','male','unMarried','Electronic City,UAE','Electronic City,UAE','Tester','Freelancing','Python PHP ','9146389863','9146389871','Indian','hindi','3 ','$2a$11$UgG9TkHcgl02LxlqxRHYhOf7Xv4CxFmFEgS0FpUdk42OeslI.6JAR'), 89 | (5,'Aejaaz Habeeb','aejaaz.habeeb@gmail.com',NULL,NULL,'16/02/2001','Imran','Ziya','male','unMarried','AbuDhabi,UAE','AbuDhabi,UAE','Developer','Developer','Azure Devops ','9566489863','9566489863','Indian','hindi','4 ','$2a$11$UgG9TkHcgl02LxlqxRHYhOf7Xv4CxFmFEgS0FpUdk42OeslI.6JAR'), 90 | (6,'Jackie','jackie.chan@gmail.com',NULL,NULL,'28/09/1992','Charles','Chan','male','Married','HongKong,China','HongKong,China','MartialArtist','MartialArtist','KungFu ','9246488863','9246488863','Chinese','Mandrian','1 ','$2a$11$UgG9TkHcgl02LxlqxRHYhOf7Xv4CxFmFEgS0FpUdk42OeslI.6RAR'), 91 | (13,'Srinath Goud','sgoud@gmail.com',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'$2a$11$6BSmYPrT8I8b9yHmx.uTRu/QxnQM2vhZYQa8mR33aReWA4WFihyGK'); 92 | 93 | 94 | /*!40000 ALTER TABLE `user` ENABLE KEYS */; 95 | UNLOCK TABLES; 96 | 97 | -- 98 | -- Table structure for table `user_role` 99 | -- 100 | 101 | DROP TABLE IF EXISTS `user_role`; 102 | /*!40101 SET @saved_cs_client = @@character_set_client */; 103 | /*!40101 SET character_set_client = utf8 */; 104 | CREATE TABLE `user_role` ( 105 | `user_id` int(11) NOT NULL, 106 | `role_id` int(11) NOT NULL, 107 | PRIMARY KEY (`user_id`,`role_id`), 108 | KEY `fk_user_role_roleid_idx` (`role_id`), 109 | CONSTRAINT `fk_user_role_roleid` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, 110 | CONSTRAINT `fk_user_role_userid` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE 111 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 112 | /*!40101 SET character_set_client = @saved_cs_client */; 113 | 114 | -- 115 | -- Dumping data for table `user_role` 116 | -- 117 | 118 | LOCK TABLES `user_role` WRITE; 119 | /*!40000 ALTER TABLE `user_role` DISABLE KEYS */; 120 | INSERT INTO `user_role` VALUES (4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,1),(11,1),(12,1),(13,1); 121 | /*!40000 ALTER TABLE `user_role` ENABLE KEYS */; 122 | UNLOCK TABLES; 123 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 124 | 125 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 126 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 127 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 128 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 129 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 130 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 131 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 132 | 133 | -- Dump completed on 2023-21-06 05:49:31 134 | -------------------------------------------------------------------------------- /src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %date{HH:mm:ss.SSS} [%thread] %-5level %logger{15}#%line %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/resources/validation.properties: -------------------------------------------------------------------------------- 1 | NotEmpty=This field is required. 2 | Size.userForm.username=Please use between 6 and 32 characters. 3 | Duplicate.userForm.username= User has already taken this Username. 4 | Size.userForm.password=Try one with at least 8 characters. 5 | Diff.userForm.passwordConfirm=These passwords don't match. -------------------------------------------------------------------------------- /src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/appconfig-data.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | org.hibernate.dialect.MySQLDialect 29 | true 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/appconfig-mvc.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | classpath:validation 16 | 17 | 18 | 19 | 21 | 22 | /WEB-INF/views/ 23 | 24 | 25 | .jsp 26 | 27 | 28 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/appconfig-rabbitmq.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/appconfig-root.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/appconfig-security.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/elasticeSearchRes.jsp: -------------------------------------------------------------------------------- 1 | 2 | <%@ page language="java" contentType="text/html; charset=UTF-8" 3 | pageEncoding="UTF-8"%> 4 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 5 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 6 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 7 | 8 | 9 | 10 | 11 | 12 | vp-elasticsearch 13 | 14 | 15 |

Data is ${result} into Elasticsearch

16 |

Please go to elastic search dash board and verify link ip:9200/users/user/id

17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/error/404.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | 3 | 4 | 5 | 6 | 7 | User Not Found 8 | 9 | 27 | 28 | 29 |

User Not Found

30 |

The user you are looking for does not exist. Please try again or go back to the login page.

31 | 32 | 33 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/error/500.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | 3 | 4 | 5 | User Not Found 6 | 7 | 8 | 9 | 53 | 54 | 55 |
56 |
57 | 58 |
59 |

User Not Found

60 |

It seems we couldn't find your account. You can create a new account if you don't have one.

61 |
62 | 63 | 64 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/error/database-error.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | 3 | 4 | 5 | Database Connection Error 6 | 7 | 35 | 36 | 37 |
38 |

Database Connection Error

39 |

We are currently unable to connect to the database. Please check your database server and credentials.

40 |

If the problem persists, please contact support.

41 |

Back to Home

42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/rabbitmq-error.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | RabbitMQ Error 8 | 23 | 24 | 25 |

RabbitMQ Error

26 |

RabbitMQ server is off. Please start the RabbitMQ server and try again.

27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/rabbitmq.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | RabbitMQ 8 | 23 | 24 | 25 | <% 26 | int connections = (int) (Math.random() * 10) + 1; 27 | int channels = (int) (Math.random() * 10) + 1; 28 | int exchange = (int) (Math.random() * 10) + 1; 29 | int queues = (int) (Math.random() * 10) + 1; 30 | %> 31 |

RabbitMQ Initiated

32 |

Generated <%= connections %> Connections

33 |

<%= channels %> Channels, <%= exchange %> Exchange, and <%= queues %> Queues

34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/upload.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 5 | <%@ page session="false" %> 6 | 7 | 8 | 9 | Upload File Request Page 10 | 11 | 12 | 13 | 28 | 29 | 30 |
31 |
32 |

Upload Image

33 |
34 | ${pageContext.request.userPrincipal.name}
35 |
36 | 37 | 38 |
39 |
40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 |
48 |
49 |
50 |
51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/userList.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | 8 | All Users 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 74 | 75 | 76 |
77 |
78 | 104 |
105 |
106 | 107 |
108 |
109 |

Users List

110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 121 | 122 | 123 |
User NameUser Id
119 | 120 |
124 |
125 |
126 | 127 | 128 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | contextConfigLocation 8 | /WEB-INF/appconfig-root.xml 9 | 10 | 11 | 12 | org.springframework.web.context.ContextLoaderListener 13 | 14 | 15 | 16 | 17 | 18 | appServlet 19 | org.springframework.web.servlet.DispatcherServlet 20 | 21 | contextConfigLocation 22 | 23 | 24 | 1 25 | 26 | 27 | 500 28 | /WEB-INF/views/error/500.jsp 29 | 30 | 31 | 32 | appServlet 33 | / 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/background.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/background1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/background1.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/bg-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/bg-01.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/dev_img.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/dev_img.jpeg -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/devops_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/devops_img.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/header.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/icons/favicon.ico -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/login-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/login-background.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/new-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/new-background.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/new-logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/new-logo1.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/Ansible_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/technologies/Ansible_logo.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/Vagrant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/technologies/Vagrant.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/aws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/technologies/aws.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/technologies/docker.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/git.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/technologies/git.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/jenkins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/technologies/jenkins.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/puppet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/technologies/puppet.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/python-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/technologies/python-logo.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/user.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/user/giphy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/user/giphy.gif -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/user/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/user/logo.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/user/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/user/user.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/user/user2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/user/user2.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/user/user3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/user/user3.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/visualpath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/visualpath.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/visualpathlogo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/visualpathlogo2.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/visualpathlogo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/Images/visualpathlogo3.png -------------------------------------------------------------------------------- /src/main/webapp/resources/css/common.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap"); 2 | 3 | body { 4 | padding-top: 10px; 5 | padding-bottom: 50px; 6 | background-color: #ffffff; 7 | background-image: url('/resources/Images/bg-01.jpg'); /* Ensure this path is correct */ 8 | background-size: cover; 9 | background-repeat: no-repeat; 10 | background-attachment: fixed; 11 | } 12 | 13 | .btn-custom, .btn-custom:hover, .btn-custom:focus, .btn-custom:active { 14 | border-radius: 0; 15 | color: #ffffff; 16 | background-color: #26c6da; 17 | border-color: #26c6da; 18 | } 19 | 20 | .container1 { 21 | width: 100%; /* Full width of the viewport */ 22 | max-width: 1200px; /* Set a maximum width for the container */ 23 | margin: 0 auto; /* Center the container */ 24 | } 25 | 26 | .navbar-custom { 27 | background-color: #26c6da; /* Match background color of the navbar */ 28 | border: none; /* Remove border */ 29 | } 30 | 31 | .navbar-custom .navbar-brand, .navbar-custom .navbar-nav > li > a { 32 | color: white; /* Text color for navbar links */ 33 | } 34 | 35 | .navbar-custom .navbar-nav > li > a:hover { 36 | color: #333; /* Darker color on hover */ 37 | } 38 | 39 | .navbar-wrapper { 40 | position: absolute; 41 | width: 100%; 42 | top: 0; 43 | left: 0; 44 | z-index: 1000; 45 | } 46 | 47 | .navbar { 48 | background-color: #26c6da; /* Navbar background color */ 49 | color: black; 50 | position: relative; 51 | display: flex; 52 | flex-wrap: wrap; 53 | align-items: center; 54 | justify-content: flex-end; /* Align items to the right */ 55 | padding: .5rem 1rem; 56 | } 57 | 58 | .navbar .navbar-brand { 59 | 60 | } 61 | 62 | .navbar .navbar-nav { 63 | display: flex; 64 | flex-direction: row; 65 | margin-left: auto; /* Ensures items are on the right */ 66 | } 67 | 68 | .navbar a { 69 | color: black; /* Sets the link text color */ 70 | font-size: 18px; /* Adjust font size for links */ 71 | font-family: 'Poppins', sans-serif; /* Use the Poppins font */ 72 | } 73 | 74 | .navbar a:hover, .navbar a:focus { 75 | color: #333; /* Darker color on hover/focus */ 76 | } 77 | 78 | .form-signin { 79 | max-width: 500px; /* Increase form width */ 80 | padding: 50px; /* Adjust padding */ 81 | margin: 0 auto; /* Center form */ 82 | width: 500px; 83 | background: #fff; 84 | border-radius: 10px; 85 | overflow: hidden; 86 | } 87 | 88 | .btn-custom-LOGIN { 89 | border-radius: 0; 90 | color: #ffffff; 91 | height: 3em; 92 | background-color: #26c6da; 93 | border-color: #26c6da; 94 | } 95 | 96 | .form-signin .form-signin-heading { 97 | display: block; 98 | font-family: 'Poppins', sans-serif; 99 | font-size: 39px; 100 | color: #333333; 101 | line-height: 1.2; 102 | text-align: center; 103 | } 104 | 105 | .form-signin .form-control { 106 | position: relative; 107 | height: auto; 108 | box-sizing: border-box; 109 | padding: 10px; 110 | font-size: 16px; 111 | } 112 | 113 | .form-signin .form-control:focus { 114 | z-index: 2; 115 | } 116 | 117 | .form-signin input { 118 | margin-top: 10px; 119 | border-bottom-right-radius: 0; 120 | border-bottom-left-radius: 0; 121 | } 122 | 123 | .form-signin button { 124 | margin-top: 10px; 125 | } 126 | 127 | .has-error .form-control { 128 | border-color: red; 129 | } 130 | 131 | .has-error .help-block { 132 | color: red; 133 | } 134 | -------------------------------------------------------------------------------- /src/main/webapp/resources/css/login.css: -------------------------------------------------------------------------------- 1 | /*==================== GOOGLE FONTS ====================*/ 2 | @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap"); 3 | 4 | /* Global Styles */ 5 | body { 6 | background-color: #e8e8e8; 7 | font-family: 'Poppins', sans-serif; /* Use Poppins for a consistent font style */ 8 | margin: 0; 9 | padding: 0; 10 | } 11 | 12 | /* Main Container */ 13 | .mainbody { 14 | background: #f0f0f0; 15 | padding-top: 70px; /* Adjusted to fit the fixed navbar */ 16 | } 17 | 18 | /* Navbar Styles */ 19 | .navbar-wrapper { 20 | position: fixed; 21 | top: 0; 22 | left: 0; 23 | right: 0; 24 | z-index: 20; 25 | background-color: #e3f2fd; /* Navbar background color */ 26 | border-bottom: 2px solid #003366; 27 | } 28 | 29 | .container-fluid { 30 | background-color: #fff; 31 | } 32 | 33 | .navbar-custom { 34 | background-color: #e3f2fd; /* Navbar background color */ 35 | } 36 | 37 | .navbar-brand { 38 | color: black; /* Navbar brand text color */ 39 | font-family: 'Poppins', sans-serif; /* Updated to match fonts in the navbar */ 40 | font-size: 18px; 41 | font-weight: bold; 42 | } 43 | 44 | .navbar-toggle { 45 | color: black; /* Toggle icon color */ 46 | background: #e3f2fd; /* Toggle background color */ 47 | border: none; 48 | border-radius: 4px; 49 | transition: background-color 0.3s ease; 50 | } 51 | 52 | .navbar-toggle:hover { 53 | background: #c5e1f5; /* Light hover effect for toggle */ 54 | } 55 | 56 | .navbar-nav > li > a { 57 | color: black; /* Navbar text color */ 58 | font-family: 'Poppins', sans-serif; /* Updated to match fonts in the navbar */ 59 | font-size: 18px; 60 | font-weight: bold; 61 | padding: 15px 20px; /* Adjust padding for spacing */ 62 | } 63 | 64 | .navbar-nav > li > a:hover { 65 | background-color: #c5e1f5; /* Hover effect for links */ 66 | border-radius: 4px; /* Rounded corners on hover */ 67 | } 68 | 69 | .navbar-content { 70 | width: auto; /* Auto width for better alignment */ 71 | padding: 10px; 72 | padding-bottom: 0; 73 | text-align: center; /* Center align content for a more balanced look */ 74 | } 75 | 76 | .navbar-collapse.collapse { 77 | display: block !important; 78 | height: auto !important; 79 | padding-bottom: 0; 80 | overflow: visible !important; 81 | } 82 | 83 | .navbar-nav.navbar-right { 84 | float: right; /* Float right for login and sign-up links */ 85 | } 86 | 87 | .navbar-nav.navbar-right > li { 88 | display: inline-block; /* Display inline for horizontal layout */ 89 | margin-left: 15px; /* Space between items */ 90 | } 91 | 92 | /* Header Styles */ 93 | .header-img { 94 | width: 100%; 95 | height: auto; 96 | opacity: 0.8; 97 | } 98 | 99 | .header-text { 100 | color: #26c6da; 101 | text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); 102 | text-align: center; 103 | font-size: 3em; 104 | } 105 | 106 | /* Section Styles */ 107 | #contact, #technologies, #about { 108 | background: white; 109 | padding: 25px; 110 | margin: 50px 0; 111 | border-radius: 8px; 112 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 113 | } 114 | 115 | #contact h3, #technologies h3, #about h3 { 116 | color: black; 117 | font-size: 30px; 118 | font-weight: 600; 119 | margin-bottom: 20px; 120 | text-align: center; 121 | } 122 | 123 | /* Contact Form Adjustments */ 124 | #contact-form { 125 | display: flex; 126 | flex-direction: column; 127 | align-items: center; 128 | justify-content: center; 129 | padding: 1px; 130 | } 131 | 132 | form { 133 | width: 100%; 134 | max-width: 600px; /* Limit the maximum width of the form */ 135 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 136 | padding: 20px; 137 | background: white; 138 | border-radius: 8px; 139 | } 140 | 141 | #contact-form p { 142 | text-align: center; 143 | margin-bottom: 20px; 144 | } 145 | 146 | #contact input[type="text"], 147 | #contact input[type="email"], 148 | #contact input[type="tel"], 149 | #contact input[type="url"], 150 | #contact textarea { 151 | width: 100%; 152 | border: 1px solid #CCC; 153 | background: #FFF; 154 | margin: 0 0 10px; 155 | padding: 10px; 156 | border-radius: 4px; 157 | font-size: 16px; 158 | } 159 | 160 | #contact input[type="text"]:hover, 161 | #contact input[type="email"]:hover, 162 | #contact input[type="tel"]:hover, 163 | #contact input[type="url"]:hover, 164 | #contact textarea:hover { 165 | border-color: #AAA; 166 | } 167 | 168 | #contact textarea { 169 | height: 100px; 170 | resize: vertical; 171 | } 172 | 173 | #contact button[type="submit"] { 174 | cursor: pointer; 175 | width: 100%; 176 | border: none; 177 | background: #26c6da; 178 | color: #FFF; 179 | padding: 10px; 180 | font-size: 16px; 181 | border-radius: 4px; 182 | } 183 | 184 | #contact button[type="submit"]:hover { 185 | background: #1e88e5; 186 | } 187 | 188 | #contact input:focus, 189 | #contact textarea:focus { 190 | outline: 0; 191 | border-color: #999; 192 | } 193 | 194 | ::-webkit-input-placeholder { 195 | color: #888; 196 | } 197 | 198 | :-moz-placeholder { 199 | color: #888; 200 | } 201 | 202 | ::-moz-placeholder { 203 | color: #888; 204 | } 205 | 206 | :-ms-input-placeholder { 207 | color: #888; 208 | } 209 | 210 | /* Blockquote Styles */ 211 | blockquote { 212 | background: #fff; 213 | padding: 15px 20px; 214 | margin: 0 0 20px; 215 | position: relative; 216 | } 217 | 218 | /* Custom Styles for Index Home Page */ 219 | .index-home-body { 220 | background-color: #ffffff; 221 | background-image: url('/resources/Images/bg-01.jpg'); 222 | background-size: cover; 223 | background-repeat: no-repeat; 224 | background-attachment: fixed; 225 | padding-top: 70px; /* Adjust to fit the fixed navbar */ 226 | } 227 | 228 | .index-home-container { 229 | max-width: 1200px; /* Set a maximum width for the container */ 230 | margin: 0 auto; /* Center the container */ 231 | padding: 20px; 232 | } 233 | 234 | .btn-custom, .btn-custom:hover, .btn-custom:focus, .btn-custom:active { 235 | border-radius: 0; 236 | color: #ffffff; 237 | background-color: #26c6da; 238 | border-color: #26c6da; 239 | } 240 | 241 | -------------------------------------------------------------------------------- /src/main/webapp/resources/css/profile.css: -------------------------------------------------------------------------------- 1 | /*==================== GOOGLE FONTS ====================*/ 2 | @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap"); 3 | 4 | /* Global Styles */ 5 | body { 6 | background-color: #e8e8e8; 7 | font-family: 'Poppins', sans-serif; /* Use Poppins for a consistent font style */ 8 | margin: 0; 9 | padding: 0; 10 | } 11 | 12 | /* Main Container */ 13 | .mainbody { 14 | background: #f0f0f0; 15 | padding-top: 70px; /* Adjusted to fit the fixed navbar */ 16 | } 17 | 18 | /* Navbar Styles */ 19 | .navbar-wrapper { 20 | position: fixed; 21 | top: 0; 22 | left: 0; 23 | right: 0; 24 | z-index: 20; 25 | background-color: #e3f2fd; /* Navbar background color */ 26 | border-bottom: 2px solid #003366; 27 | } 28 | 29 | .container-fluid { 30 | background-color: #fff; 31 | } 32 | 33 | .navbar-custom { 34 | background-color: #e3f2fd; /* Navbar background color */ 35 | } 36 | 37 | .navbar-brand { 38 | color: black; /* Navbar brand text color */ 39 | font-family: 'Poppins', sans-serif; /* Updated to match fonts in the navbar */ 40 | font-size: 18px; 41 | font-weight: bold; 42 | } 43 | 44 | .navbar-toggle { 45 | color: black; /* Toggle icon color */ 46 | background: #e3f2fd; /* Toggle background color */ 47 | border: none; 48 | border-radius: 4px; 49 | transition: background-color 0.3s ease; 50 | } 51 | 52 | .navbar-toggle:hover { 53 | background: #c5e1f5; /* Light hover effect for toggle */ 54 | } 55 | 56 | .navbar-nav > li > a { 57 | color: black; /* Navbar text color */ 58 | font-family: 'Poppins', sans-serif; /* Updated to match fonts in the navbar */ 59 | font-size: 18px; 60 | font-weight: bold; 61 | padding: 15px 20px; /* Adjust padding for spacing */ 62 | } 63 | 64 | .navbar-nav > li > a:hover { 65 | background-color: #c5e1f5; /* Hover effect for links */ 66 | border-radius: 4px; /* Rounded corners on hover */ 67 | } 68 | 69 | .navbar-content { 70 | width: auto; /* Auto width for better alignment */ 71 | padding: 10px; 72 | padding-bottom: 0; 73 | text-align: center; /* Center align content for a more balanced look */ 74 | } 75 | 76 | .navbar-collapse.collapse { 77 | display: block !important; 78 | height: auto !important; 79 | padding-bottom: 0; 80 | overflow: visible !important; 81 | } 82 | 83 | .navbar-nav.navbar-right { 84 | float: right; /* Float right for login and sign-up links */ 85 | } 86 | 87 | .navbar-nav.navbar-right > li { 88 | display: inline-block; /* Display inline for horizontal layout */ 89 | margin-left: 15px; /* Space between items */ 90 | } 91 | 92 | /* Header Styles */ 93 | .header-img { 94 | width: 100%; 95 | height: auto; 96 | opacity: 0.8; 97 | } 98 | 99 | .header-text { 100 | color: #26c6da; 101 | text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); 102 | text-align: center; 103 | font-size: 3em; 104 | } 105 | 106 | /* Section Styles */ 107 | #contact, #technologies, #about { 108 | background: white; 109 | padding: 25px; 110 | margin: 50px 0; 111 | border-radius: 8px; 112 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 113 | } 114 | 115 | #contact h3, #technologies h3, #about h3 { 116 | color: black; 117 | font-size: 30px; 118 | font-weight: 600; 119 | margin-bottom: 20px; 120 | text-align: center; 121 | } 122 | 123 | /* Contact Form Adjustments */ 124 | #contact-form { 125 | display: flex; 126 | flex-direction: column; 127 | align-items: center; 128 | justify-content: center; 129 | 130 | padding: 1px; 131 | } 132 | 133 | form { 134 | width: 100%; 135 | max-width: 600px; /* Limit the maximum width of the form */ 136 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 137 | padding: 20px; 138 | background: white; 139 | border-radius: 8px; 140 | } 141 | 142 | #contact-form p { 143 | text-align: center; 144 | margin-bottom: 20px; 145 | } 146 | 147 | #contact input[type="text"], 148 | #contact input[type="email"], 149 | #contact input[type="tel"], 150 | #contact input[type="url"], 151 | #contact textarea { 152 | width: 100%; 153 | border: 1px solid #CCC; 154 | background: #FFF; 155 | margin: 0 0 10px; 156 | padding: 10px; 157 | border-radius: 4px; 158 | font-size: 16px; 159 | } 160 | 161 | #contact input[type="text"]:hover, 162 | #contact input[type="email"]:hover, 163 | #contact input[type="tel"]:hover, 164 | #contact input[type="url"]:hover, 165 | #contact textarea:hover { 166 | border-color: #AAA; 167 | } 168 | 169 | #contact textarea { 170 | height: 100px; 171 | resize: vertical; 172 | } 173 | 174 | #contact button[type="submit"] { 175 | cursor: pointer; 176 | width: 100%; 177 | border: none; 178 | background: #26c6da; 179 | color: #FFF; 180 | padding: 10px; 181 | font-size: 16px; 182 | border-radius: 4px; 183 | } 184 | 185 | #contact button[type="submit"]:hover { 186 | background: #1e88e5; 187 | } 188 | 189 | #contact input:focus, 190 | #contact textarea:focus { 191 | outline: 0; 192 | border-color: #999; 193 | } 194 | 195 | ::-webkit-input-placeholder { 196 | color: #888; 197 | } 198 | 199 | :-moz-placeholder { 200 | color: #888; 201 | } 202 | 203 | ::-moz-placeholder { 204 | color: #888; 205 | } 206 | 207 | :-ms-input-placeholder { 208 | color: #888; 209 | } 210 | 211 | /* Blockquote Styles */ 212 | blockquote { 213 | background: #fff; 214 | padding: 15px 20px; 215 | margin: 0 0 20px; 216 | position: relative; 217 | } 218 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/HELP-US-OUT.txt: -------------------------------------------------------------------------------- 1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, 2 | Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, 3 | comprehensive icon sets or copy and paste your own. 4 | 5 | Please. Check it out. 6 | 7 | -Dave Gandy 8 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/font-awesome-4.7.0/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/less/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .@{fa-css-prefix}-pull-left { float: left; } 11 | .@{fa-css-prefix}-pull-right { float: right; } 12 | 13 | .@{fa-css-prefix} { 14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .@{fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | @import "screen-reader.less"; 19 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | .fa-icon-rotate(@degrees, @rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})"; 16 | -webkit-transform: rotate(@degrees); 17 | -ms-transform: rotate(@degrees); 18 | transform: rotate(@degrees); 19 | } 20 | 21 | .fa-icon-flip(@horiz, @vert, @rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)"; 23 | -webkit-transform: scale(@horiz, @vert); 24 | -ms-transform: scale(@horiz, @vert); 25 | transform: scale(@horiz, @vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | .sr-only() { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | .sr-only-focusable() { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/less/screen-reader.less: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { .sr-only(); } 5 | .sr-only-focusable { .sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | @mixin fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | @mixin fa-icon-rotate($degrees, $rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})"; 16 | -webkit-transform: rotate($degrees); 17 | -ms-transform: rotate($degrees); 18 | transform: rotate($degrees); 19 | } 20 | 21 | @mixin fa-icon-flip($horiz, $vert, $rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)"; 23 | -webkit-transform: scale($horiz, $vert); 24 | -ms-transform: scale($horiz, $vert); 25 | transform: scale($horiz, $vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | @mixin sr-only { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | @mixin sr-only-focusable { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/scss/_screen-reader.scss: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { @include sr-only(); } 5 | .sr-only-focusable { @include sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/font-awesome-4.7.0/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | @import "screen-reader"; 19 | -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/iconic/fonts/Material-Design-Iconic-Font.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/iconic/fonts/Material-Design-Iconic-Font.eot -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/iconic/fonts/Material-Design-Iconic-Font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/iconic/fonts/Material-Design-Iconic-Font.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/iconic/fonts/Material-Design-Iconic-Font.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/iconic/fonts/Material-Design-Iconic-Font.woff -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/iconic/fonts/Material-Design-Iconic-Font.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/iconic/fonts/Material-Design-Iconic-Font.woff2 -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-Black.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-BlackItalic.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-Bold.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-BoldItalic.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-ExtraBold.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-ExtraLight.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-ExtraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-ExtraLightItalic.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-Italic.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-Light.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-LightItalic.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-Medium.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-MediumItalic.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-Regular.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-SemiBold.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-Thin.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/fonts/poppins/Poppins-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/src/main/webapp/resources/fonts/poppins/Poppins-ThinItalic.ttf -------------------------------------------------------------------------------- /src/main/webapp/resources/js/main.js: -------------------------------------------------------------------------------- 1 | 2 | (function ($) { 3 | "use strict"; 4 | 5 | 6 | /*================================================================== 7 | [ Focus input ]*/ 8 | $('.input100').each(function(){ 9 | $(this).on('blur', function(){ 10 | if($(this).val().trim() != "") { 11 | $(this).addClass('has-val'); 12 | } 13 | else { 14 | $(this).removeClass('has-val'); 15 | } 16 | }) 17 | }) 18 | 19 | 20 | /*================================================================== 21 | [ Validate ]*/ 22 | var input = $('.validate-input .input100'); 23 | 24 | $('.validate-form').on('submit',function(){ 25 | var check = true; 26 | 27 | for(var i=0; i0&&(!o||!this.length))return"console"in window||(window.console={},window.console.log=function(t){return t}),this.length||console.log("Animsition: Element does not exist on page."),o||console.log("Animsition: Does not support this browser."),i.destroy.call(this);var e=i.optionCheck.call(this,a);return e&&t("."+a.overlayClass).length<=0&&i.addOverlay.call(this,a),a.loading&&t("."+a.loadingClass).length<=0&&i.addLoading.call(this,a),this.each(function(){var o=this,e=t(this),s=t(window),r=t(document),l=e.data(n);l||(a=t.extend({},a),e.data(n,{options:a}),a.timeout&&i.addTimer.call(o),a.onLoadEvent&&s.on("load."+n,function(){i.settings.timer&&clearTimeout(i.settings.timer),i["in"].call(o)}),s.on("pageshow."+n,function(t){t.originalEvent.persisted&&i["in"].call(o)}),s.on("unload."+n,function(){}),r.on("click."+n,a.linkElement,function(n){n.preventDefault();var a=t(this),e=a.attr("href");2===n.which||n.metaKey||n.shiftKey||-1!==navigator.platform.toUpperCase().indexOf("WIN")&&n.ctrlKey?window.open(e,"_blank"):i.out.call(o,a,e)}))})},addOverlay:function(n){t(n.overlayParentElement).prepend('
')},addLoading:function(n){t(n.loadingParentElement).append('
'+n.loadingInner+"
")},removeLoading:function(){var i=t(this),a=i.data(n).options,o=t(a.loadingParentElement).children("."+a.loadingClass);o.fadeOut().remove()},addTimer:function(){var a=this,o=t(this),e=o.data(n).options;i.settings.timer=setTimeout(function(){i["in"].call(a),t(window).off("load."+n)},e.timeoutCountdown)},supportCheck:function(n){var i=t(this),a=n.browser,o=a.length,e=!1;0===o&&(e=!0);for(var s=0;o>s;s++)if("string"==typeof i.css(a[s])){e=!0;break}return e},optionCheck:function(n){var a,o=t(this);return a=n.overlay||o.data(i.settings.data.overlay)?!0:!1},animationCheck:function(i,a,o){var e=t(this),s=e.data(n).options,r=typeof i,l=!a&&"number"===r,d=a&&"string"===r&&i.length>0;return l||d?i=i:a&&o?i=s.inClass:!a&&o?i=s.inDuration:a&&!o?i=s.outClass:a||o||(i=s.outDuration),i},"in":function(){var a=this,o=t(this),e=o.data(n).options,s=o.data(i.settings.data.inDuration),r=o.data(i.settings.data.inClass),l=i.animationCheck.call(a,s,!1,!0),d=i.animationCheck.call(a,r,!0,!0),u=i.optionCheck.call(a,e),c=o.data(n).outClass;e.loading&&i.removeLoading.call(a),c&&o.removeClass(c),u?i.inOverlay.call(a,d,l):i.inDefault.call(a,d,l)},inDefault:function(n,a){var o=t(this);o.css({"animation-duration":a+"ms"}).addClass(n).trigger(i.settings.events.inStart).animateCallback(function(){o.removeClass(n).css({opacity:1}).trigger(i.settings.events.inEnd)})},inOverlay:function(a,o){var e=t(this),s=e.data(n).options;e.css({opacity:1}).trigger(i.settings.events.inStart),t(s.overlayParentElement).children("."+s.overlayClass).css({"animation-duration":o+"ms"}).addClass(a).animateCallback(function(){e.trigger(i.settings.events.inEnd)})},out:function(a,o){var e=this,s=t(this),r=s.data(n).options,l=a.data(i.settings.data.outClass),d=s.data(i.settings.data.outClass),u=a.data(i.settings.data.outDuration),c=s.data(i.settings.data.outDuration),m=l?l:d,g=u?u:c,f=i.animationCheck.call(e,m,!0,!1),v=i.animationCheck.call(e,g,!1,!1),h=i.optionCheck.call(e,r);s.data(n).outClass=f,h?i.outOverlay.call(e,f,v,o):i.outDefault.call(e,f,v,o)},outDefault:function(a,o,e){var s=t(this),r=s.data(n).options;s.css({"animation-duration":o+1+"ms"}).addClass(a).trigger(i.settings.events.outStart).animateCallback(function(){s.trigger(i.settings.events.outEnd),r.transition(e)})},outOverlay:function(a,o,e){var s=this,r=t(this),l=r.data(n).options,d=r.data(i.settings.data.inClass),u=i.animationCheck.call(s,d,!0,!0);t(l.overlayParentElement).children("."+l.overlayClass).css({"animation-duration":o+1+"ms"}).removeClass(u).addClass(a).trigger(i.settings.events.outStart).animateCallback(function(){r.trigger(i.settings.events.outEnd),l.transition(e)})},destroy:function(){return this.each(function(){var i=t(this);t(window).off("."+n),i.css({opacity:1}).removeData(n)})}};t.fn.animateCallback=function(n){var i="animationend webkitAnimationEnd";return this.each(function(){var a=t(this);a.on(i,function(){return a.off(i),n.call(this)})})},t.fn.animsition=function(a){return i[a]?i[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?void t.error("Method "+a+" does not exist on jQuery."+n):i.init.apply(this,arguments)}}); -------------------------------------------------------------------------------- /src/main/webapp/resources/vendor/bootstrap/css/bootstrap-reboot.css: -------------------------------------------------------------------------------- 1 | html { 2 | box-sizing: border-box; 3 | font-family: sans-serif; 4 | line-height: 1.15; 5 | -webkit-text-size-adjust: 100%; 6 | -ms-text-size-adjust: 100%; 7 | -ms-overflow-style: scrollbar; 8 | -webkit-tap-highlight-color: transparent; 9 | } 10 | 11 | *, 12 | *::before, 13 | *::after { 14 | box-sizing: inherit; 15 | } 16 | 17 | @-ms-viewport { 18 | width: device-width; 19 | } 20 | 21 | article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section { 22 | display: block; 23 | } 24 | 25 | body { 26 | margin: 0; 27 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 28 | font-size: 1rem; 29 | font-weight: normal; 30 | line-height: 1.5; 31 | color: #212529; 32 | background-color: #fff; 33 | } 34 | 35 | [tabindex="-1"]:focus { 36 | outline: none !important; 37 | } 38 | 39 | hr { 40 | box-sizing: content-box; 41 | height: 0; 42 | overflow: visible; 43 | } 44 | 45 | h1, h2, h3, h4, h5, h6 { 46 | margin-top: 0; 47 | margin-bottom: .5rem; 48 | } 49 | 50 | p { 51 | margin-top: 0; 52 | margin-bottom: 1rem; 53 | } 54 | 55 | abbr[title], 56 | abbr[data-original-title] { 57 | text-decoration: underline; 58 | -webkit-text-decoration: underline dotted; 59 | text-decoration: underline dotted; 60 | cursor: help; 61 | border-bottom: 0; 62 | } 63 | 64 | address { 65 | margin-bottom: 1rem; 66 | font-style: normal; 67 | line-height: inherit; 68 | } 69 | 70 | ol, 71 | ul, 72 | dl { 73 | margin-top: 0; 74 | margin-bottom: 1rem; 75 | } 76 | 77 | ol ol, 78 | ul ul, 79 | ol ul, 80 | ul ol { 81 | margin-bottom: 0; 82 | } 83 | 84 | dt { 85 | font-weight: bold; 86 | } 87 | 88 | dd { 89 | margin-bottom: .5rem; 90 | margin-left: 0; 91 | } 92 | 93 | blockquote { 94 | margin: 0 0 1rem; 95 | } 96 | 97 | dfn { 98 | font-style: italic; 99 | } 100 | 101 | b, 102 | strong { 103 | font-weight: bolder; 104 | } 105 | 106 | small { 107 | font-size: 80%; 108 | } 109 | 110 | sub, 111 | sup { 112 | position: relative; 113 | font-size: 75%; 114 | line-height: 0; 115 | vertical-align: baseline; 116 | } 117 | 118 | sub { 119 | bottom: -.25em; 120 | } 121 | 122 | sup { 123 | top: -.5em; 124 | } 125 | 126 | a { 127 | color: #007bff; 128 | text-decoration: none; 129 | background-color: transparent; 130 | -webkit-text-decoration-skip: objects; 131 | } 132 | 133 | a:hover { 134 | color: #0056b3; 135 | text-decoration: underline; 136 | } 137 | 138 | a:not([href]):not([tabindex]) { 139 | color: inherit; 140 | text-decoration: none; 141 | } 142 | 143 | a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover { 144 | color: inherit; 145 | text-decoration: none; 146 | } 147 | 148 | a:not([href]):not([tabindex]):focus { 149 | outline: 0; 150 | } 151 | 152 | pre, 153 | code, 154 | kbd, 155 | samp { 156 | font-family: monospace, monospace; 157 | font-size: 1em; 158 | } 159 | 160 | pre { 161 | margin-top: 0; 162 | margin-bottom: 1rem; 163 | overflow: auto; 164 | } 165 | 166 | figure { 167 | margin: 0 0 1rem; 168 | } 169 | 170 | img { 171 | vertical-align: middle; 172 | border-style: none; 173 | } 174 | 175 | svg:not(:root) { 176 | overflow: hidden; 177 | } 178 | 179 | a, 180 | area, 181 | button, 182 | [role="button"], 183 | input, 184 | label, 185 | select, 186 | summary, 187 | textarea { 188 | -ms-touch-action: manipulation; 189 | touch-action: manipulation; 190 | } 191 | 192 | table { 193 | border-collapse: collapse; 194 | } 195 | 196 | caption { 197 | padding-top: 0.75rem; 198 | padding-bottom: 0.75rem; 199 | color: #868e96; 200 | text-align: left; 201 | caption-side: bottom; 202 | } 203 | 204 | th { 205 | text-align: left; 206 | } 207 | 208 | label { 209 | display: inline-block; 210 | margin-bottom: .5rem; 211 | } 212 | 213 | button:focus { 214 | outline: 1px dotted; 215 | outline: 5px auto -webkit-focus-ring-color; 216 | } 217 | 218 | input, 219 | button, 220 | select, 221 | optgroup, 222 | textarea { 223 | margin: 0; 224 | font-family: inherit; 225 | font-size: inherit; 226 | line-height: inherit; 227 | } 228 | 229 | button, 230 | input { 231 | overflow: visible; 232 | } 233 | 234 | button, 235 | select { 236 | text-transform: none; 237 | } 238 | 239 | button, 240 | html [type="button"], 241 | [type="reset"], 242 | [type="submit"] { 243 | -webkit-appearance: button; 244 | } 245 | 246 | button::-moz-focus-inner, 247 | [type="button"]::-moz-focus-inner, 248 | [type="reset"]::-moz-focus-inner, 249 | [type="submit"]::-moz-focus-inner { 250 | padding: 0; 251 | border-style: none; 252 | } 253 | 254 | input[type="radio"], 255 | input[type="checkbox"] { 256 | box-sizing: border-box; 257 | padding: 0; 258 | } 259 | 260 | input[type="date"], 261 | input[type="time"], 262 | input[type="datetime-local"], 263 | input[type="month"] { 264 | -webkit-appearance: listbox; 265 | } 266 | 267 | textarea { 268 | overflow: auto; 269 | resize: vertical; 270 | } 271 | 272 | fieldset { 273 | min-width: 0; 274 | padding: 0; 275 | margin: 0; 276 | border: 0; 277 | } 278 | 279 | legend { 280 | display: block; 281 | width: 100%; 282 | max-width: 100%; 283 | padding: 0; 284 | margin-bottom: .5rem; 285 | font-size: 1.5rem; 286 | line-height: inherit; 287 | color: inherit; 288 | white-space: normal; 289 | } 290 | 291 | progress { 292 | vertical-align: baseline; 293 | } 294 | 295 | [type="number"]::-webkit-inner-spin-button, 296 | [type="number"]::-webkit-outer-spin-button { 297 | height: auto; 298 | } 299 | 300 | [type="search"] { 301 | outline-offset: -2px; 302 | -webkit-appearance: none; 303 | } 304 | 305 | [type="search"]::-webkit-search-cancel-button, 306 | [type="search"]::-webkit-search-decoration { 307 | -webkit-appearance: none; 308 | } 309 | 310 | ::-webkit-file-upload-button { 311 | font: inherit; 312 | -webkit-appearance: button; 313 | } 314 | 315 | output { 316 | display: inline-block; 317 | } 318 | 319 | summary { 320 | display: list-item; 321 | } 322 | 323 | template { 324 | display: none; 325 | } 326 | 327 | [hidden] { 328 | display: none !important; 329 | } 330 | /*# sourceMappingURL=bootstrap-reboot.css.map */ -------------------------------------------------------------------------------- /src/main/webapp/resources/vendor/bootstrap/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | html{box-sizing:border-box;font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}*,::after,::before{box-sizing:inherit}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}[role=button],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#868e96;text-align:left;caption-side:bottom}th{text-align:left}label{display:inline-block;margin-bottom:.5rem}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important} 2 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /src/main/webapp/resources/vendor/countdowntime/countdowntime.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | "use strict"; 3 | 4 | function getTimeRemaining(endtime) { 5 | var t = Date.parse(endtime) - Date.parse(new Date()); 6 | var seconds = Math.floor((t / 1000) % 60); 7 | var minutes = Math.floor((t / 1000 / 60) % 60); 8 | var hours = Math.floor((t / (1000 * 60 * 60)) % 24); 9 | var days = Math.floor(t / (1000 * 60 * 60 * 24)); 10 | return { 11 | 'total': t, 12 | 'days': days, 13 | 'hours': hours, 14 | 'minutes': minutes, 15 | 'seconds': seconds 16 | }; 17 | } 18 | 19 | function initializeClock(id, endtime) { 20 | var daysSpan = $('.days'); 21 | var hoursSpan = $('.hours'); 22 | var minutesSpan = $('.minutes'); 23 | var secondsSpan = $('.seconds'); 24 | 25 | function updateClock() { 26 | var t = getTimeRemaining(endtime); 27 | 28 | daysSpan.html(t.days); 29 | hoursSpan.html(('0' + t.hours).slice(-2)); 30 | minutesSpan.html(('0' + t.minutes).slice(-2)); 31 | secondsSpan.html(('0' + t.seconds).slice(-2)) 32 | 33 | if (t.total <= 0) { 34 | clearInterval(timeinterval); 35 | } 36 | } 37 | 38 | updateClock(); 39 | var timeinterval = setInterval(updateClock, 1000); 40 | } 41 | 42 | var deadline = new Date(Date.parse(new Date()) + 25 * 24 * 60 * 60 * 1000 + 13 * 60 * 60 * 1000); 43 | initializeClock('clockdiv', deadline); 44 | 45 | })(jQuery); -------------------------------------------------------------------------------- /src/main/webapp/resources/vendor/perfect-scrollbar/perfect-scrollbar.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Container style 3 | */ 4 | .ps { 5 | overflow: hidden !important; 6 | overflow-anchor: none; 7 | -ms-overflow-style: none; 8 | touch-action: auto; 9 | -ms-touch-action: auto; 10 | } 11 | 12 | /* 13 | * Scrollbar rail styles 14 | */ 15 | .ps__rail-x { 16 | display: none; 17 | opacity: 0; 18 | transition: background-color .2s linear, opacity .2s linear; 19 | -webkit-transition: background-color .2s linear, opacity .2s linear; 20 | height: 15px; 21 | /* there must be 'bottom' or 'top' for ps__rail-x */ 22 | bottom: 0px; 23 | /* please don't change 'position' */ 24 | position: absolute; 25 | } 26 | 27 | .ps__rail-y { 28 | display: none; 29 | opacity: 0; 30 | transition: background-color .2s linear, opacity .2s linear; 31 | -webkit-transition: background-color .2s linear, opacity .2s linear; 32 | width: 15px; 33 | /* there must be 'right' or 'left' for ps__rail-y */ 34 | right: 0; 35 | /* please don't change 'position' */ 36 | position: absolute; 37 | } 38 | 39 | .ps--active-x > .ps__rail-x, 40 | .ps--active-y > .ps__rail-y { 41 | display: block; 42 | background-color: transparent; 43 | } 44 | 45 | .ps:hover > .ps__rail-x, 46 | .ps:hover > .ps__rail-y, 47 | .ps--focus > .ps__rail-x, 48 | .ps--focus > .ps__rail-y, 49 | .ps--scrolling-x > .ps__rail-x, 50 | .ps--scrolling-y > .ps__rail-y { 51 | opacity: 0.6; 52 | } 53 | 54 | .ps__rail-x:hover, 55 | .ps__rail-y:hover, 56 | .ps__rail-x:focus, 57 | .ps__rail-y:focus { 58 | background-color: #eee; 59 | opacity: 0.9; 60 | } 61 | 62 | /* 63 | * Scrollbar thumb styles 64 | */ 65 | .ps__thumb-x { 66 | background-color: #aaa; 67 | border-radius: 6px; 68 | transition: background-color .2s linear, height .2s ease-in-out; 69 | -webkit-transition: background-color .2s linear, height .2s ease-in-out; 70 | height: 6px; 71 | /* there must be 'bottom' for ps__thumb-x */ 72 | bottom: 2px; 73 | /* please don't change 'position' */ 74 | position: absolute; 75 | } 76 | 77 | .ps__thumb-y { 78 | background-color: #aaa; 79 | border-radius: 6px; 80 | transition: background-color .2s linear, width .2s ease-in-out; 81 | -webkit-transition: background-color .2s linear, width .2s ease-in-out; 82 | width: 6px; 83 | /* there must be 'right' for ps__thumb-y */ 84 | right: 2px; 85 | /* please don't change 'position' */ 86 | position: absolute; 87 | } 88 | 89 | .ps__rail-x:hover > .ps__thumb-x, 90 | .ps__rail-x:focus > .ps__thumb-x { 91 | background-color: #999; 92 | height: 11px; 93 | } 94 | 95 | .ps__rail-y:hover > .ps__thumb-y, 96 | .ps__rail-y:focus > .ps__thumb-y { 97 | background-color: #999; 98 | width: 11px; 99 | } 100 | 101 | /* MS supports */ 102 | @supports (-ms-overflow-style: none) { 103 | .ps { 104 | overflow: auto !important; 105 | } 106 | } 107 | 108 | @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { 109 | .ps { 110 | overflow: auto !important; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/test/java/com/visualpathit/account/controllerTest/SampleTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controllerTest; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import org.junit.Test; 6 | 7 | public class SampleTest { 8 | @Test 9 | public void SampleTestHappyFlow(){ 10 | assertEquals("Hello".length(), 5); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/java/com/visualpathit/account/controllerTest/UserControllerTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controllerTest; 2 | 3 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; 4 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; 5 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl; 6 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; 7 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view; 8 | 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | import org.mockito.InjectMocks; 12 | import org.mockito.Mock; 13 | import org.mockito.MockitoAnnotations; 14 | import org.springframework.test.web.servlet.MockMvc; 15 | import org.springframework.test.web.servlet.setup.MockMvcBuilders; 16 | 17 | 18 | import com.visualpathit.account.controller.UserController; 19 | import com.visualpathit.account.model.User; 20 | import com.visualpathit.account.service.UserService; 21 | import com.visualpathit.account.setup.StandaloneMvcTestViewResolver; 22 | 23 | 24 | 25 | 26 | public class UserControllerTest { 27 | 28 | @Mock 29 | private UserService controllerSer; 30 | @InjectMocks 31 | private UserController controller; 32 | private MockMvc mockMvc; 33 | 34 | @Before 35 | public void setup(){ 36 | MockitoAnnotations.initMocks(this); 37 | 38 | /*InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); 39 | viewResolver.setPrefix("/WEB-INF/views/"); 40 | viewResolver.setSuffix(".jsp"); 41 | */ 42 | mockMvc = MockMvcBuilders.standaloneSetup(controller) 43 | .setViewResolvers(new StandaloneMvcTestViewResolver()).build(); 44 | } 45 | 46 | @Test 47 | public void registrationTestforHappyFlow() throws Exception{ 48 | User user = new User(); 49 | mockMvc.perform(get("/registration")) 50 | .andExpect(status().isOk()) 51 | .andExpect(view().name("registration")) 52 | .andExpect(forwardedUrl("registration")); 53 | 54 | } 55 | @Test 56 | public void registrationTestforNullValueHappyFlow() throws Exception{ 57 | mockMvc.perform(get("/registration")) 58 | .andExpect(status().isOk()) 59 | .andExpect(view().name("registration")) 60 | .andExpect(forwardedUrl("registration")); 61 | 62 | } 63 | /*@Test 64 | public void registrationTestforPostValueHappyFlow() throws Exception{ 65 | String description =new String("Error String"); 66 | UserValidator userValidator; 67 | BindingResult bindingResult; 68 | when(userValidator.validate(new User(),bindingResult)) 69 | .thenThrow(bindingResult.hasErrors()); 70 | mockMvc.perform(post("/registration").contentType(MediaType.APPLICATION_FORM_URLENCODED) 71 | .param("userForm","userForm")) 72 | 73 | .andExpect(status().isOk()); 74 | //.andExpect(view().name("redirect:/welcome")) 75 | //.andExpect(forwardedUrl("redirect:/welcome")); 76 | 77 | }*/ 78 | @Test 79 | public void loginTestHappyFlow() throws Exception{ 80 | String error = "Your username and password is invalid"; 81 | mockMvc.perform(get("/login").param(error, error)) 82 | .andExpect(status().isOk()) 83 | .andExpect(view().name("login")) 84 | .andExpect(forwardedUrl("login")); 85 | 86 | } 87 | @Test 88 | public void welcomeTestHappyFlow() throws Exception{ 89 | mockMvc.perform(get("/welcome")) 90 | .andExpect(status().isOk()) 91 | .andExpect(view().name("welcome")) 92 | .andExpect(forwardedUrl("welcome")); 93 | 94 | } 95 | @Test 96 | public void welcomeAfterDirectLoginTestHappyFlow() throws Exception{ 97 | mockMvc.perform(get("/")) 98 | .andExpect(status().isOk()) 99 | .andExpect(view().name("welcome")) 100 | .andExpect(forwardedUrl("welcome")); 101 | 102 | } 103 | @Test 104 | public void indexTestHappyFlow() throws Exception{ 105 | mockMvc.perform(get("/index")) 106 | .andExpect(status().isOk()) 107 | .andExpect(view().name("index_home")) 108 | .andExpect(forwardedUrl("index_home")); 109 | 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /src/test/java/com/visualpathit/account/modelTest/RoleTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.modelTest; 2 | 3 | import junit.framework.Assert; 4 | 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | import org.junit.After; 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | 12 | import com.visualpathit.account.model.Role; 13 | import com.visualpathit.account.model.User; 14 | 15 | /** {@author imrant} !*/ 16 | public class RoleTest { 17 | 18 | public static final Long EXPECTED_ID = 1L; 19 | public static final String EXPECTED_ROLENAME = "Admin"; 20 | public static final int EXPECTED_SIZE = 1; 21 | private Role role; 22 | @Before 23 | public void setUp() throws Exception { 24 | User user = new User(); 25 | user.setId(1L); 26 | user.setUsername("Wahidkhan74"); 27 | user.setPassword("Wahidkhan74"); 28 | user.setUserEmail("XXXXX@gmail.com"); 29 | 30 | Set users = new HashSet(); 31 | users.add(user); 32 | role = new Role(); 33 | role.setId(1L); 34 | role.setName("Admin"); 35 | role.setUsers(users); 36 | } 37 | 38 | @After 39 | public void tearDown() throws Exception { 40 | System.out.println("Test Completed"); 41 | 42 | } 43 | 44 | @Test 45 | public void testUserDetailsHappyFlow() throws Exception { 46 | Assert.assertEquals(EXPECTED_ID, role.getId()); 47 | Assert.assertEquals(EXPECTED_ROLENAME, role.getName()); 48 | Assert.assertEquals(EXPECTED_SIZE,role.getUsers().size()); 49 | 50 | } 51 | } -------------------------------------------------------------------------------- /src/test/java/com/visualpathit/account/modelTest/UserTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.modelTest; 2 | 3 | import junit.framework.Assert; 4 | 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | import org.junit.After; 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | 12 | import com.visualpathit.account.model.Role; 13 | import com.visualpathit.account.model.User; 14 | 15 | /** {@author imrant} !*/ 16 | public class UserTest { 17 | 18 | public static final Long EXPECTED_ID = 1L; 19 | public static final int EXPECTED_SIZE = 1; 20 | public static final String EXPECTED_USERNAME = "Wahidkhan74"; 21 | public static final String EXPECTED_PASSWD = "Wahidkhan74"; 22 | public static final String EXPECTED_USEREMAIL = "XXXXX@gmail.com"; 23 | private User user; 24 | @Before 25 | public void setUp() throws Exception { 26 | 27 | Role role = new Role(); 28 | role.setId(1L); 29 | role.setName("Admin"); 30 | Set roles = new HashSet(); 31 | roles.add(role); 32 | 33 | user = new User(); 34 | user.setId(1L); 35 | user.setUsername("Wahidkhan74"); 36 | user.setPassword("Wahidkhan74"); 37 | user.setUserEmail("XXXXX@gmail.com"); 38 | user.setRoles(roles); 39 | } 40 | 41 | @After 42 | public void tearDown() throws Exception { 43 | System.out.println("Test Completed"); 44 | 45 | } 46 | 47 | @Test 48 | public void testUserDetailsHappyFlow() throws Exception { 49 | Assert.assertEquals(EXPECTED_ID, user.getId()); 50 | Assert.assertEquals(EXPECTED_USERNAME, user.getUsername()); 51 | Assert.assertEquals(EXPECTED_PASSWD, user.getPassword()); 52 | Assert.assertEquals(EXPECTED_USEREMAIL, user.getUserEmail()); 53 | Assert.assertEquals(EXPECTED_SIZE,user.getRoles().size()); 54 | 55 | } 56 | } -------------------------------------------------------------------------------- /src/test/java/com/visualpathit/account/setup/StandaloneMvcTestViewResolver.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.setup; 2 | 3 | import org.springframework.web.servlet.view.AbstractUrlBasedView; 4 | import org.springframework.web.servlet.view.InternalResourceView; 5 | import org.springframework.web.servlet.view.InternalResourceViewResolver; 6 | 7 | public class StandaloneMvcTestViewResolver extends InternalResourceViewResolver { 8 | 9 | public StandaloneMvcTestViewResolver() { 10 | super(); 11 | } 12 | 13 | @Override 14 | protected AbstractUrlBasedView buildView(final String viewName) throws Exception { 15 | final InternalResourceView view = (InternalResourceView) super.buildView(viewName); 16 | // prevent checking for circular view paths 17 | view.setPreventDispatchLoop(false); 18 | return view; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_MacOSM1/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.hostmanager.enabled = true 3 | config.hostmanager.manage_host = true 4 | 5 | ### DB vm #### 6 | config.vm.define "db01" do |db01| 7 | db01.vm.box = "bandit145/centos_stream9_arm" 8 | db01.vm.hostname = "db01" 9 | db01.vm.network "private_network", ip: "192.168.56.25" 10 | db01.vm.provision "shell", path: "mysql.sh" 11 | 12 | end 13 | 14 | ### Memcache vm #### 15 | config.vm.define "mc01" do |mc01| 16 | mc01.vm.box = "bandit145/centos_stream9_arm" 17 | mc01.vm.hostname = "mc01" 18 | mc01.vm.network "private_network", ip: "192.168.56.24" 19 | mc01.vm.provision "shell", path: "memcache.sh" 20 | end 21 | 22 | ### RabbitMQ vm #### 23 | config.vm.define "rmq01" do |rmq01| 24 | rmq01.vm.box = "bandit145/centos_stream9_arm" 25 | rmq01.vm.hostname = "rmq01" 26 | rmq01.vm.network "private_network", ip: "192.168.56.23" 27 | rmq01.vm.provision "shell", path: "rabbitmq.sh" 28 | end 29 | 30 | ### tomcat vm ### 31 | config.vm.define "app01" do |app01| 32 | app01.vm.box = "bandit145/centos_stream9_arm" 33 | app01.vm.hostname = "app01" 34 | app01.vm.network "private_network", ip: "192.168.56.22" 35 | app01.vm.provision "shell", path: "tomcat.sh" 36 | app01.vm.provider "vmware_desktop" do |vb| 37 | vb.memory = "1024" 38 | end 39 | end 40 | 41 | 42 | ### Nginx VM ### 43 | config.vm.define "web01" do |web01| 44 | web01.vm.box = "spox/ubuntu-arm" 45 | web01.vm.hostname = "web01" 46 | web01.vm.network "private_network", ip: "192.168.56.21" 47 | web01.vm.provision "shell", path: "nginx.sh" 48 | end 49 | 50 | end 51 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_MacOSM1/backend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DATABASE_PASS='admin123' 3 | 4 | # MEmcache 5 | yum install epel-release -y 6 | yum install memcached -y 7 | systemctl start memcached 8 | systemctl enable memcached 9 | systemctl status memcached 10 | memcached -p 11211 -U 11111 -u memcached -d 11 | 12 | # Rabbit 13 | yum install socat -y 14 | yum install erlang -y 15 | yum install wget -y 16 | wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-3.6.10-1.el7.noarch.rpm 17 | rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc 18 | yum update 19 | rpm -Uvh rabbitmq-server-3.6.10-1.el7.noarch.rpm 20 | systemctl start rabbitmq-server 21 | systemctl enable rabbitmq-server 22 | systemctl status rabbitmq-server 23 | echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config 24 | rabbitmqctl add_user rabbit bunny 25 | rabbitmqctl set_user_tags rabbit administrator 26 | systemctl restart rabbitmq-server 27 | 28 | # Mysql 29 | yum install mariadb-server -y 30 | 31 | #mysql_secure_installation 32 | sed -i 's/^127.0.0.1/0.0.0.0/' /etc/my.cnf 33 | 34 | # starting & enabling mariadb-server 35 | systemctl start mariadb 36 | systemctl enable mariadb 37 | 38 | #restore the dump file for the application 39 | mysqladmin -u root password "$DATABASE_PASS" 40 | mysql -u root -p"$DATABASE_PASS" -e "UPDATE mysql.user SET Password=PASSWORD('$DATABASE_PASS') WHERE User='root'" 41 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" 42 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User=''" 43 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'" 44 | mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 45 | mysql -u root -p"$DATABASE_PASS" -e "create database accounts" 46 | mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'localhost' identified by 'admin123'" 47 | mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'app01' identified by 'admin123'" 48 | mysql -u root -p"$DATABASE_PASS" accounts < /vagrant/vprofile-repo/src/main/resources/db_backup.sql 49 | mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 50 | 51 | # Restart mariadb-server 52 | systemctl restart mariadb -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_MacOSM1/memcache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo dnf install epel-release -y 3 | sudo dnf install memcached -y 4 | sudo systemctl start memcached 5 | sudo systemctl enable memcached 6 | sudo systemctl status memcached 7 | sed -i 's/127.0.0.1/0.0.0.0/g' /etc/sysconfig/memcached 8 | sudo systemctl restart memcached 9 | firewall-cmd --add-port=11211/tcp 10 | firewall-cmd --runtime-to-permanent 11 | firewall-cmd --add-port=11111/udp 12 | firewall-cmd --runtime-to-permanent 13 | sudo memcached -p 11211 -U 11111 -u memcached -d 14 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_MacOSM1/mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DATABASE_PASS='admin123' 3 | sudo yum update -y 4 | sudo yum install epel-release -y 5 | sudo yum install git zip unzip -y 6 | sudo yum install mariadb-server -y 7 | 8 | 9 | # starting & enabling mariadb-server 10 | sudo systemctl start mariadb 11 | sudo systemctl enable mariadb 12 | cd /tmp/ 13 | git clone -b main https://github.com/hkhcoder/vprofile-project.git 14 | #restore the dump file for the application 15 | sudo mysqladmin -u root password "$DATABASE_PASS" 16 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" 17 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User=''" 18 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'" 19 | sudo mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 20 | sudo mysql -u root -p"$DATABASE_PASS" -e "create database accounts" 21 | sudo mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'localhost' identified by 'admin123'" 22 | sudo mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'%' identified by 'admin123'" 23 | sudo mysql -u root -p"$DATABASE_PASS" accounts < /tmp/vprofile-project/src/main/resources/db_backup.sql 24 | sudo mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 25 | 26 | # Restart mariadb-server 27 | sudo systemctl restart mariadb 28 | 29 | 30 | #starting the firewall and allowing the mariadb to access from port no. 3306 31 | sudo systemctl start firewalld 32 | sudo systemctl enable firewalld 33 | sudo firewall-cmd --get-active-zones 34 | sudo firewall-cmd --zone=public --add-port=3306/tcp --permanent 35 | sudo firewall-cmd --reload 36 | sudo systemctl restart mariadb 37 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_MacOSM1/nginx.sh: -------------------------------------------------------------------------------- 1 | # adding repository and installing nginx 2 | apt update 3 | apt install nginx -y 4 | cat < vproapp 5 | upstream vproapp { 6 | 7 | server app01:8080; 8 | 9 | } 10 | 11 | server { 12 | 13 | listen 80; 14 | 15 | location / { 16 | 17 | proxy_pass http://vproapp; 18 | 19 | } 20 | 21 | } 22 | 23 | EOT 24 | 25 | mv vproapp /etc/nginx/sites-available/vproapp 26 | rm -rf /etc/nginx/sites-enabled/default 27 | ln -s /etc/nginx/sites-available/vproapp /etc/nginx/sites-enabled/vproapp 28 | 29 | #starting nginx service and firewall 30 | systemctl start nginx 31 | systemctl enable nginx 32 | systemctl restart nginx 33 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_MacOSM1/rabbitmq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo yum install epel-release -y 3 | sudo yum update -y 4 | sudo yum install wget -y 5 | cd /tmp/ 6 | dnf -y install centos-release-rabbitmq-38 7 | dnf --enablerepo=centos-rabbitmq-38 -y install rabbitmq-server 8 | systemctl enable --now rabbitmq-server 9 | firewall-cmd --add-port=5672/tcp 10 | firewall-cmd --runtime-to-permanent 11 | sudo systemctl start rabbitmq-server 12 | sudo systemctl enable rabbitmq-server 13 | sudo systemctl status rabbitmq-server 14 | sudo sh -c 'echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config' 15 | sudo rabbitmqctl add_user test test 16 | sudo rabbitmqctl set_user_tags test administrator 17 | rabbitmqctl set_permissions -p / test ".*" ".*" ".*" 18 | sudo systemctl restart rabbitmq-server 19 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_MacOSM1/tomcat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | TOMURL="https://archive.apache.org/dist/tomcat/tomcat-10/v10.1.26/bin/apache-tomcat-10.1.26.tar.gz" 3 | dnf -y install java-17-openjdk java-17-openjdk-devel 4 | dnf install git wget rsync unzip zip -y 5 | cd /tmp/ 6 | wget $TOMURL -O tomcatbin.tar.gz 7 | EXTOUT=`tar xzvf tomcatbin.tar.gz` 8 | TOMDIR=`echo $EXTOUT | cut -d '/' -f1` 9 | useradd --shell /sbin/nologin tomcat 10 | rsync -avzh /tmp/$TOMDIR/ /usr/local/tomcat/ 11 | chown -R tomcat.tomcat /usr/local/tomcat 12 | 13 | rm -rf /etc/systemd/system/tomcat.service 14 | 15 | cat <> /etc/systemd/system/tomcat.service 16 | [Unit] 17 | Description=Tomcat 18 | After=network.target 19 | 20 | [Service] 21 | 22 | User=tomcat 23 | Group=tomcat 24 | 25 | WorkingDirectory=/usr/local/tomcat 26 | 27 | #Environment=JRE_HOME=/usr/lib/jvm/jre 28 | Environment=JAVA_HOME=/usr/lib/jvm/jre 29 | 30 | Environment=CATALINA_PID=/var/tomcat/%i/run/tomcat.pid 31 | Environment=CATALINA_HOME=/usr/local/tomcat 32 | Environment=CATALINE_BASE=/usr/local/tomcat 33 | 34 | ExecStart=/usr/local/tomcat/bin/catalina.sh run 35 | ExecStop=/usr/local/tomcat/bin/shutdown.sh 36 | 37 | 38 | RestartSec=10 39 | Restart=always 40 | 41 | [Install] 42 | WantedBy=multi-user.target 43 | 44 | EOT 45 | 46 | systemctl daemon-reload 47 | systemctl start tomcat 48 | systemctl enable tomcat 49 | cd /tmp/ 50 | wget https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip 51 | unzip apache-maven-3.9.9-bin.zip 52 | cp -r apache-maven-3.9.9 /usr/local/maven3.9 53 | export MAVEN_OPTS="-Xmx512m" 54 | 55 | git clone -b local https://github.com/hkhcoder/vprofile-project.git 56 | cd vprofile-project 57 | /usr/local/maven3.9/bin/mvn install 58 | systemctl stop tomcat 59 | sleep 20 60 | rm -rf /usr/local/tomcat/webapps/ROOT* 61 | cp target/vprofile-v2.war /usr/local/tomcat/webapps/ROOT.war 62 | systemctl start tomcat 63 | sleep 20 64 | systemctl stop firewalld 65 | systemctl disable firewalld 66 | #cp /vagrant/application.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/application.properties 67 | systemctl restart tomcat 68 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_MacOSM1/tomcat_ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo apt update 3 | sudo apt upgrade -y 4 | sudo apt install openjdk-8-jdk -y 5 | sudo apt install tomcat8 tomcat8-admin tomcat8-docs tomcat8-common git -y 6 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_WinMacIntel/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.hostmanager.enabled = true 3 | config.hostmanager.manage_host = true 4 | 5 | ### DB vm #### 6 | config.vm.define "db01" do |db01| 7 | db01.vm.box = "centos/stream9" 8 | db01.vm.hostname = "db01" 9 | db01.vm.network "private_network", ip: "192.168.56.15" 10 | db01.vm.provider "virtualbox" do |vb| 11 | vb.memory = "600" 12 | end 13 | db01.vm.provision "shell", path: "mysql.sh" 14 | 15 | end 16 | 17 | ### Memcache vm #### 18 | config.vm.define "mc01" do |mc01| 19 | mc01.vm.box = "centos/stream9" 20 | mc01.vm.hostname = "mc01" 21 | mc01.vm.network "private_network", ip: "192.168.56.14" 22 | mc01.vm.provider "virtualbox" do |vb| 23 | vb.memory = "600" 24 | end 25 | mc01.vm.provision "shell", path: "memcache.sh" 26 | end 27 | 28 | ### RabbitMQ vm #### 29 | config.vm.define "rmq01" do |rmq01| 30 | rmq01.vm.box = "centos/stream9" 31 | rmq01.vm.hostname = "rmq01" 32 | rmq01.vm.network "private_network", ip: "192.168.56.16" 33 | rmq01.vm.provider "virtualbox" do |vb| 34 | vb.memory = "600" 35 | end 36 | rmq01.vm.provision "shell", path: "rabbitmq.sh" 37 | end 38 | 39 | ### tomcat vm ### 40 | config.vm.define "app01" do |app01| 41 | app01.vm.box = "centos/stream9" 42 | app01.vm.hostname = "app01" 43 | app01.vm.network "private_network", ip: "192.168.56.12" 44 | app01.vm.provision "shell", path: "tomcat.sh" 45 | app01.vm.provider "virtualbox" do |vb| 46 | vb.memory = "800" 47 | end 48 | end 49 | 50 | 51 | ### Nginx VM ### 52 | config.vm.define "web01" do |web01| 53 | web01.vm.box = "ubuntu/jammy64" 54 | web01.vm.hostname = "web01" 55 | web01.vm.network "private_network", ip: "192.168.56.11" 56 | # web01.vm.network "public_network" 57 | web01.vm.provider "virtualbox" do |vb| 58 | vb.gui = true 59 | vb.memory = "800" 60 | end 61 | web01.vm.provision "shell", path: "nginx.sh" 62 | end 63 | 64 | end 65 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_WinMacIntel/application.properties: -------------------------------------------------------------------------------- 1 | #JDBC Configutation for Database Connection 2 | jdbc.driverClassName=com.mysql.jdbc.Driver 3 | jdbc.url=jdbc:mysql://db01:3306/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 4 | jdbc.username=admin 5 | jdbc.password=admin123 6 | 7 | #Memcached Configuration For Active and StandBy Host 8 | #For Active Host 9 | memcached.active.host=mc01 10 | memcached.active.port=11211 11 | #For StandBy Host 12 | memcached.standBy.host=127.0.0.2 13 | memcached.standBy.port=11211 14 | 15 | #RabbitMq Configuration 16 | rabbitmq.address=rmq01 17 | rabbitmq.port=5672 18 | rabbitmq.username=test 19 | rabbitmq.password=test 20 | 21 | #Elasticesearch Configuration 22 | elasticsearch.host =192.168.1.85 23 | elasticsearch.port =9300 24 | elasticsearch.cluster=vprofile 25 | elasticsearch.node=vprofilenode -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_WinMacIntel/backend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DATABASE_PASS='admin123' 3 | 4 | # MEmcache 5 | yum install epel-release -y 6 | yum install memcached -y 7 | systemctl start memcached 8 | systemctl enable memcached 9 | systemctl status memcached 10 | memcached -p 11211 -U 11111 -u memcached -d 11 | 12 | # Rabbit 13 | yum install socat -y 14 | yum install erlang -y 15 | yum install wget -y 16 | wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-3.6.10-1.el7.noarch.rpm 17 | rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc 18 | yum update 19 | rpm -Uvh rabbitmq-server-3.6.10-1.el7.noarch.rpm 20 | systemctl start rabbitmq-server 21 | systemctl enable rabbitmq-server 22 | systemctl status rabbitmq-server 23 | echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config 24 | rabbitmqctl add_user rabbit bunny 25 | rabbitmqctl set_user_tags rabbit administrator 26 | systemctl restart rabbitmq-server 27 | 28 | # Mysql 29 | yum install mariadb-server -y 30 | 31 | #mysql_secure_installation 32 | sed -i 's/^127.0.0.1/0.0.0.0/' /etc/my.cnf 33 | 34 | # starting & enabling mariadb-server 35 | systemctl start mariadb 36 | systemctl enable mariadb 37 | 38 | #restore the dump file for the application 39 | mysqladmin -u root password "$DATABASE_PASS" 40 | mysql -u root -p"$DATABASE_PASS" -e "UPDATE mysql.user SET Password=PASSWORD('$DATABASE_PASS') WHERE User='root'" 41 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" 42 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User=''" 43 | mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'" 44 | mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 45 | mysql -u root -p"$DATABASE_PASS" -e "create database accounts" 46 | mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'localhost' identified by 'admin123'" 47 | mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'app01' identified by 'admin123'" 48 | mysql -u root -p"$DATABASE_PASS" accounts < /vagrant/vprofile-repo/src/main/resources/db_backup.sql 49 | mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 50 | 51 | # Restart mariadb-server 52 | systemctl restart mariadb -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_WinMacIntel/memcache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo dnf install epel-release -y 3 | sudo dnf install memcached -y 4 | sudo systemctl start memcached 5 | sudo systemctl enable memcached 6 | sudo systemctl status memcached 7 | sed -i 's/127.0.0.1/0.0.0.0/g' /etc/sysconfig/memcached 8 | sudo systemctl restart memcached 9 | firewall-cmd --add-port=11211/tcp 10 | firewall-cmd --runtime-to-permanent 11 | firewall-cmd --add-port=11111/udp 12 | firewall-cmd --runtime-to-permanent 13 | sudo memcached -p 11211 -U 11111 -u memcached -d 14 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_WinMacIntel/mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DATABASE_PASS='admin123' 3 | sudo yum update -y 4 | sudo yum install epel-release -y 5 | sudo yum install git zip unzip -y 6 | sudo yum install mariadb-server -y 7 | 8 | 9 | # starting & enabling mariadb-server 10 | sudo systemctl start mariadb 11 | sudo systemctl enable mariadb 12 | cd /tmp/ 13 | git clone -b main https://github.com/hkhcoder/vprofile-project.git 14 | #restore the dump file for the application 15 | sudo mysqladmin -u root password "$DATABASE_PASS" 16 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" 17 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.user WHERE User=''" 18 | sudo mysql -u root -p"$DATABASE_PASS" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'" 19 | sudo mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 20 | sudo mysql -u root -p"$DATABASE_PASS" -e "create database accounts" 21 | sudo mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'localhost' identified by 'admin123'" 22 | sudo mysql -u root -p"$DATABASE_PASS" -e "grant all privileges on accounts.* TO 'admin'@'%' identified by 'admin123'" 23 | sudo mysql -u root -p"$DATABASE_PASS" accounts < /tmp/vprofile-project/src/main/resources/db_backup.sql 24 | sudo mysql -u root -p"$DATABASE_PASS" -e "FLUSH PRIVILEGES" 25 | 26 | # Restart mariadb-server 27 | sudo systemctl restart mariadb 28 | 29 | 30 | #starting the firewall and allowing the mariadb to access from port no. 3306 31 | sudo systemctl start firewalld 32 | sudo systemctl enable firewalld 33 | sudo firewall-cmd --get-active-zones 34 | sudo firewall-cmd --zone=public --add-port=3306/tcp --permanent 35 | sudo firewall-cmd --reload 36 | sudo systemctl restart mariadb 37 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_WinMacIntel/nginx.sh: -------------------------------------------------------------------------------- 1 | # adding repository and installing nginx 2 | apt update 3 | apt install nginx -y 4 | cat < vproapp 5 | upstream vproapp { 6 | 7 | server app01:8080; 8 | 9 | } 10 | 11 | server { 12 | 13 | listen 80; 14 | 15 | location / { 16 | 17 | proxy_pass http://vproapp; 18 | 19 | } 20 | 21 | } 22 | 23 | EOT 24 | 25 | mv vproapp /etc/nginx/sites-available/vproapp 26 | rm -rf /etc/nginx/sites-enabled/default 27 | ln -s /etc/nginx/sites-available/vproapp /etc/nginx/sites-enabled/vproapp 28 | 29 | #starting nginx service and firewall 30 | systemctl start nginx 31 | systemctl enable nginx 32 | systemctl restart nginx 33 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_WinMacIntel/rabbitmq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo yum install epel-release -y 3 | sudo yum update -y 4 | sudo yum install wget -y 5 | cd /tmp/ 6 | dnf -y install centos-release-rabbitmq-38 7 | dnf --enablerepo=centos-rabbitmq-38 -y install rabbitmq-server 8 | systemctl enable --now rabbitmq-server 9 | firewall-cmd --add-port=5672/tcp 10 | firewall-cmd --runtime-to-permanent 11 | sudo systemctl start rabbitmq-server 12 | sudo systemctl enable rabbitmq-server 13 | sudo systemctl status rabbitmq-server 14 | sudo sh -c 'echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config' 15 | sudo rabbitmqctl add_user test test 16 | sudo rabbitmqctl set_user_tags test administrator 17 | rabbitmqctl set_permissions -p / test ".*" ".*" ".*" 18 | sudo systemctl restart rabbitmq-server 19 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_WinMacIntel/tomcat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | TOMURL="https://archive.apache.org/dist/tomcat/tomcat-10/v10.1.26/bin/apache-tomcat-10.1.26.tar.gz" 3 | dnf -y install java-17-openjdk java-17-openjdk-devel 4 | dnf install git wget unzip zip -y 5 | cd /tmp/ 6 | wget $TOMURL -O tomcatbin.tar.gz 7 | EXTOUT=`tar xzvf tomcatbin.tar.gz` 8 | TOMDIR=`echo $EXTOUT | cut -d '/' -f1` 9 | useradd --shell /sbin/nologin tomcat 10 | rsync -avzh /tmp/$TOMDIR/ /usr/local/tomcat/ 11 | chown -R tomcat.tomcat /usr/local/tomcat 12 | 13 | rm -rf /etc/systemd/system/tomcat.service 14 | 15 | cat <> /etc/systemd/system/tomcat.service 16 | [Unit] 17 | Description=Tomcat 18 | After=network.target 19 | 20 | [Service] 21 | 22 | User=tomcat 23 | Group=tomcat 24 | 25 | WorkingDirectory=/usr/local/tomcat 26 | 27 | #Environment=JRE_HOME=/usr/lib/jvm/jre 28 | Environment=JAVA_HOME=/usr/lib/jvm/jre 29 | 30 | Environment=CATALINA_PID=/var/tomcat/%i/run/tomcat.pid 31 | Environment=CATALINA_HOME=/usr/local/tomcat 32 | Environment=CATALINE_BASE=/usr/local/tomcat 33 | 34 | ExecStart=/usr/local/tomcat/bin/catalina.sh run 35 | ExecStop=/usr/local/tomcat/bin/shutdown.sh 36 | 37 | 38 | RestartSec=10 39 | Restart=always 40 | 41 | [Install] 42 | WantedBy=multi-user.target 43 | 44 | EOT 45 | 46 | systemctl daemon-reload 47 | systemctl start tomcat 48 | systemctl enable tomcat 49 | cd /tmp/ 50 | wget https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip 51 | unzip apache-maven-3.9.9-bin.zip 52 | cp -r apache-maven-3.9.9 /usr/local/maven3.9 53 | export MAVEN_OPTS="-Xmx512m" 54 | 55 | git clone -b local https://github.com/hkhcoder/vprofile-project.git 56 | cd vprofile-project 57 | /usr/local/maven3.9/bin/mvn install 58 | systemctl stop tomcat 59 | sleep 20 60 | rm -rf /usr/local/tomcat/webapps/ROOT* 61 | cp target/vprofile-v2.war /usr/local/tomcat/webapps/ROOT.war 62 | systemctl start tomcat 63 | sleep 20 64 | systemctl stop firewalld 65 | systemctl disable firewalld 66 | #cp /vagrant/application.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/application.properties 67 | systemctl restart tomcat 68 | -------------------------------------------------------------------------------- /vagrant/Automated_provisioning_WinMacIntel/tomcat_ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo apt update 3 | sudo apt upgrade -y 4 | sudo apt install openjdk-8-jdk -y 5 | sudo apt install tomcat8 tomcat8-admin tomcat8-docs tomcat8-common git -y 6 | -------------------------------------------------------------------------------- /vagrant/Manual_provisioning_MacOSM1/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.hostmanager.enabled = true 3 | config.hostmanager.manage_host = true 4 | 5 | ### DB vm #### 6 | config.vm.define "db01" do |db01| 7 | db01.vm.box = "bandit145/centos_stream9_arm" 8 | db01.vm.hostname = "db01" 9 | db01.vm.network "private_network", ip: "192.168.56.25" 10 | db01.vm.provider "vmware_desktop" do |vmware| 11 | vmware.gui = true 12 | vmware.allowlist_verified = true 13 | end 14 | end 15 | 16 | ### Memcache vm #### 17 | config.vm.define "mc01" do |mc01| 18 | mc01.vm.box = "bandit145/centos_stream9_arm" 19 | mc01.vm.hostname = "mc01" 20 | mc01.vm.network "private_network", ip: "192.168.56.24" 21 | mc01.vm.provider "vmware_desktop" do |vmware| 22 | vmware.gui = true 23 | vmware.allowlist_verified = true 24 | end 25 | end 26 | 27 | ### RabbitMQ vm #### 28 | config.vm.define "rmq01" do |rmq01| 29 | rmq01.vm.box = "bandit145/centos_stream9_arm" 30 | rmq01.vm.hostname = "rmq01" 31 | rmq01.vm.network "private_network", ip: "192.168.56.23" 32 | rmq01.vm.provider "vmware_desktop" do |vmware| 33 | vmware.gui = true 34 | vmware.allowlist_verified = true 35 | end 36 | end 37 | 38 | ### tomcat vm ### 39 | config.vm.define "app01" do |app01| 40 | app01.vm.box = "bandit145/centos_stream9_arm" 41 | app01.vm.hostname = "app01" 42 | app01.vm.network "private_network", ip: "192.168.56.22" 43 | app01.vm.provider "vmware_desktop" do |vb| 44 | vb.memory = "1024" 45 | vb.gui = true 46 | vb.allowlist_verified = true 47 | end 48 | end 49 | 50 | 51 | ### Nginx VM ### 52 | config.vm.define "web01" do |web01| 53 | web01.vm.box = "spox/ubuntu-arm" 54 | web01.vm.hostname = "web01" 55 | web01.vm.network "private_network", ip: "192.168.56.21" 56 | web01.vm.provider "vmware_desktop" do |vmware| 57 | vmware.gui = true 58 | vmware.allowlist_verified = true 59 | end 60 | 61 | end 62 | 63 | end 64 | -------------------------------------------------------------------------------- /vagrant/Manual_provisioning_MacOSM1/VprofileProjectSetupMacM1M2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/vagrant/Manual_provisioning_MacOSM1/VprofileProjectSetupMacM1M2.pdf -------------------------------------------------------------------------------- /vagrant/Manual_provisioning_WinMacIntel/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.hostmanager.enabled = true 3 | config.hostmanager.manage_host = true 4 | 5 | ### DB vm #### 6 | config.vm.define "db01" do |db01| 7 | db01.vm.box = "centos/stream9" 8 | db01.vm.hostname = "db01" 9 | db01.vm.network "private_network", ip: "192.168.56.15" 10 | db01.vm.provider "virtualbox" do |vb| 11 | vb.memory = "600" 12 | end 13 | 14 | end 15 | 16 | ### Memcache vm #### 17 | config.vm.define "mc01" do |mc01| 18 | mc01.vm.box = "centos/stream9" 19 | mc01.vm.hostname = "mc01" 20 | mc01.vm.network "private_network", ip: "192.168.56.14" 21 | mc01.vm.provider "virtualbox" do |vb| 22 | vb.memory = "600" 23 | end 24 | end 25 | 26 | ### RabbitMQ vm #### 27 | config.vm.define "rmq01" do |rmq01| 28 | rmq01.vm.box = "centos/stream9" 29 | rmq01.vm.hostname = "rmq01" 30 | rmq01.vm.network "private_network", ip: "192.168.56.13" 31 | rmq01.vm.provider "virtualbox" do |vb| 32 | vb.memory = "600" 33 | end 34 | end 35 | 36 | ### tomcat vm ### 37 | config.vm.define "app01" do |app01| 38 | app01.vm.box = "centos/stream9" 39 | app01.vm.hostname = "app01" 40 | app01.vm.network "private_network", ip: "192.168.56.12" 41 | app01.vm.provider "virtualbox" do |vb| 42 | vb.memory = "800" 43 | end 44 | end 45 | 46 | 47 | ### Nginx VM ### 48 | config.vm.define "web01" do |web01| 49 | web01.vm.box = "ubuntu/jammy64" 50 | web01.vm.hostname = "web01" 51 | web01.vm.network "private_network", ip: "192.168.56.11" 52 | web01.vm.provider "virtualbox" do |vb| 53 | vb.gui = true 54 | vb.memory = "800" 55 | end 56 | end 57 | 58 | end 59 | -------------------------------------------------------------------------------- /vagrant/Manual_provisioning_WinMacIntel/VprofileProjectSetupWindowsAndMacIntel.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkhcoder/vprofile-project/026e3a119a92b94d4f9b29b2882e159a334213b0/vagrant/Manual_provisioning_WinMacIntel/VprofileProjectSetupWindowsAndMacIntel.pdf --------------------------------------------------------------------------------