diff --git a/Docker-files/app/Dockerfile b/Docker-files/app/Dockerfile index e69de29bb..f68c038b7 100755 --- a/Docker-files/app/Dockerfile +++ b/Docker-files/app/Dockerfile @@ -0,0 +1,26 @@ +# Use OpenJDK 11 for the build stage +FROM openjdk:11 AS build + +# Install Maven +RUN apt-get update && apt-get install -y maven git + +# Clone the repository and build the project +RUN git clone https://github.com/VANSH3104/vprofile-project.git /vprofile-project +WORKDIR /vprofile-project +RUN git checkout docker && mvn clean install +LABEL "project"="vprofile" +LABEL "author"="vansh" +# Use Tomcat 9 for the runtime stage +FROM tomcat:9-jre11 + +# Remove the default webapps to clean the environment +RUN rm -rf /usr/local/tomcat/webapps/* + +# Copy the built WAR file from the build stage +COPY --from=build /vprofile-project/target/vprofile-v2.war /usr/local/tomcat/webapps/ROOT.war + +# Expose port 8080 for the application +EXPOSE 8080 + +# Start Tomcat +CMD ["catalina.sh", "run"] diff --git a/Docker-files/db/Dockerfile b/Docker-files/db/Dockerfile index e69de29bb..71993f1e4 100755 --- a/Docker-files/db/Dockerfile +++ b/Docker-files/db/Dockerfile @@ -0,0 +1,7 @@ +FROM mysql:8.0.33 +LABEL "project"="vprofile" +LABEL "author"="vansh" +ENV MYSQL_ROOT_PASSWORD = "vprodbpass" +ENV MYSQL_DATABASE = "accounts" + +ADD db_backup.sql docker-entrypoint-initdb.d/db_backup.sql diff --git a/Docker-files/web/Dockerfile b/Docker-files/web/Dockerfile index e69de29bb..bc2ea0479 100755 --- a/Docker-files/web/Dockerfile +++ b/Docker-files/web/Dockerfile @@ -0,0 +1,6 @@ +FROM nginx +LABEL "project"="vprofile" +LABEL "author"="vansh" +RUN rm -rf /etc/nginx/conf.d/default.conf + +COPY nginvproapp.conf /etc/nginx/conf.d/vproapp.conf \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index e69de29bb..429618426 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -0,0 +1,49 @@ +version: '3.8' +services: + vprodb: + build: + context: ./Docker-files/db + image: vanshkabra004/vprofiledb + ports: + - "3306:3306" + container_name: vprodb + volumes: + - vprodbdata:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=vprodbpass + + vprocache01: + image: memcached + ports: + - "11211:11211" + + vpromq01: + image: rabbitmq + ports: + - "15672:15672" + environment: + - RABBITMQ_DEFAULT_USER=guest + - RABBITMQ_DEFAULT_PASS=guest + + vproapp: + build: + context: ./Docker-files/app + image: vanshkabra004/vprofileapp + ports: + - "8080:8080" + container_name: vproapp + volumes: + - vproappdata:/usr/local/tomcat/webapps + + vproweb: + build: + context: ./Docker-files/web + image: vanshkabra004/vprofileweb + ports: + - "80:80" + container_name: vproweb + +volumes: + vproappdata: {} + vprodbdata: {} + diff --git a/target/classes/application.properties b/target/classes/application.properties new file mode 100755 index 000000000..99b95acd6 --- /dev/null +++ b/target/classes/application.properties @@ -0,0 +1,25 @@ +#JDBC Configutation for Database Connection +jdbc.driverClassName=com.mysql.jdbc.Driver +jdbc.url=jdbc:mysql://vprodb:3306/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull +jdbc.username=root +jdbc.password=vprodbpass + +#Memcached Configuration For Active and StandBy Host +#For Active Host +memcached.active.host=vprocache01 +memcached.active.port=11211 +#For StandBy Host +memcached.standBy.host=vprocache02 +memcached.standBy.port=11211 + +#RabbitMq Configuration +rabbitmq.address=vpromq01 +rabbitmq.port=15672 +rabbitmq.username=guest +rabbitmq.password=guest + +#Elasticesearch Configuration +elasticsearch.host =vprosearch01 +elasticsearch.port =9300 +elasticsearch.cluster=vprofile +elasticsearch.node=vprofilenode diff --git a/target/classes/com/visualpathit/account/beans/Components.class b/target/classes/com/visualpathit/account/beans/Components.class new file mode 100644 index 000000000..5e3095d47 Binary files /dev/null and b/target/classes/com/visualpathit/account/beans/Components.class differ diff --git a/target/classes/com/visualpathit/account/controller/ElasticSearchController.class b/target/classes/com/visualpathit/account/controller/ElasticSearchController.class new file mode 100644 index 000000000..746f049a9 Binary files /dev/null and b/target/classes/com/visualpathit/account/controller/ElasticSearchController.class differ diff --git a/target/classes/com/visualpathit/account/controller/FileUploadController.class b/target/classes/com/visualpathit/account/controller/FileUploadController.class new file mode 100644 index 000000000..b5eb23f81 Binary files /dev/null and b/target/classes/com/visualpathit/account/controller/FileUploadController.class differ diff --git a/target/classes/com/visualpathit/account/controller/UserController.class b/target/classes/com/visualpathit/account/controller/UserController.class new file mode 100644 index 000000000..89fecc438 Binary files /dev/null and b/target/classes/com/visualpathit/account/controller/UserController.class differ diff --git a/target/classes/com/visualpathit/account/model/Role.class b/target/classes/com/visualpathit/account/model/Role.class new file mode 100644 index 000000000..929351b9c Binary files /dev/null and b/target/classes/com/visualpathit/account/model/Role.class differ diff --git a/target/classes/com/visualpathit/account/model/User.class b/target/classes/com/visualpathit/account/model/User.class new file mode 100644 index 000000000..0e90c2414 Binary files /dev/null and b/target/classes/com/visualpathit/account/model/User.class differ diff --git a/target/classes/com/visualpathit/account/repository/RoleRepository.class b/target/classes/com/visualpathit/account/repository/RoleRepository.class new file mode 100644 index 000000000..ea5943ffc Binary files /dev/null and b/target/classes/com/visualpathit/account/repository/RoleRepository.class differ diff --git a/target/classes/com/visualpathit/account/repository/UserRepository.class b/target/classes/com/visualpathit/account/repository/UserRepository.class new file mode 100644 index 000000000..e6e9ace0f Binary files /dev/null and b/target/classes/com/visualpathit/account/repository/UserRepository.class differ diff --git a/target/classes/com/visualpathit/account/service/ConsumerService.class b/target/classes/com/visualpathit/account/service/ConsumerService.class new file mode 100644 index 000000000..2efb215f0 Binary files /dev/null and b/target/classes/com/visualpathit/account/service/ConsumerService.class differ diff --git a/target/classes/com/visualpathit/account/service/ConsumerServiceImpl.class b/target/classes/com/visualpathit/account/service/ConsumerServiceImpl.class new file mode 100644 index 000000000..c10ffa849 Binary files /dev/null and b/target/classes/com/visualpathit/account/service/ConsumerServiceImpl.class differ diff --git a/target/classes/com/visualpathit/account/service/ProducerService.class b/target/classes/com/visualpathit/account/service/ProducerService.class new file mode 100644 index 000000000..36065ad5f Binary files /dev/null and b/target/classes/com/visualpathit/account/service/ProducerService.class differ diff --git a/target/classes/com/visualpathit/account/service/ProducerServiceImpl.class b/target/classes/com/visualpathit/account/service/ProducerServiceImpl.class new file mode 100644 index 000000000..cfe2c6f06 Binary files /dev/null and b/target/classes/com/visualpathit/account/service/ProducerServiceImpl.class differ diff --git a/target/classes/com/visualpathit/account/service/SecurityService.class b/target/classes/com/visualpathit/account/service/SecurityService.class new file mode 100644 index 000000000..3dd66bfdb Binary files /dev/null and b/target/classes/com/visualpathit/account/service/SecurityService.class differ diff --git a/target/classes/com/visualpathit/account/service/SecurityServiceImpl.class b/target/classes/com/visualpathit/account/service/SecurityServiceImpl.class new file mode 100644 index 000000000..5f6244126 Binary files /dev/null and b/target/classes/com/visualpathit/account/service/SecurityServiceImpl.class differ diff --git a/target/classes/com/visualpathit/account/service/UserDetailsServiceImpl.class b/target/classes/com/visualpathit/account/service/UserDetailsServiceImpl.class new file mode 100644 index 000000000..2b6dbe5b0 Binary files /dev/null and b/target/classes/com/visualpathit/account/service/UserDetailsServiceImpl.class differ diff --git a/target/classes/com/visualpathit/account/service/UserService.class b/target/classes/com/visualpathit/account/service/UserService.class new file mode 100644 index 000000000..35f247faf Binary files /dev/null and b/target/classes/com/visualpathit/account/service/UserService.class differ diff --git a/target/classes/com/visualpathit/account/service/UserServiceImpl.class b/target/classes/com/visualpathit/account/service/UserServiceImpl.class new file mode 100644 index 000000000..68c463792 Binary files /dev/null and b/target/classes/com/visualpathit/account/service/UserServiceImpl.class differ diff --git a/target/classes/com/visualpathit/account/utils/ElasticsearchUtil.class b/target/classes/com/visualpathit/account/utils/ElasticsearchUtil.class new file mode 100644 index 000000000..36805dc9e Binary files /dev/null and b/target/classes/com/visualpathit/account/utils/ElasticsearchUtil.class differ diff --git a/target/classes/com/visualpathit/account/utils/MemcachedUtils.class b/target/classes/com/visualpathit/account/utils/MemcachedUtils.class new file mode 100644 index 000000000..8b7738c25 Binary files /dev/null and b/target/classes/com/visualpathit/account/utils/MemcachedUtils.class differ diff --git a/target/classes/com/visualpathit/account/utils/RabbitMqUtil.class b/target/classes/com/visualpathit/account/utils/RabbitMqUtil.class new file mode 100644 index 000000000..5c144de0d Binary files /dev/null and b/target/classes/com/visualpathit/account/utils/RabbitMqUtil.class differ diff --git a/target/classes/com/visualpathit/account/validator/UserValidator.class b/target/classes/com/visualpathit/account/validator/UserValidator.class new file mode 100644 index 000000000..3bc9554b5 Binary files /dev/null and b/target/classes/com/visualpathit/account/validator/UserValidator.class differ diff --git a/target/classes/db_backup.sql b/target/classes/db_backup.sql new file mode 100755 index 000000000..856af2ecc --- /dev/null +++ b/target/classes/db_backup.sql @@ -0,0 +1,121 @@ +-- MySQL dump 10.13 Distrib 5.7.18, for Linux (x86_64) +-- +-- Host: localhost Database: accounts +-- ------------------------------------------------------ +-- Server version 5.7.18-0ubuntu0.16.10.1 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `role` +-- + +DROP TABLE IF EXISTS `role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `role` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(45) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `role` +-- + +LOCK TABLES `role` WRITE; +/*!40000 ALTER TABLE `role` DISABLE KEYS */; +INSERT INTO `role` VALUES (1,'ROLE_USER'); +/*!40000 ALTER TABLE `role` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `user` +-- + +DROP TABLE IF EXISTS `user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `user` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `username` varchar(255) DEFAULT NULL, + `userEmail` varchar(255) DEFAULT NULL, + `profileImg` varchar(255) DEFAULT NULL, + `profileImgPath` varchar(255) DEFAULT NULL, + `dateOfBirth` varchar(255) DEFAULT NULL, + `fatherName` varchar(255) DEFAULT NULL, + `motherName` varchar(255) DEFAULT NULL, + `gender` varchar(255) DEFAULT NULL, + `maritalStatus` varchar(255) DEFAULT NULL, + `permanentAddress` varchar(255) DEFAULT NULL, + `tempAddress` varchar(255) DEFAULT NULL, + `primaryOccupation` varchar(255) DEFAULT NULL, + `secondaryOccupation` varchar(255) DEFAULT NULL, + `skills` varchar(255) DEFAULT NULL, + `phoneNumber` varchar(255) DEFAULT NULL, + `secondaryPhoneNumber` varchar(255) DEFAULT NULL, + `nationality` varchar(255) DEFAULT NULL, + `language` varchar(255) DEFAULT NULL, + `workingExperience` varchar(255) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `user` +-- + +LOCK TABLES `user` WRITE; +/*!40000 ALTER TABLE `user` DISABLE KEYS */; +INSERT INTO `user` VALUES (4,'admin_vp','admin_vp@vp.com',NULL,NULL,'28/03/1994','M Khan','R Khan','male','unMarried','Ameerpet,Hyderabad','Ameerpet,Hyderabad','Software Engineer','Software Engineer','Java HTML CSS ','9960862529','9960862529','India','english','2 ','$2a$11$enwqb8vLp6TNRuSQwuJs9.p.0RsBVmvJYAsLq.g883Ly87YCiaxKi'),(5,'admin_vp2','admin@visualpathit.com',NULL,NULL,'28/03/1994','M Khan','R Khan','male','unMarried','Ameerpet,Hyderabad','Ameerpet,Hyderabad','Software Engineer','Software Engineer','Java HTML CSS ','9960862529','9960862529','India','english','12','$2a$11$Yflhl432jiLZQqr0DBcQKuJ.bxhZlR1YDFilK3SKeFX/WIulEsW2q'),(6,'admin_vp3','admin@visualpathit.com',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'$2a$11$PDx0mSd5lf22zP4ulURwp.jVP.AG.wUO94MY72j1FRogs/FcadNCa'); +/*!40000 ALTER TABLE `user` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `user_role` +-- + +DROP TABLE IF EXISTS `user_role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `user_role` ( + `user_id` int(11) NOT NULL, + `role_id` int(11) NOT NULL, + PRIMARY KEY (`user_id`,`role_id`), + KEY `fk_user_role_roleid_idx` (`role_id`), + CONSTRAINT `fk_user_role_roleid` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_user_role_userid` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `user_role` +-- + +LOCK TABLES `user_role` WRITE; +/*!40000 ALTER TABLE `user_role` DISABLE KEYS */; +INSERT INTO `user_role` VALUES (4,1),(5,1),(6,1); +/*!40000 ALTER TABLE `user_role` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2017-10-24 15:03:57 diff --git a/target/classes/logback.xml b/target/classes/logback.xml new file mode 100755 index 000000000..35b81df4d --- /dev/null +++ b/target/classes/logback.xml @@ -0,0 +1,24 @@ + + + + + + + %date{HH:mm:ss.SSS} [%thread] %-5level %logger{15}#%line %msg\n + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/classes/validation.properties b/target/classes/validation.properties new file mode 100755 index 000000000..0453cdd3a --- /dev/null +++ b/target/classes/validation.properties @@ -0,0 +1,5 @@ +NotEmpty=This field is required. +Size.userForm.username=Please use between 6 and 32 characters. +Duplicate.userForm.username= User has already taken this Username. +Size.userForm.password=Try one with at least 8 characters. +Diff.userForm.passwordConfirm=These passwords don't match. \ No newline at end of file diff --git a/target/test-classes/com/visualpathit/account/controllerTest/SampleTest.class b/target/test-classes/com/visualpathit/account/controllerTest/SampleTest.class new file mode 100644 index 000000000..00fd98a02 Binary files /dev/null and b/target/test-classes/com/visualpathit/account/controllerTest/SampleTest.class differ diff --git a/target/test-classes/com/visualpathit/account/controllerTest/UserControllerTest.class b/target/test-classes/com/visualpathit/account/controllerTest/UserControllerTest.class new file mode 100644 index 000000000..0fc899186 Binary files /dev/null and b/target/test-classes/com/visualpathit/account/controllerTest/UserControllerTest.class differ diff --git a/target/test-classes/com/visualpathit/account/modelTest/RoleTest.class b/target/test-classes/com/visualpathit/account/modelTest/RoleTest.class new file mode 100644 index 000000000..3851d4ffb Binary files /dev/null and b/target/test-classes/com/visualpathit/account/modelTest/RoleTest.class differ diff --git a/target/test-classes/com/visualpathit/account/modelTest/UserTest.class b/target/test-classes/com/visualpathit/account/modelTest/UserTest.class new file mode 100644 index 000000000..fc0166942 Binary files /dev/null and b/target/test-classes/com/visualpathit/account/modelTest/UserTest.class differ diff --git a/target/test-classes/com/visualpathit/account/setup/StandaloneMvcTestViewResolver.class b/target/test-classes/com/visualpathit/account/setup/StandaloneMvcTestViewResolver.class new file mode 100644 index 000000000..74a522193 Binary files /dev/null and b/target/test-classes/com/visualpathit/account/setup/StandaloneMvcTestViewResolver.class differ