├── README.md ├── UI-bootstrap-moviecruiser ├── README.md └── WebContent │ ├── CSS │ └── style.css │ ├── Signup.html │ ├── edit-movie-success.html │ ├── edit-movie-validation.html │ ├── edit-movie.html │ ├── favorites-empty.html │ ├── favorites-notification.html │ ├── favorites.html │ ├── js │ └── script.js │ ├── login-notification.html │ ├── login.html │ ├── movie-list-admin.html │ ├── movie-list-customer-add-to-favorites.html │ ├── movie-list-customer.html │ └── movie-list.html ├── UI-bootstrap-truyum └── WebContent │ ├── README.md │ ├── Signup.html │ ├── cart-empty.html │ ├── cart-notification.html │ ├── cart.html │ ├── css │ └── style.css │ ├── edit-menu-item-success.html │ ├── edit-menu-item-validation.html │ ├── edit-menu-item.html │ ├── js │ └── script.js │ ├── login-notification.html │ ├── login.html │ ├── menu-item-list-admin.html │ ├── menu-item-list-customer-add-to-cart.html │ ├── menu-item-list-customer.html │ └── menu-item-list.html ├── basic-java-moviecruiser ├── .gitignore ├── WebContent │ ├── META-INF │ │ └── MANIFEST.MF │ ├── WEB-INF │ │ └── lib │ │ │ ├── jstl-1.2.jar │ │ │ └── mysql-connector-java-5.1.45.jar │ ├── edit-movie-status.html │ ├── edit-movie-status.jsp │ ├── edit-movie.html │ ├── edit-movie.jsp │ ├── favorites-empty.html │ ├── favorites-empty.jsp │ ├── favorites-notification.html │ ├── favorites.html │ ├── favorites.jsp │ ├── images │ │ └── logo.png │ ├── js │ │ ├── script.js │ │ └── script2.js │ ├── movie-list-admin.html │ ├── movie-list-admin.jsp │ ├── movie-list-customer-notification.html │ ├── movie-list-customer.html │ ├── movie-list-customer.jsp │ └── style │ │ └── style.css ├── sql │ ├── data.sql │ └── schema-creation.sql └── src │ ├── com │ └── cognizant │ │ └── moviecruiser │ │ ├── connection.properties │ │ ├── dao │ │ ├── ConnectionHandler.java │ │ ├── FavoritesDao.java │ │ ├── FavoritesDaoCollectionImpl.java │ │ ├── FavoritesDaoCollectionImplTest.java │ │ ├── FavoritesDaoSqlImpl.java │ │ ├── FavoritesDaoSqlImplTest.java │ │ ├── FavoritesEmptyException.java │ │ ├── MovieDao.java │ │ ├── MovieDaoCollectionImpl.java │ │ ├── MovieDaoCollectionImplTest.java │ │ ├── MovieDaoSqlImpl.java │ │ └── MovieDaoSqlImplTest.java │ │ ├── model │ │ ├── Favorites.java │ │ └── Movie.java │ │ ├── servlet │ │ ├── AddToFavoritesServlet.java │ │ ├── EditMovieServlet.java │ │ ├── RemoveFavoritesServlet.java │ │ ├── ShowEditMovieServlet.java │ │ ├── ShowFavoritesServlet.java │ │ ├── ShowMovieListAdminServlet.java │ │ └── ShowMovieListCustomerServlet.java │ │ └── util │ │ └── DateUtil.java │ └── connection.properties ├── basic-java-truyum ├── .gitignore ├── WebContent │ ├── META-INF │ │ └── MANIFEST.MF │ ├── WEB-INF │ │ └── lib │ │ │ ├── jstl-1.2.jar │ │ │ └── mysql-connector-java-5.1.45.jar │ ├── cart-empty.jsp │ ├── cart.jsp │ ├── edit-menu-item-status.jsp │ ├── edit-menu-item.jsp │ ├── images │ │ ├── truyum-logo-dark.png │ │ └── truyum-logo-light.png │ ├── js │ │ ├── js1.js │ │ └── script1.js │ ├── menu-item-list-admin.jsp │ ├── menu-item-list-customer.jsp │ └── style │ │ ├── st2.css │ │ ├── st3.css │ │ └── style.css ├── docs │ ├── .gitkeep │ ├── truYum-use-case-specification.docx │ └── truYum-web-interface-specification.docx ├── sql │ ├── truYum-schema-creation.sql │ └── truyum-data.sql └── src │ ├── com │ └── cognizant │ │ └── truyum │ │ ├── dao │ │ ├── CartDao.java │ │ ├── CartDaoCollectionImpl.java │ │ ├── CartDaoCollectionImplTest.java │ │ ├── CartDaoSqlImpl.java │ │ ├── CartDaoSqlImplTest.java │ │ ├── CartEmptyException.java │ │ ├── ConnectionHandler.java │ │ ├── MenuItemDao.java │ │ ├── MenuItemDaoCollectionImpl.java │ │ ├── MenuItemDaoCollectionImplTest.java │ │ ├── MenuItemDaoSqlImpl.java │ │ └── MenuItemDaoSqlImplTest.java │ │ ├── model │ │ ├── Cart.java │ │ └── MenuItem.java │ │ ├── servlet │ │ ├── AddToCartServlet.java │ │ ├── EditMenuItemServlet.java │ │ ├── RemoveCartServlet.java │ │ ├── ShowCartServlet.java │ │ ├── ShowEditMenuItemServlet.java │ │ ├── ShowMenuItemListAdminServlet.java │ │ └── ShowMenuItemListCustomerServlet.java │ │ └── util │ │ └── DateUtil.java │ └── connection.properties ├── final-check-v2 ├── README.md ├── micro-services │ ├── README.md │ ├── authentication-service-moviecruiser │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ ├── MavenWrapperDownloader.java │ │ │ │ ├── maven-wrapper.jar │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── cognizant │ │ │ │ │ └── moviecruiser │ │ │ │ │ └── authenticationservicemoviecruiser │ │ │ │ │ ├── AuthenticationServiceMoviecruiserApplication.java │ │ │ │ │ ├── SecurityConfig.java │ │ │ │ │ ├── WebConfig.java │ │ │ │ │ ├── controller │ │ │ │ │ ├── AuthenticationController.java │ │ │ │ │ └── UserController.java │ │ │ │ │ ├── exception │ │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ │ └── UserAlreadyExistsException.java │ │ │ │ │ ├── model │ │ │ │ │ ├── Role.java │ │ │ │ │ ├── Users.java │ │ │ │ │ └── movie.java │ │ │ │ │ ├── repository │ │ │ │ │ ├── RoleRepository.java │ │ │ │ │ └── UserRepository.java │ │ │ │ │ └── security │ │ │ │ │ ├── AppUser.java │ │ │ │ │ ├── AppUserDetailsService.java │ │ │ │ │ └── JwtAuthorizationFilter.java │ │ │ └── resources │ │ │ │ └── application.properties │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── cognizant │ │ │ └── moviecruiser │ │ │ └── authenticationservicemoviecruiser │ │ │ └── AuthenticationServiceMoviecruiserApplicationTests.java │ ├── eureka-discovery-server-moviecruiser │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ ├── MavenWrapperDownloader.java │ │ │ │ ├── maven-wrapper.jar │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── cognizant │ │ │ │ │ └── moviecruiser │ │ │ │ │ └── eurekadiscoveryservermoviecruiser │ │ │ │ │ └── EurekaDiscoveryServerMoviecruiserApplication.java │ │ │ └── resources │ │ │ │ └── application.properties │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── cognizant │ │ │ └── moviecruiser │ │ │ └── eurekadiscoveryservermoviecruiser │ │ │ └── EurekaDiscoveryServerMoviecruiserApplicationTests.java │ ├── movie-service │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ ├── MavenWrapperDownloader.java │ │ │ │ ├── maven-wrapper.jar │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── cognizant │ │ │ │ │ └── moviecruiser │ │ │ │ │ └── movieservice │ │ │ │ │ ├── MovieServiceApplication.java │ │ │ │ │ ├── SecurityConfig.java │ │ │ │ │ ├── WebConfig.java │ │ │ │ │ ├── controller │ │ │ │ │ ├── FavoritesController.java │ │ │ │ │ └── MovieController.java │ │ │ │ │ ├── exception │ │ │ │ │ ├── FavoritesEmptyException.java │ │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ │ └── UserAlreadyExistsException.java │ │ │ │ │ ├── model │ │ │ │ │ ├── Role.java │ │ │ │ │ ├── Users.java │ │ │ │ │ ├── favoritesDTO.java │ │ │ │ │ └── movie.java │ │ │ │ │ ├── repository │ │ │ │ │ ├── MovieItemRepository.java │ │ │ │ │ ├── RoleRepository.java │ │ │ │ │ └── UserRepository.java │ │ │ │ │ ├── security │ │ │ │ │ ├── AppUser.java │ │ │ │ │ ├── AppUserDetailsService.java │ │ │ │ │ └── JwtAuthorizationFilter.java │ │ │ │ │ └── service │ │ │ │ │ ├── FavoritesService.java │ │ │ │ │ └── MovieService.java │ │ │ └── resources │ │ │ │ └── application.properties │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── cognizant │ │ │ └── moviecruiser │ │ │ └── movieservice │ │ │ └── MovieServiceApplicationTests.java │ └── zuul-gateway-moviecruiser │ │ ├── .gitignore │ │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── cognizant │ │ │ │ └── moviecruiser │ │ │ │ └── zuulgatewaymoviecruiser │ │ │ │ ├── SimpleFilter.java │ │ │ │ └── ZuulGatewayMoviecruiserApplication.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── cognizant │ │ └── moviecruiser │ │ └── zuulgatewaymoviecruiser │ │ └── ZuulGatewayMoviecruiserApplicationTests.java ├── monolithic-services │ ├── README.md │ ├── dbscripts.sql │ └── moviecruiser │ │ ├── .gitignore │ │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── cognizant │ │ │ │ └── moviecruiser │ │ │ │ ├── MoviecruiserApplication.java │ │ │ │ ├── SecurityConfig.java │ │ │ │ ├── WebConfig.java │ │ │ │ ├── controller │ │ │ │ ├── AuthenticationController.java │ │ │ │ ├── FavoritesController.java │ │ │ │ ├── MovieController.java │ │ │ │ └── UserController.java │ │ │ │ ├── dao │ │ │ │ ├── FavoritesDao.java │ │ │ │ ├── FavoritesDaoCollectionImpl.java │ │ │ │ ├── MovieDao.java │ │ │ │ └── MovieDaoCollectionImpl.java │ │ │ │ ├── exception │ │ │ │ ├── FavoritesEmptyException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── UserAlreadyExistsException.java │ │ │ │ ├── favoritesDTO.java │ │ │ │ ├── model │ │ │ │ ├── Role.java │ │ │ │ ├── Users.java │ │ │ │ ├── favorites.java │ │ │ │ └── movie.java │ │ │ │ ├── repository │ │ │ │ ├── MovieItemRepository.java │ │ │ │ ├── RoleRepository.java │ │ │ │ └── UserRepository.java │ │ │ │ ├── security │ │ │ │ ├── AppUser.java │ │ │ │ ├── AppUserDetailsService.java │ │ │ │ └── JwtAuthorizationFilter.java │ │ │ │ └── service │ │ │ │ ├── FavoritesService.java │ │ │ │ └── MovieService.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── moviecruiser.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── cognizant │ │ └── moviecruiser │ │ └── MoviecruiserApplicationTests.java ├── ui-design │ └── README.md └── webapp │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── Booking │ │ │ ├── favorites.service.spec.ts │ │ │ ├── favorites.service.ts │ │ │ └── favorites │ │ │ │ ├── favorites.component.css │ │ │ │ ├── favorites.component.html │ │ │ │ ├── favorites.component.spec.ts │ │ │ │ ├── favorites.component.ts │ │ │ │ └── favorites.ts │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── auth-guard-service.service.spec.ts │ │ ├── auth-guard-service.service.ts │ │ ├── food │ │ │ ├── item-edit │ │ │ │ ├── item-edit.component.css │ │ │ │ ├── item-edit.component.html │ │ │ │ ├── item-edit.component.spec.ts │ │ │ │ └── item-edit.component.ts │ │ │ ├── item-info │ │ │ │ ├── item-info.component.css │ │ │ │ ├── item-info.component.html │ │ │ │ ├── item-info.component.spec.ts │ │ │ │ └── item-info.component.ts │ │ │ ├── menu │ │ │ │ ├── menu.component.css │ │ │ │ ├── menu.component.html │ │ │ │ ├── menu.component.spec.ts │ │ │ │ └── menu.component.ts │ │ │ ├── movie.service.spec.ts │ │ │ ├── movie.service.ts │ │ │ └── search │ │ │ │ ├── search.component.css │ │ │ │ ├── search.component.html │ │ │ │ ├── search.component.spec.ts │ │ │ │ └── search.component.ts │ │ ├── movie.ts │ │ └── site │ │ │ ├── auth-service.service.spec.ts │ │ │ ├── auth-service.service.ts │ │ │ ├── login │ │ │ ├── login.component.css │ │ │ ├── login.component.html │ │ │ ├── login.component.spec.ts │ │ │ └── login.component.ts │ │ │ ├── signup │ │ │ ├── User.ts │ │ │ ├── signup.component.css │ │ │ ├── signup.component.html │ │ │ ├── signup.component.spec.ts │ │ │ └── signup.component.ts │ │ │ ├── user-service.service.spec.ts │ │ │ └── user-service.service.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json │ ├── tsconfig.json │ └── tslint.json └── truyum-v2 ├── README.md ├── data.sql ├── micro-services ├── README.md ├── authentication-service │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── cognizant │ │ │ │ └── truyum │ │ │ │ └── authenticationservice │ │ │ │ ├── AuthenticationServiceApplication.java │ │ │ │ ├── SecurityConfig.java │ │ │ │ ├── WebConfig.java │ │ │ │ ├── controller │ │ │ │ ├── AuthenticationController.java │ │ │ │ └── UserController.java │ │ │ │ ├── exception │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── UserAlreadyExistsException.java │ │ │ │ ├── model │ │ │ │ ├── MenuItem.java │ │ │ │ ├── Role.java │ │ │ │ └── Users.java │ │ │ │ ├── repository │ │ │ │ ├── RoleRepository.java │ │ │ │ └── UserRepository.java │ │ │ │ └── security │ │ │ │ ├── AppUser.java │ │ │ │ ├── AppUserDetailsService.java │ │ │ │ └── JwtAuthorizationFilter.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── cognizant │ │ └── truyum │ │ └── authenticationservice │ │ └── AuthenticationServiceApplicationTests.java ├── eureka-discovery-server-truyum │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── cognizant │ │ │ │ └── truyum │ │ │ │ └── eurekadiscoveryservertruyum │ │ │ │ └── EurekaDiscoveryServerTruyumApplication.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── cognizant │ │ └── truyum │ │ └── eurekadiscoveryservertruyum │ │ └── EurekaDiscoveryServerTruyumApplicationTests.java ├── menuitem-service │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── cognizant │ │ │ │ └── truyum │ │ │ │ └── menuitemservice │ │ │ │ ├── DTO │ │ │ │ └── CartDTO.java │ │ │ │ ├── MenuitemServiceApplication.java │ │ │ │ ├── SecurityConfig.java │ │ │ │ ├── WebConfig.java │ │ │ │ ├── controller │ │ │ │ ├── CartController.java │ │ │ │ └── MenuItemController.java │ │ │ │ ├── exception │ │ │ │ ├── CartEmptyException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── UserAlreadyExistsException.java │ │ │ │ ├── model │ │ │ │ ├── MenuItem.java │ │ │ │ ├── Role.java │ │ │ │ └── Users.java │ │ │ │ ├── repository │ │ │ │ ├── MenuItemRepository.java │ │ │ │ ├── RoleRepository.java │ │ │ │ └── UserRepository.java │ │ │ │ ├── security │ │ │ │ ├── AppUser.java │ │ │ │ ├── AppUserDetailsService.java │ │ │ │ └── JwtAuthorizationFilter.java │ │ │ │ └── service │ │ │ │ ├── CartService.java │ │ │ │ └── MenuItemService.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── cognizant │ │ └── truyum │ │ └── menuitemservice │ │ └── MenuitemServiceApplicationTests.java └── zuul-gateway-truyum │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cognizant │ │ │ └── truyum │ │ │ └── zuulgatewaytruyum │ │ │ ├── SimpleFilter.java │ │ │ └── ZuulGatewayTruyumApplication.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── cognizant │ └── truyum │ └── zuulgatewaytruyum │ └── ZuulGatewayTruyumApplicationTests.java ├── monolithic-services ├── README.md ├── data.sql ├── schema.sql └── truyum │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── cognizant │ │ │ └── truyum │ │ │ ├── DTO │ │ │ └── CartDTO.java │ │ │ ├── SecurityConfig.java │ │ │ ├── TruyumApplication.java │ │ │ ├── WebConfig.java │ │ │ ├── controller │ │ │ ├── AuthenticationController.java │ │ │ ├── CartController.java │ │ │ ├── MenuItemController.java │ │ │ └── UserController.java │ │ │ ├── dao │ │ │ ├── CartDao.java │ │ │ ├── CartDaoCollectionImpl.java │ │ │ ├── MenuItemDao.java │ │ │ └── MenuItemDaoCollectionImpl.java │ │ │ ├── exception │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── UserAlreadyExistsException.java │ │ │ ├── model │ │ │ ├── Cart.java │ │ │ ├── MenuItem.java │ │ │ ├── Role.java │ │ │ └── Users.java │ │ │ ├── repository │ │ │ ├── CartRepository.java │ │ │ ├── MenuItemRepository.java │ │ │ ├── RoleRepository.java │ │ │ └── UserRepository.java │ │ │ ├── security │ │ │ ├── AppUser.java │ │ │ ├── AppUserDetailsService.java │ │ │ └── JwtAuthorizationFilter.java │ │ │ └── service │ │ │ ├── CartEmptyException.java │ │ │ ├── CartService.java │ │ │ └── MenuItemService.java │ └── resources │ │ ├── application.properties │ │ └── truyum.xml │ └── test │ └── java │ └── com │ └── cognizant │ └── truyum │ └── TruyumApplicationTests.java ├── ui-design └── README.md └── webapp ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.e2e.json ├── package-lock.json ├── package.json ├── src ├── app │ ├── app-routing.module.ts │ ├── app.component.css │ ├── app.component.html │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── auth-guard-service.service.spec.ts │ ├── auth-guard-service.service.ts │ ├── food │ │ ├── food.service.spec.ts │ │ ├── food.service.ts │ │ ├── item-edit │ │ │ ├── item-edit.component.css │ │ │ ├── item-edit.component.html │ │ │ ├── item-edit.component.spec.ts │ │ │ └── item-edit.component.ts │ │ ├── item-info │ │ │ ├── item-info.component.css │ │ │ ├── item-info.component.html │ │ │ ├── item-info.component.spec.ts │ │ │ └── item-info.component.ts │ │ ├── menu │ │ │ ├── menu.component.css │ │ │ ├── menu.component.html │ │ │ ├── menu.component.spec.ts │ │ │ └── menu.component.ts │ │ └── search │ │ │ ├── search.component.css │ │ │ ├── search.component.html │ │ │ ├── search.component.spec.ts │ │ │ └── search.component.ts │ ├── fooditem.ts │ ├── services │ │ ├── menu-item.service.spec.ts │ │ └── menu-item.service.ts │ ├── shopping │ │ ├── cart.service.spec.ts │ │ ├── cart.service.ts │ │ └── cart │ │ │ ├── cart.component.css │ │ │ ├── cart.component.html │ │ │ ├── cart.component.spec.ts │ │ │ ├── cart.component.ts │ │ │ └── cartitem.ts │ └── site │ │ ├── auth-service.service.spec.ts │ │ ├── auth-service.service.ts │ │ ├── login │ │ ├── login.component.css │ │ ├── login.component.html │ │ ├── login.component.spec.ts │ │ └── login.component.ts │ │ ├── signup │ │ ├── User.ts │ │ ├── signup.component.css │ │ ├── signup.component.html │ │ ├── signup.component.spec.ts │ │ └── signup.component.ts │ │ ├── user-service.service.spec.ts │ │ └── user-service.service.ts ├── assets │ └── .gitkeep ├── browserslist ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── karma.conf.js ├── main.ts ├── polyfills.ts ├── styles.css ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── tslint.json ├── tsconfig.json └── tslint.json /README.md: -------------------------------------------------------------------------------- 1 | # Java-Full-Stack-Projects 2 | 3 | There are two projects in this : 1) Truyum : Food Ordering Website 4 | 2) Moviecruiser : Movie Booking website. 5 | 6 | 7 | These projects are developed and implemented with following Technologies and Frameworks 8 | 9 | Programming Language : JAVA with MySQL 10 | 11 | Frameworks : Spring Framework(REST API's) with Hibernate(connection to database) 12 | 13 | FrontEND : ANGULAR 14 | 15 | Backend : JAVA + Spring + HIbernate 16 | 17 | Database : MySQL 18 | 19 | Full Stack project files are : 20 | ## 1) Moviecruiser : Movie Booking website 21 | 22 | link here=> https://github.com/balajisomasale/Java-Full-Stack-Projects/tree/master/final-check-v2 23 | 24 | ## 2) Truyum : Food Ordering Website 25 | 26 | link here => https://github.com/balajisomasale/Java-Full-Stack-Projects/tree/master/truyum-v2 27 | -------------------------------------------------------------------------------- /UI-bootstrap-moviecruiser/README.md: -------------------------------------------------------------------------------- 1 | Project for completing the final check of FSE track. 2 | -------------------------------------------------------------------------------- /UI-bootstrap-truyum/WebContent/README.md: -------------------------------------------------------------------------------- 1 | This is the Basic Java project with CSS and JS 2 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /build 3 | .classpath 4 | .project 5 | /bin/ 6 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/WEB-INF/lib/jstl-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/WEB-INF/lib/jstl-1.2.jar -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/WEB-INF/lib/mysql-connector-java-5.1.45.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/WEB-INF/lib/mysql-connector-java-5.1.45.jar -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/edit-movie-status.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/edit-movie-status.html -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/edit-movie-status.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/edit-movie-status.jsp -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/edit-movie.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/edit-movie.html -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/edit-movie.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/edit-movie.jsp -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/favorites-empty.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/favorites-empty.html -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/favorites-empty.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/favorites-empty.jsp -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/favorites-notification.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/favorites-notification.html -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/favorites.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/favorites.html -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/favorites.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/favorites.jsp -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/images/logo.png -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/js/script2.js: -------------------------------------------------------------------------------- 1 | function validateMovieForm() 2 | { 3 | //document.write("Hello"); 4 | var name=document.movieForm.name.value; 5 | var price=document.movieForm.price.value; 6 | // var special = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+/;; 7 | //var num=/[1234567890]+/; 8 | var date=document.movieForm.date.value; 9 | // var date1=/[1234567890/]+/; 10 | 11 | 12 | 13 | 14 | var opt=document.movieForm.select.value; 15 | if(name==null||name=="") 16 | { 17 | alert("Please Enter something instead of nothing"); 18 | return false; 19 | } 20 | else if(name.length>100 ||name.length<2 ) 21 | { 22 | alert("Name should be between 2 & 100"); 23 | return false; 24 | } 25 | // else if(special.test(name)) 26 | // { 27 | // alert("It cant contain special chara"); 28 | // return false; 29 | // } 30 | else if(isNaN(price)) 31 | { 32 | alert("price should contain numbers"); 33 | return false; 34 | } 35 | 36 | else if(price==null||price=="") 37 | { 38 | alert('price should not be blank'); 39 | return false; 40 | 41 | } 42 | 43 | 44 | else if(date==null||date=="") 45 | { 46 | alert("date cant be empty"); 47 | return false; 48 | } 49 | 50 | else if(opt==null||opt=="") 51 | { 52 | alert("Choose atleast One GENRE"); 53 | return false; 54 | } 55 | 56 | 57 | } -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/movie-list-admin.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/movie-list-admin.html -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/movie-list-admin.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/movie-list-admin.jsp -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/movie-list-customer-notification.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/movie-list-customer-notification.html -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/movie-list-customer.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/movie-list-customer.html -------------------------------------------------------------------------------- /basic-java-moviecruiser/WebContent/movie-list-customer.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-moviecruiser/WebContent/movie-list-customer.jsp -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/connection.properties: -------------------------------------------------------------------------------- 1 | driver=com.mysql.jdbc.Driver 2 | connection-url=jdbc:mysql://localhost:3306/schema 3 | user=root 4 | password=password123 5 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/dao/ConnectionHandler.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.dao; 2 | 3 | import java.io.IOException; 4 | import java.sql.Connection; 5 | import java.sql.DriverManager; 6 | import java.sql.SQLException; 7 | import java.util.Properties; 8 | 9 | public class ConnectionHandler { 10 | 11 | public static Connection getConnection() { 12 | 13 | Properties prop = new Properties(); 14 | Connection con = null; 15 | try { 16 | prop.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("connection.properties")); 17 | } catch (IOException e) { 18 | // TODO Auto-generated catch block 19 | e.printStackTrace(); 20 | } 21 | String driver = prop.getProperty("driver"); 22 | String url = prop.getProperty("connection-url"); 23 | String username = prop.getProperty("user"); 24 | String password = prop.getProperty("password"); 25 | 26 | try { 27 | Class.forName(driver); 28 | } catch (ClassNotFoundException e) { 29 | // TODO Auto-generated catch block 30 | e.printStackTrace(); 31 | } 32 | 33 | try { 34 | con = DriverManager.getConnection(url, username, password); 35 | } catch (SQLException e) { 36 | // TODO Auto-generated catch block 37 | e.printStackTrace(); 38 | } 39 | // System.out.println("hello"); 40 | return con; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/dao/FavoritesDao.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.dao; 2 | 3 | import com.cognizant.moviecruiser.dao.FavoritesEmptyException; 4 | import com.cognizant.moviecruiser.model.Favorites; 5 | import java.util.List; 6 | 7 | import com.cognizant.moviecruiser.model.Movie; 8 | 9 | public interface FavoritesDao { 10 | public void addFavoritesItem(long userId, long menuItemId); 11 | 12 | public Favorites getAllFavoritesItems(long userId) throws FavoritesEmptyException; 13 | 14 | public void removeFavoritesItem(long userId, long movieItemId); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/dao/FavoritesDaoCollectionImplTest.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.dao; 2 | 3 | import com.cognizant.moviecruiser.model.Favorites; 4 | 5 | public class FavoritesDaoCollectionImplTest { 6 | 7 | public static void main(String[] args) { 8 | testAddFavoritesItem(); 9 | testRemoveFavoritesItem(); 10 | } 11 | 12 | public static void testAddFavoritesItem() { 13 | FavoritesDao favoritesDao = new FavoritesDaoCollectionImpl(); 14 | 15 | favoritesDao.addFavoritesItem(1l, 2l); 16 | // favoritesDao.addFavoritesItem(2l,3l); 17 | 18 | try { 19 | Favorites c1 = favoritesDao.getAllFavoritesItems(1l); 20 | System.out.println(c1.getMovieList()); 21 | } catch (FavoritesEmptyException e) { 22 | System.out.println(e.getMessage()); 23 | 24 | } 25 | 26 | } 27 | 28 | public static void testRemoveFavoritesItem() { 29 | FavoritesDao favoritesDao = new FavoritesDaoCollectionImpl(); 30 | // favoritesDao.removeFavoritesItem(1l,2l); 31 | // favoritesDao.removeFavoritesItem(2l,3l); 32 | try { 33 | 34 | Favorites c2 = favoritesDao.getAllFavoritesItems(1l); 35 | System.out.println(c2.getMovieList()); 36 | 37 | } catch (FavoritesEmptyException e) { 38 | System.out.println(e.getMessage()); 39 | } 40 | 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/dao/FavoritesDaoSqlImplTest.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.cognizant.moviecruiser.model.Favorites; 6 | import com.cognizant.moviecruiser.model.Movie; 7 | 8 | public class FavoritesDaoSqlImplTest { 9 | 10 | public static void main(String[] args) throws Exception { 11 | 12 | testAddFavoritesItem(); 13 | testRemoveFavoritesItem(); 14 | testGetAllFavoritesItems(); 15 | 16 | } 17 | 18 | public static void testGetAllFavoritesItems() throws Exception { 19 | FavoritesDaoSqlImpl favoritesdao = new FavoritesDaoSqlImpl(); 20 | 21 | Favorites c1 = favoritesdao.getAllFavoritesItems(1l); 22 | List m1 = c1.getMovieList(); 23 | for (Movie i : m1) { 24 | System.out.println(i.toString()); 25 | } 26 | System.out.println("Total No of Favorites: " + c1.getNooffavorites()); 27 | 28 | } 29 | 30 | public static void testAddFavoritesItem() throws Exception { 31 | FavoritesDaoSqlImpl favoritesdao = new FavoritesDaoSqlImpl(); 32 | favoritesdao.addFavoritesItem(1, 1); 33 | favoritesdao.addFavoritesItem(1, 2); 34 | 35 | Favorites c1 = favoritesdao.getAllFavoritesItems(1l); 36 | List m1 = c1.getMovieList(); 37 | for (Movie i : m1) { 38 | System.out.println(i.toString()); 39 | } 40 | 41 | } 42 | 43 | public static void testRemoveFavoritesItem() throws Exception { 44 | FavoritesDaoSqlImpl favoritesdao = new FavoritesDaoSqlImpl(); 45 | favoritesdao.removeFavoritesItem(1, 1); 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/dao/FavoritesEmptyException.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.dao; 2 | 3 | public class FavoritesEmptyException extends Exception { 4 | 5 | public FavoritesEmptyException() { 6 | super("Cart is Empty"); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/dao/MovieDao.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.cognizant.moviecruiser.model.Movie; 6 | 7 | public interface MovieDao { 8 | 9 | 10 | 11 | public List getMovieListAdmin(); 12 | 13 | public List getMovieListCustomer(); 14 | public void modifyMovie( Movie movie); 15 | public Movie getMovie( long movieId); 16 | 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/dao/MovieDaoCollectionImplTest.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.dao; 2 | 3 | import java.text.ParseException; 4 | import java.util.List; 5 | 6 | import com.cognizant.moviecruiser.model.Movie; 7 | import com.cognizant.moviecruiser.util.DateUtil; 8 | 9 | public class MovieDaoCollectionImplTest { 10 | 11 | public static void testGetMovieListAdmin() throws ParseException { 12 | 13 | MovieDao movieDao = new MovieDaoCollectionImpl(); 14 | List movieList = movieDao.getMovieListAdmin(); 15 | 16 | for (Object o1 : movieList) { 17 | System.out.println(o1.toString()); 18 | 19 | } 20 | 21 | } 22 | 23 | public static void testGetMovieListCustomer() throws ParseException { 24 | 25 | MovieDao movieDao = new MovieDaoCollectionImpl(); 26 | List movieList = movieDao.getMovieListCustomer(); 27 | 28 | for (Object o1 : movieList) { 29 | System.out.println(o1.toString()); 30 | 31 | } 32 | 33 | } 34 | 35 | public static void main(String[] arg) throws ParseException 36 | 37 | { 38 | 39 | testGetMovieListAdmin(); 40 | 41 | testGetMovieListCustomer(); 42 | testModifyMovie(); 43 | 44 | } 45 | 46 | public static void testModifyMovie() throws ParseException { 47 | Movie ob = new Movie(1l, "Avat", 2787965087l, true, DateUtil.convertToDate("15/03/2017"), "Science Fiction", 48 | true); 49 | MovieDao movieDao = new MovieDaoCollectionImpl(); 50 | movieDao.modifyMovie(ob); 51 | System.out.println(movieDao.getMovie(1l)); 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/model/Favorites.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.model; 2 | 3 | import java.util.List; 4 | 5 | import com.cognizant.moviecruiser.model.Movie; 6 | 7 | //import com.cognizant.truyum.model.MenuItem; 8 | 9 | public class Favorites { 10 | 11 | public Favorites(List movieList, int nooffavorites) { 12 | super(); 13 | this.movieList = movieList; 14 | this.nooffavorites = nooffavorites; 15 | } 16 | 17 | private List movieList; 18 | 19 | private int nooffavorites; 20 | 21 | @Override 22 | public String toString() { 23 | return "favorites [movieList=" + movieList + ", nooffavorites=" + nooffavorites + "]"; 24 | } 25 | 26 | public List getMovieList() { 27 | return movieList; 28 | } 29 | 30 | public void setMovieList(List movieList) { 31 | this.movieList = movieList; 32 | } 33 | 34 | public int getNooffavorites() { 35 | return nooffavorites; 36 | } 37 | 38 | public void setNooffavorites(int nooffavorites) { 39 | this.nooffavorites = nooffavorites; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/servlet/ShowEditMovieServlet.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.servlet; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.RequestDispatcher; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.annotation.WebServlet; 8 | import javax.servlet.http.HttpServlet; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | import com.cognizant.moviecruiser.dao.MovieDao; 13 | import com.cognizant.moviecruiser.dao.MovieDaoSqlImpl; 14 | 15 | @WebServlet("/ShowEditMovie") 16 | public class ShowEditMovieServlet extends HttpServlet { 17 | private static final long serialVersionUID = 1L; 18 | 19 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 20 | 21 | MovieDao movieDao = new MovieDaoSqlImpl(); 22 | 23 | long l = Long.parseLong(request.getParameter("movieId")); 24 | request.setAttribute("movie", movieDao.getMovie(l)); 25 | RequestDispatcher rd = request.getRequestDispatcher("edit-movie.jsp"); 26 | rd.forward(request, response); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/servlet/ShowMovieListAdminServlet.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.servlet; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.RequestDispatcher; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.annotation.WebServlet; 8 | import javax.servlet.http.HttpServlet; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | import com.cognizant.moviecruiser.dao.MovieDao; 13 | import com.cognizant.moviecruiser.dao.MovieDaoSqlImpl; 14 | 15 | @WebServlet("/ShowMovieListAdmin") 16 | public class ShowMovieListAdminServlet extends HttpServlet { 17 | 18 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 19 | 20 | MovieDao movieDao = new MovieDaoSqlImpl(); 21 | 22 | request.setAttribute("movieList", movieDao.getMovieListAdmin()); 23 | // System.out.println("inside showmenuadmin: 24 | // "+menuItemDao.getMenuItemListAdmin()); 25 | RequestDispatcher rd = request.getRequestDispatcher("movie-list-admin.jsp"); 26 | rd.forward(request, response); 27 | 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/servlet/ShowMovieListCustomerServlet.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.servlet; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.RequestDispatcher; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.annotation.WebServlet; 8 | import javax.servlet.http.HttpServlet; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | import com.cognizant.moviecruiser.dao.MovieDao; 13 | import com.cognizant.moviecruiser.dao.MovieDaoSqlImpl; 14 | 15 | @WebServlet("/ShowMovieListCustomer") 16 | public class ShowMovieListCustomerServlet extends HttpServlet { 17 | private static final long serialVersionUID = 1L; 18 | 19 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 20 | 21 | MovieDao movieDao = new MovieDaoSqlImpl(); 22 | 23 | request.setAttribute("movieList", movieDao.getMovieListCustomer()); 24 | // System.out.println("inside showmenuadmin: 25 | // "+menuItemDao.getMenuItemListAdmin()); 26 | RequestDispatcher rd = request.getRequestDispatcher("movie-list-customer.jsp"); 27 | rd.forward(request, response); 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/com/cognizant/moviecruiser/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.util; 2 | 3 | import java.text.ParseException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | public class DateUtil { 8 | 9 | public static Date convertToDate(String date) 10 | 11 | { 12 | SimpleDateFormat f1 = new SimpleDateFormat("dd/MM/yyyy"); 13 | Date d; 14 | try { 15 | d = f1.parse(date); 16 | return d; 17 | } catch (ParseException e) { 18 | // TODO Auto-generated catch block 19 | e.printStackTrace(); 20 | } 21 | 22 | return null; 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /basic-java-moviecruiser/src/connection.properties: -------------------------------------------------------------------------------- 1 | driver=com.mysql.jdbc.Driver 2 | connection-url=jdbc:mysql://localhost:3306/moviecruiser 3 | user=root 4 | password=password-1 5 | 6 | -------------------------------------------------------------------------------- /basic-java-truyum/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /build 3 | .classpath 4 | .project 5 | /bin/ 6 | -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/WEB-INF/lib/jstl-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/WebContent/WEB-INF/lib/jstl-1.2.jar -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/WEB-INF/lib/mysql-connector-java-5.1.45.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/WebContent/WEB-INF/lib/mysql-connector-java-5.1.45.jar -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/cart-empty.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/WebContent/cart-empty.jsp -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/cart.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/WebContent/cart.jsp -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/edit-menu-item-status.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/WebContent/edit-menu-item-status.jsp -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/edit-menu-item.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/WebContent/edit-menu-item.jsp -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/images/truyum-logo-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/WebContent/images/truyum-logo-dark.png -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/images/truyum-logo-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/WebContent/images/truyum-logo-light.png -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/js/js1.js: -------------------------------------------------------------------------------- 1 | function jspfunction() 2 | { 3 | var name=document.myform.uname.value; 4 | var price=document.myform.price.value; 5 | var special = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+/;; 6 | var num=/[1234567890]+/; 7 | var date=document.myform.date.value; 8 | var date1=/[1234567890/]+/; 9 | if(name==null||name=="") 10 | { 11 | alert("Please Enter something instead of nothing"); 12 | return false; 13 | } 14 | else if(name.length>65 ||name.length<2 ) 15 | { 16 | alert("Name should be between 2 & 65"); 17 | return false; 18 | } 19 | else if(special.test(name)) 20 | { 21 | alert("It cant contain special chara"); 22 | return false; 23 | } 24 | else if(isNaN(price)) 25 | { 26 | alert("price should contain numbers"); 27 | return false; 28 | } 29 | 30 | else if(price==null||price=="") 31 | { 32 | alert('price should not be blank'); 33 | return false; 34 | 35 | } 36 | 37 | 38 | else if(date==null||date=="") 39 | { 40 | alert("date cant be empty"); 41 | return false; 42 | } 43 | else if(isNaN(price)) 44 | { 45 | 46 | alert("It should contain numbers"); 47 | return false; 48 | } 49 | 50 | 51 | } -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/menu-item-list-admin.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/WebContent/menu-item-list-admin.jsp -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/menu-item-list-customer.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/WebContent/menu-item-list-customer.jsp -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/style/st2.css: -------------------------------------------------------------------------------- 1 | header{ 2 | background-color:navy; 3 | width:100%; 4 | height:40px; 5 | color:lightgray; 6 | font-family:verdana; 7 | font-size:20px; 8 | padding:5px; 9 | 10 | } 11 | img{ 12 | height:30px; 13 | width:30px; 14 | padding-left:20px; 15 | } 16 | #me{ 17 | padding-left:1300px; 18 | color:white; 19 | } 20 | #ca{ 21 | color:white; 22 | padding-left:50px; 23 | } 24 | 25 | footer{ 26 | background-color:lightgray; 27 | width:100%; 28 | position:fixed; 29 | bottom:0; 30 | right:0; 31 | } 32 | #b{ 33 | padding:5px; 34 | font-family:arial; 35 | } 36 | th,td{ 37 | text-align:center; 38 | } 39 | table{ 40 | font-family:"arial"; 41 | width:80%; 42 | border-spacing:10px; 43 | margin-left:auto; 44 | margin-right:auto; 45 | } 46 | .pew{ 47 | text-align:right; 48 | } 49 | .new{ 50 | text-align:left; 51 | width:50%; 52 | } 53 | h2{ 54 | font-family:"arial"; 55 | } 56 | 57 | #alert2{ 58 | 59 | text-align:center; 60 | margin-left:auto; 61 | font-size:64; 62 | font-family:arial;; 63 | color:green; 64 | } 65 | 66 | 67 | 68 | #p{ 69 | 70 | text-align:center; 71 | 72 | } 73 | 74 | 75 | -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/style/st3.css: -------------------------------------------------------------------------------- 1 | header{ 2 | background-color:navy; 3 | width:100%; 4 | height:40px; 5 | color:lightgray; 6 | font-family:verdana; 7 | font-size:20px; 8 | padding:5px; 9 | 10 | } 11 | img{ 12 | height:30px; 13 | width:30px; 14 | padding-left:20px; 15 | } 16 | #me{ 17 | padding-left:1300px; 18 | color:white; 19 | } 20 | 21 | footer{ 22 | background-color:lightgray; 23 | width:100%; 24 | position:fixed; 25 | bottom:0; 26 | right:0; 27 | } 28 | h2{ 29 | font-family:"arial"; 30 | margin-left:225px; 31 | color:black; 32 | } 33 | table{ 34 | width:70%; 35 | font-family:"arial"; 36 | border-spacing:20px; 37 | margin-left:auto; 38 | margin-right:auto; 39 | } 40 | #t1{ 41 | width:100%; 42 | } 43 | #b2{ 44 | background-color:navy; 45 | border:none; 46 | color:white; 47 | padding:15px 32px; 48 | text-align:center; 49 | text-decoration:none; 50 | display:inline-block; 51 | font-size:16px; 52 | } 53 | 54 | #alertmsg{ 55 | 56 | font-family:arial; 57 | font-size:64; 58 | margin-left:190px; 59 | color:#008000; 60 | 61 | } 62 | #bn{ 63 | 64 | font-family:arial; 65 | margin-left:190px; 66 | } 67 | 68 | 69 | 70 | #alertmsg4{ 71 | 72 | font-family:arial; 73 | font-size:64; 74 | margin-left:190px; 75 | color:gray; 76 | 77 | } 78 | #balu{ 79 | 80 | 81 | 82 | text-align:right; 83 | } 84 | 85 | -------------------------------------------------------------------------------- /basic-java-truyum/WebContent/style/style.css: -------------------------------------------------------------------------------- 1 | header{ 2 | background-color:navy; 3 | width:100%; 4 | height:40px; 5 | color:lightgray; 6 | font-family:verdana; 7 | font-size:20px; 8 | padding:5px; 9 | 10 | } 11 | img{ 12 | height:30px; 13 | width:30px; 14 | padding-left:20px; 15 | } 16 | #me{ 17 | 18 | padding-left:1300px; 19 | color:white; 20 | padding-top:5px; 21 | } 22 | footer{ 23 | background-color:lightgray; 24 | width:100%; 25 | position:fixed; 26 | bottom:0; 27 | right:0; 28 | } 29 | #b{ 30 | padding:5px; 31 | font-family:arial; 32 | } 33 | th,td{ 34 | text-align:center; 35 | } 36 | table{ 37 | font-family:"arial"; 38 | width:70%; 39 | border-spacing:10px; 40 | margin-left:auto; 41 | margin-right:auto; 42 | } 43 | .pew{ 44 | text-align:right; 45 | } 46 | .new{ 47 | text-align:left; 48 | width:50%; 49 | } 50 | h2{ 51 | font-family:"arial"; 52 | margin-left:275px; 53 | } 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /basic-java-truyum/docs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/docs/.gitkeep -------------------------------------------------------------------------------- /basic-java-truyum/docs/truYum-use-case-specification.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/docs/truYum-use-case-specification.docx -------------------------------------------------------------------------------- /basic-java-truyum/docs/truYum-web-interface-specification.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/basic-java-truyum/docs/truYum-web-interface-specification.docx -------------------------------------------------------------------------------- /basic-java-truyum/src/com/cognizant/truyum/dao/CartDao.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.cognizant.truyum.model.Cart; 6 | import com.cognizant.truyum.model.MenuItem; 7 | 8 | public interface CartDao { 9 | 10 | public void addCartItem( long userId,long menuItemId); 11 | public Cart getAllCartItems(long userId) throws CartEmptyException; 12 | 13 | public void removeCartItem(long userId,long menuItemId); 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /basic-java-truyum/src/com/cognizant/truyum/dao/CartDaoCollectionImplTest.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.dao; 2 | 3 | import com.cognizant.truyum.model.Cart; 4 | import com.cognizant.truyum.model.MenuItem; 5 | 6 | public class CartDaoCollectionImplTest { 7 | 8 | public static void main(String[] args) { 9 | testAddCartItem(); 10 | testRemoveCartItem(); 11 | } 12 | 13 | public static void testAddCartItem() { 14 | CartDao cartDao = new CartDaoCollectionImpl(); 15 | 16 | cartDao.addCartItem(1l, 2l); 17 | //cartDao.addCartItem(2l, 3l); 18 | 19 | try { 20 | Cart c1 = cartDao.getAllCartItems(1l); 21 | System.out.println(c1.getMenuItemList()); 22 | } catch (CartEmptyException e) { 23 | System.out.println(e.getMessage()); 24 | 25 | } 26 | 27 | } 28 | 29 | public static void testRemoveCartItem() { 30 | CartDao cartDao = new CartDaoCollectionImpl(); 31 | cartDao.removeCartItem(1l, 2l); 32 | //cartDao.removeCartItem(2l, 3l); 33 | try { 34 | 35 | Cart c2 = cartDao.getAllCartItems(1l); 36 | System.out.println(c2.getMenuItemList()); 37 | 38 | } catch (CartEmptyException e) { 39 | System.out.println(e.getMessage()); 40 | } 41 | 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /basic-java-truyum/src/com/cognizant/truyum/dao/CartDaoSqlImplTest.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.cognizant.truyum.model.Cart; 6 | import com.cognizant.truyum.model.MenuItem; 7 | 8 | public class CartDaoSqlImplTest { 9 | 10 | public static void main(String[] args) throws Exception { 11 | 12 | // testAddCartItem(); 13 | //testRemoveCartItem(); 14 | testGetAllCartItems(); 15 | 16 | } 17 | 18 | public static void testGetAllCartItems() throws Exception { 19 | CartDaoSqlImpl cartdao = new CartDaoSqlImpl(); 20 | 21 | Cart c1 = cartdao.getAllCartItems(1l); 22 | List m1 = c1.getMenuItemList(); 23 | for (MenuItem i : m1) { 24 | System.out.println(i.toString()); 25 | } 26 | System.out.println("Total price: "+c1.getTotal()); 27 | 28 | } 29 | 30 | public static void testAddCartItem() throws Exception { 31 | CartDaoSqlImpl cartdao = new CartDaoSqlImpl(); 32 | cartdao.addCartItem(1,1); 33 | cartdao.addCartItem(1,2); 34 | 35 | Cart c1 = cartdao.getAllCartItems(1l); 36 | List m1 = c1.getMenuItemList(); 37 | for (MenuItem i : m1) { 38 | System.out.println(i.toString()); 39 | } 40 | 41 | } 42 | 43 | public static void testRemoveCartItem() throws Exception { 44 | CartDaoSqlImpl cartdao = new CartDaoSqlImpl(); 45 | cartdao.removeCartItem(1,1); 46 | 47 | 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /basic-java-truyum/src/com/cognizant/truyum/dao/CartEmptyException.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.dao; 2 | 3 | public class CartEmptyException extends Exception 4 | { 5 | 6 | public CartEmptyException() 7 | { 8 | super("Cart is Empty"); 9 | } 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /basic-java-truyum/src/com/cognizant/truyum/dao/ConnectionHandler.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.dao; 2 | 3 | import java.io.IOException; 4 | import java.sql.Connection; 5 | import java.sql.DriverManager; 6 | import java.sql.SQLException; 7 | 8 | import java.util.Properties; 9 | 10 | public class ConnectionHandler { 11 | 12 | public static Connection getConnection() { 13 | 14 | Properties prop = new Properties(); 15 | Connection con = null; 16 | try { 17 | prop.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("connection.properties")); 18 | } catch (IOException e) { 19 | // TODO Auto-generated catch block 20 | e.printStackTrace(); 21 | } 22 | String driver = prop.getProperty("driver"); 23 | String url = prop.getProperty("connection-url"); 24 | String username = prop.getProperty("user"); 25 | String password = prop.getProperty("password"); 26 | 27 | try { 28 | Class.forName(driver); 29 | } catch (ClassNotFoundException e) { 30 | // TODO Auto-generated catch block 31 | e.printStackTrace(); 32 | } 33 | 34 | try { 35 | con = DriverManager.getConnection(url, username, password); 36 | } catch (SQLException e) { 37 | // TODO Auto-generated catch block 38 | e.printStackTrace(); 39 | } 40 | // System.out.println("hello"); 41 | return con; 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /basic-java-truyum/src/com/cognizant/truyum/dao/MenuItemDao.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.cognizant.truyum.model.MenuItem; 6 | 7 | public interface MenuItemDao { 8 | 9 | 10 | public List getMenuItemListAdmin(); 11 | 12 | public List getMenuItemListCustomer(); 13 | public void modifyMenuItem( MenuItem menuItem); 14 | public MenuItem getMenuItem( long menuItemId); 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /basic-java-truyum/src/com/cognizant/truyum/dao/MenuItemDaoCollectionImplTest.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.dao; 2 | 3 | import java.text.ParseException; 4 | import java.util.Iterator; 5 | import java.util.List; 6 | 7 | import com.cognizant.truyum.model.MenuItem; 8 | import com.cognizant.truyum.util.DateUtil; 9 | 10 | public class MenuItemDaoCollectionImplTest { 11 | 12 | public static void testGetMenuItemListAdmin() throws ParseException { 13 | 14 | MenuItemDao menuItemDao = new MenuItemDaoCollectionImpl(); 15 | List menuItemList = menuItemDao.getMenuItemListAdmin(); 16 | 17 | for (Object o1 : menuItemList) { 18 | System.out.println(o1.toString()); 19 | 20 | } 21 | 22 | } 23 | 24 | public static void testGetMenuItemListCustomer() throws ParseException { 25 | 26 | MenuItemDao menuItemDao = new MenuItemDaoCollectionImpl(); 27 | List menuItemList = menuItemDao.getMenuItemListCustomer(); 28 | 29 | for (Object o1 : menuItemList) { 30 | System.out.println(o1.toString()); 31 | 32 | } 33 | 34 | } 35 | 36 | public static void main(String[] arg) throws ParseException 37 | 38 | { 39 | 40 | testGetMenuItemListAdmin(); 41 | 42 | testGetMenuItemListCustomer(); 43 | testModifyMenuItem(); 44 | 45 | } 46 | public static void testModifyMenuItem() throws ParseException 47 | { 48 | MenuItem ob=new MenuItem(1l, "Sandw", 99.00f, true, DateUtil.convertToDate("15/03/2017"), 49 | "Main Course", true); 50 | MenuItemDao menuItemDao=new MenuItemDaoCollectionImpl(); 51 | menuItemDao.modifyMenuItem(ob); 52 | System.out.println(menuItemDao.getMenuItem(1l)); 53 | } 54 | 55 | 56 | 57 | } -------------------------------------------------------------------------------- /basic-java-truyum/src/com/cognizant/truyum/model/Cart.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.model; 2 | 3 | import java.util.List; 4 | 5 | public class Cart { 6 | 7 | 8 | 9 | private static List menuItemList; 10 | private double total; 11 | public Cart(List menuItemList, double total) { 12 | super(); 13 | this.menuItemList = menuItemList; 14 | this.total = total; 15 | } 16 | @Override 17 | public String toString() { 18 | return "Cart [menuItemList=" + menuItemList + ", total=" + total + "]"; 19 | } 20 | public List getMenuItemList() { 21 | return menuItemList; 22 | } 23 | public void setMenuItemList(List menuItemList) { 24 | this.menuItemList = menuItemList; 25 | } 26 | public double getTotal() { 27 | return total; 28 | } 29 | public void setTotal(double total) { 30 | this.total = total; 31 | } 32 | 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /basic-java-truyum/src/com/cognizant/truyum/servlet/ShowEditMenuItemServlet.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.servlet; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.RequestDispatcher; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.annotation.WebServlet; 8 | import javax.servlet.http.HttpServlet; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | import com.cognizant.truyum.dao.MenuItemDao; 13 | import com.cognizant.truyum.dao.MenuItemDaoCollectionImpl; 14 | import com.cognizant.truyum.dao.MenuItemDaoSqlImpl; 15 | 16 | 17 | @WebServlet("/ShowEditMenuItem") 18 | public class ShowEditMenuItemServlet extends HttpServlet { 19 | 20 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 21 | 22 | 23 | MenuItemDao menuItemDao=new MenuItemDaoSqlImpl(); 24 | 25 | long l = Long.parseLong(request.getParameter("menuItemId")); 26 | request.setAttribute("menuItem",menuItemDao.getMenuItem(l)); 27 | RequestDispatcher rd=request.getRequestDispatcher("edit-menu-item.jsp"); 28 | rd.forward(request, response); 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /basic-java-truyum/src/com/cognizant/truyum/servlet/ShowMenuItemListAdminServlet.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.servlet; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.RequestDispatcher; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.annotation.WebServlet; 8 | import javax.servlet.http.HttpServlet; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | import com.cognizant.truyum.dao.MenuItemDao; 13 | import com.cognizant.truyum.dao.MenuItemDaoSqlImpl; 14 | 15 | 16 | 17 | @WebServlet("/ShowMenuItemListAdmin") 18 | public class ShowMenuItemListAdminServlet extends HttpServlet { 19 | 20 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 21 | 22 | MenuItemDao menuItemDao=new MenuItemDaoSqlImpl(); 23 | 24 | 25 | request.setAttribute("menuItemList",menuItemDao.getMenuItemListAdmin()); 26 | //System.out.println("inside showmenuadmin: "+menuItemDao.getMenuItemListAdmin()); 27 | RequestDispatcher rd=request.getRequestDispatcher("menu-item-list-admin.jsp"); 28 | rd.forward(request, response); 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /basic-java-truyum/src/com/cognizant/truyum/servlet/ShowMenuItemListCustomerServlet.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.servlet; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.RequestDispatcher; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.annotation.WebServlet; 8 | import javax.servlet.http.HttpServlet; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | import com.cognizant.truyum.dao.MenuItemDao; 13 | import com.cognizant.truyum.dao.MenuItemDaoSqlImpl; 14 | 15 | @WebServlet("/ShowMenuItemListCustomer") 16 | public class ShowMenuItemListCustomerServlet extends HttpServlet { 17 | 18 | public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 19 | 20 | MenuItemDao menuItemDao = new MenuItemDaoSqlImpl(); 21 | 22 | System.out.println(menuItemDao.getMenuItemListCustomer()); 23 | 24 | request.setAttribute("menuItemList", menuItemDao.getMenuItemListCustomer()); 25 | 26 | RequestDispatcher rd = request.getRequestDispatcher("menu-item-list-customer.jsp"); 27 | rd.forward(request, response); 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /basic-java-truyum/src/com/cognizant/truyum/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.util; 2 | 3 | import java.text.ParseException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | public class DateUtil { 8 | 9 | 10 | public static Date convertToDate(String date) 11 | 12 | { 13 | SimpleDateFormat f1=new SimpleDateFormat("dd/MM/yyyy"); 14 | Date d; 15 | try { 16 | d = f1.parse(date);return d; 17 | } catch (ParseException e) { 18 | // TODO Auto-generated catch block 19 | e.printStackTrace(); 20 | } 21 | 22 | return null; 23 | 24 | 25 | } 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /basic-java-truyum/src/connection.properties: -------------------------------------------------------------------------------- 1 | driver=com.mysql.jdbc.Driver 2 | connection-url=jdbc:mysql://localhost:3306/truyum 3 | user=root 4 | password=password-1 5 | 6 | -------------------------------------------------------------------------------- /final-check-v2/README.md: -------------------------------------------------------------------------------- 1 | Whole Full Stack project using Spring + Angular 2 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/README.md: -------------------------------------------------------------------------------- 1 | README -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/micro-services/authentication-service-moviecruiser/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/src/main/java/com/cognizant/moviecruiser/authenticationservicemoviecruiser/AuthenticationServiceMoviecruiserApplication.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.authenticationservicemoviecruiser; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @SpringBootApplication 8 | @EnableDiscoveryClient 9 | public class AuthenticationServiceMoviecruiserApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(AuthenticationServiceMoviecruiserApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/src/main/java/com/cognizant/moviecruiser/authenticationservicemoviecruiser/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.authenticationservicemoviecruiser; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | @Configuration 8 | public class WebConfig implements WebMvcConfigurer { 9 | 10 | @Override 11 | public void addCorsMappings(CorsRegistry registry) { 12 | registry.addMapping("/**").allowedMethods("*").allowedOrigins("http://localhost:4200"); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/src/main/java/com/cognizant/moviecruiser/authenticationservicemoviecruiser/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.authenticationservicemoviecruiser.controller; 2 | 3 | import javax.validation.Valid; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.security.provisioning.InMemoryUserDetailsManager; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import com.cognizant.moviecruiser.authenticationservicemoviecruiser.model.Users; 13 | import com.cognizant.moviecruiser.authenticationservicemoviecruiser.security.AppUserDetailsService; 14 | 15 | 16 | @RestController 17 | @RequestMapping("/users") 18 | public class UserController { 19 | 20 | @Autowired 21 | public AppUserDetailsService detailservice; 22 | 23 | @Autowired 24 | public InMemoryUserDetailsManager inMemoryUserDetailsManager; 25 | 26 | 27 | 28 | @PostMapping 29 | public boolean signup(@RequestBody @Valid Users user) 30 | { 31 | 32 | return detailservice.signup(user); 33 | 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/src/main/java/com/cognizant/moviecruiser/authenticationservicemoviecruiser/exception/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.authenticationservicemoviecruiser.exception; 2 | 3 | public class GlobalExceptionHandler { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/src/main/java/com/cognizant/moviecruiser/authenticationservicemoviecruiser/exception/UserAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.authenticationservicemoviecruiser.exception; 2 | 3 | public class UserAlreadyExistsException extends Exception { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/src/main/java/com/cognizant/moviecruiser/authenticationservicemoviecruiser/model/Role.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.authenticationservicemoviecruiser.model; 2 | 3 | 4 | import java.util.List; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.JoinTable; 11 | import javax.persistence.ManyToMany; 12 | import javax.persistence.Table; 13 | 14 | @Entity 15 | @Table(name="role") 16 | public class Role { 17 | @Id 18 | @Column(name="ro_id") 19 | private int id; 20 | @Column(name="ro_name") 21 | private String name; 22 | 23 | @ManyToMany 24 | @JoinTable(name = "user_role", 25 | joinColumns = @JoinColumn(name = "ur_ro_id"), 26 | inverseJoinColumns = @JoinColumn(name = "ur_us_id")) 27 | private List users; 28 | 29 | public List getUsers() { 30 | return users; 31 | } 32 | 33 | public void setUsers(List users) { 34 | this.users = users; 35 | } 36 | public int getId() { 37 | return id; 38 | } 39 | public void setId(int id) { 40 | this.id = id; 41 | } 42 | public String getName() { 43 | return name; 44 | } 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/src/main/java/com/cognizant/moviecruiser/authenticationservicemoviecruiser/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.authenticationservicemoviecruiser.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.cognizant.moviecruiser.authenticationservicemoviecruiser.model.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/src/main/java/com/cognizant/moviecruiser/authenticationservicemoviecruiser/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.authenticationservicemoviecruiser.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | 9 | import com.cognizant.moviecruiser.authenticationservicemoviecruiser.model.Users; 10 | import com.cognizant.moviecruiser.authenticationservicemoviecruiser.model.movie; 11 | 12 | public interface UserRepository extends JpaRepository{ 13 | 14 | public Users findByUsername(String username); 15 | 16 | 17 | @Query("SELECT u.movieItems from Users u WHERE u.username=?1") 18 | List getMovieItems(String username); 19 | 20 | // 21 | //@Query(value = "select sum(me_price) from movie_item where mo_id in(select fvt_mov_id from favorites where ct_us_id=(select us_id from user where us_username= :username))", nativeQuery = true) 22 | //public double getFavoritesTotal(@Param(value = "username") String username); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=2001 2 | spring.application.name=auth-service 3 | eureka.client.serviceUrl.defaultZone=http://localhost:2003/eureka 4 | # Spring Framework and application log 5 | logging.level.org.springframework=info 6 | logging.level.com.cognizant=debug 7 | 8 | # Hibernate logs for displaying executed SQL, input and output 9 | logging.level.org.hibernate.SQL=trace 10 | logging.level.org.hibernate.type.descriptor.sql=trace 11 | 12 | # Log pattern 13 | logging.pattern.console=%d{dd-MM-yy} %d{HH:mm:ss.SSS} %-20.20thread %5p %-25.25logger{25} %25M %4L %m%n 14 | 15 | # Database configuration 16 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 17 | spring.datasource.url=jdbc:mysql://localhost:3306/moviecruiser 18 | spring.datasource.username=root 19 | spring.datasource.password=password-1 20 | 21 | # Hibernate configuration 22 | spring.jpa.hibernate.ddl-auto=validate 23 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect 24 | 25 | spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true 26 | 27 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/authentication-service-moviecruiser/src/test/java/com/cognizant/moviecruiser/authenticationservicemoviecruiser/AuthenticationServiceMoviecruiserApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.authenticationservicemoviecruiser; 2 | 3 | import org.junit.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AuthenticationServiceMoviecruiserApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/eureka-discovery-server-moviecruiser/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/eureka-discovery-server-moviecruiser/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/micro-services/eureka-discovery-server-moviecruiser/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /final-check-v2/micro-services/eureka-discovery-server-moviecruiser/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/eureka-discovery-server-moviecruiser/src/main/java/com/cognizant/moviecruiser/eurekadiscoveryservermoviecruiser/EurekaDiscoveryServerMoviecruiserApplication.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.eurekadiscoveryservermoviecruiser; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaDiscoveryServerMoviecruiserApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(EurekaDiscoveryServerMoviecruiserApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/eureka-discovery-server-moviecruiser/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=2003 2 | eureka.client.register-with-eureka=false 3 | eureka.client.fetch-registry=false 4 | logging.level.com.netflix.eureka=OFF 5 | logging.level.com.netflix.discovery=OFF -------------------------------------------------------------------------------- /final-check-v2/micro-services/eureka-discovery-server-moviecruiser/src/test/java/com/cognizant/moviecruiser/eurekadiscoveryservermoviecruiser/EurekaDiscoveryServerMoviecruiserApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.eurekadiscoveryservermoviecruiser; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class EurekaDiscoveryServerMoviecruiserApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/micro-services/movie-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/src/main/java/com/cognizant/moviecruiser/movieservice/MovieServiceApplication.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.movieservice; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @SpringBootApplication 8 | @EnableDiscoveryClient 9 | public class MovieServiceApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(MovieServiceApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/src/main/java/com/cognizant/moviecruiser/movieservice/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.movieservice; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | @Configuration 8 | public class WebConfig implements WebMvcConfigurer { 9 | 10 | @Override 11 | public void addCorsMappings(CorsRegistry registry) { 12 | registry.addMapping("/**").allowedMethods("*").allowedOrigins("http://localhost:4200"); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/src/main/java/com/cognizant/moviecruiser/movieservice/exception/FavoritesEmptyException.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.movieservice.exception; 2 | 3 | public class FavoritesEmptyException extends Exception { 4 | 5 | public FavoritesEmptyException() 6 | { 7 | super("Favorites is Empty"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/src/main/java/com/cognizant/moviecruiser/movieservice/exception/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.movieservice.exception; 2 | 3 | public class GlobalExceptionHandler { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/src/main/java/com/cognizant/moviecruiser/movieservice/exception/UserAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.movieservice.exception; 2 | 3 | public class UserAlreadyExistsException extends Exception { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/src/main/java/com/cognizant/moviecruiser/movieservice/model/Role.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.movieservice.model; 2 | 3 | 4 | import java.util.List; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.JoinTable; 11 | import javax.persistence.ManyToMany; 12 | import javax.persistence.Table; 13 | 14 | @Entity 15 | @Table(name="role") 16 | public class Role { 17 | @Id 18 | @Column(name="ro_id") 19 | private int id; 20 | @Column(name="ro_name") 21 | private String name; 22 | 23 | @ManyToMany 24 | @JoinTable(name = "user_role", 25 | joinColumns = @JoinColumn(name = "ur_ro_id"), 26 | inverseJoinColumns = @JoinColumn(name = "ur_us_id")) 27 | private List users; 28 | 29 | public List getUsers() { 30 | return users; 31 | } 32 | 33 | public void setUsers(List users) { 34 | this.users = users; 35 | } 36 | public int getId() { 37 | return id; 38 | } 39 | public void setId(int id) { 40 | this.id = id; 41 | } 42 | public String getName() { 43 | return name; 44 | } 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/src/main/java/com/cognizant/moviecruiser/movieservice/model/favoritesDTO.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.movieservice.model; 2 | 3 | import java.util.List; 4 | 5 | 6 | 7 | public class favoritesDTO { 8 | 9 | 10 | 11 | private List movieList; 12 | 13 | private int nooffavorites; 14 | 15 | public List getMovieList() { 16 | return movieList; 17 | } 18 | 19 | public void setMovieList(List movieList) { 20 | this.movieList = movieList; 21 | } 22 | 23 | public int getNooffavorites() { 24 | return nooffavorites; 25 | } 26 | 27 | public void setNooffavorites(int nooffavorites) { 28 | this.nooffavorites = nooffavorites; 29 | } 30 | 31 | /** 32 | * @param movieList 33 | * @param nooffavorites 34 | */ 35 | public favoritesDTO(List movieList, int nooffavorites) { 36 | super(); 37 | this.movieList = movieList; 38 | this.nooffavorites = nooffavorites; 39 | } 40 | 41 | /** 42 | * 43 | */ 44 | public favoritesDTO() { 45 | super(); 46 | // TODO Auto-generated constructor stub 47 | } 48 | 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/src/main/java/com/cognizant/moviecruiser/movieservice/repository/MovieItemRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.movieservice.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | 8 | import com.cognizant.moviecruiser.movieservice.model.movie; 9 | 10 | public interface MovieItemRepository extends JpaRepository{ 11 | 12 | 13 | 14 | 15 | @Query("From movie m where m.active=1 and m.Date_of_Launch getMenuItemCustomer(); 17 | 18 | 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/src/main/java/com/cognizant/moviecruiser/movieservice/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.movieservice.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.cognizant.moviecruiser.movieservice.model.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/src/main/java/com/cognizant/moviecruiser/movieservice/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.movieservice.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | 9 | import com.cognizant.moviecruiser.movieservice.model.Users; 10 | import com.cognizant.moviecruiser.movieservice.model.movie; 11 | 12 | public interface UserRepository extends JpaRepository{ 13 | 14 | public Users findByUsername(String username); 15 | 16 | 17 | @Query("SELECT u.movieItems from Users u WHERE u.username=?1") 18 | List getMovieItems(String username); 19 | 20 | // 21 | //@Query(value = "select sum(me_price) from movie_item where mo_id in(select fvt_mov_id from favorites where ct_us_id=(select us_id from user where us_username= :username))", nativeQuery = true) 22 | //public double getFavoritesTotal(@Param(value = "username") String username); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=2002 2 | spring.application.name=movie-service 3 | eureka.client.serviceUrl.defaultZone=http://localhost:2003/eureka 4 | # Spring Framework and application log 5 | logging.level.org.springframework=info 6 | logging.level.com.cognizant=debug 7 | 8 | # Hibernate logs for displaying executed SQL, input and output 9 | logging.level.org.hibernate.SQL=trace 10 | logging.level.org.hibernate.type.descriptor.sql=trace 11 | 12 | # Log pattern 13 | logging.pattern.console=%d{dd-MM-yy} %d{HH:mm:ss.SSS} %-20.20thread %5p %-25.25logger{25} %25M %4L %m%n 14 | 15 | # Database configuration 16 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 17 | spring.datasource.url=jdbc:mysql://localhost:3306/moviecruiser 18 | spring.datasource.username=root 19 | spring.datasource.password=password-1 20 | 21 | # Hibernate configuration 22 | spring.jpa.hibernate.ddl-auto=validate 23 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect 24 | 25 | spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true 26 | 27 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/movie-service/src/test/java/com/cognizant/moviecruiser/movieservice/MovieServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.movieservice; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class MovieServiceApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/zuul-gateway-moviecruiser/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/zuul-gateway-moviecruiser/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/micro-services/zuul-gateway-moviecruiser/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /final-check-v2/micro-services/zuul-gateway-moviecruiser/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/zuul-gateway-moviecruiser/src/main/java/com/cognizant/moviecruiser/zuulgatewaymoviecruiser/SimpleFilter.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.zuulgatewaymoviecruiser; 2 | 3 | import com.netflix.zuul.ZuulFilter; 4 | import com.netflix.zuul.exception.ZuulException; 5 | 6 | public class SimpleFilter extends ZuulFilter { 7 | 8 | @Override 9 | public Object run() { 10 | // TODO Auto-generated method stub 11 | return null; 12 | } 13 | 14 | @Override 15 | public boolean shouldFilter() { 16 | // TODO Auto-generated method stub 17 | return true; 18 | } 19 | 20 | @Override 21 | public int filterOrder() { 22 | // TODO Auto-generated method stub 23 | return 1; 24 | } 25 | 26 | @Override 27 | public String filterType() { 28 | // TODO Auto-generated method stub 29 | return "pre"; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/zuul-gateway-moviecruiser/src/main/java/com/cognizant/moviecruiser/zuulgatewaymoviecruiser/ZuulGatewayMoviecruiserApplication.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.zuulgatewaymoviecruiser; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.zuul.EnableZuulProxy; 6 | 7 | @SpringBootApplication 8 | @EnableZuulProxy 9 | public class ZuulGatewayMoviecruiserApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(ZuulGatewayMoviecruiserApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /final-check-v2/micro-services/zuul-gateway-moviecruiser/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | zuul.routes.auth-service.url=http://localhost:2001 2 | zuul.routes.auth-service.sensitiveHeaders=Cookie,Set-Cookie 3 | zuul.routes.movie-service.url=http://localhost:2002 4 | zuul.routes.movie-service.sensitiveHeaders=Cookie,Set-Cookie 5 | ribbon.eureka.enabled=false 6 | server.port=2004 7 | spring.application.name=moviecruiser-zuul-service 8 | eureka.client.serviceUrl.defaultZone=http://localhost:2003/eureka -------------------------------------------------------------------------------- /final-check-v2/micro-services/zuul-gateway-moviecruiser/src/test/java/com/cognizant/moviecruiser/zuulgatewaymoviecruiser/ZuulGatewayMoviecruiserApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.zuulgatewaymoviecruiser; 2 | 3 | import org.junit.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ZuulGatewayMoviecruiserApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/README.md: -------------------------------------------------------------------------------- 1 | README -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | 33 | /.settings 34 | /build 35 | .classpath 36 | .project 37 | /bin/ 38 | /target/ 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/monolithic-services/moviecruiser/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/MoviecruiserApplication.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class MoviecruiserApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(MoviecruiserApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | @Configuration 8 | public class WebConfig implements WebMvcConfigurer { 9 | 10 | @Override 11 | public void addCorsMappings(CorsRegistry registry) { 12 | registry.addMapping("/**").allowedMethods("*").allowedOrigins("http://localhost:4200"); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.controller; 2 | 3 | import javax.validation.Valid; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.security.provisioning.InMemoryUserDetailsManager; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import com.cognizant.moviecruiser.model.Users; 13 | import com.cognizant.moviecruiser.security.AppUserDetailsService; 14 | 15 | 16 | @RestController 17 | @RequestMapping("/users") 18 | public class UserController { 19 | 20 | @Autowired 21 | public AppUserDetailsService detailservice; 22 | 23 | @Autowired 24 | public InMemoryUserDetailsManager inMemoryUserDetailsManager; 25 | 26 | 27 | 28 | @PostMapping 29 | public boolean signup(@RequestBody @Valid Users user) 30 | { 31 | 32 | return detailservice.signup(user); 33 | 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/dao/FavoritesDao.java: -------------------------------------------------------------------------------- 1 | //package com.cognizant.moviecruiser.dao; 2 | // 3 | //import com.cognizant.moviecruiser.model.favorites; 4 | // 5 | //public interface FavoritesDao { 6 | // 7 | // 8 | // 9 | // 10 | // public boolean addFavoritesItem(String userName, long menuItemId); 11 | // 12 | // public favorites getAllFavoritesItems(String userName); 13 | // 14 | // public void removeFavoritesItem(String userName, long movieItemId); 15 | // 16 | //} 17 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/dao/MovieDao.java: -------------------------------------------------------------------------------- 1 | //package com.cognizant.moviecruiser.dao; 2 | // 3 | //import java.util.List; 4 | // 5 | //import com.cognizant.moviecruiser.model.movie; 6 | // 7 | //public interface MovieDao { 8 | // 9 | // 10 | // 11 | // public List getMovieListAdmin(); 12 | // 13 | // public List getMovieListCustomer(); 14 | // public void modifyMovie( movie movie); 15 | // public movie getMovie( long movieId); 16 | // 17 | // 18 | // 19 | //} 20 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/exception/FavoritesEmptyException.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.exception; 2 | 3 | public class FavoritesEmptyException extends Exception { 4 | 5 | public FavoritesEmptyException() 6 | { 7 | super("Favorites is Empty"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/exception/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.exception; 2 | 3 | public class GlobalExceptionHandler { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/exception/UserAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.exception; 2 | 3 | public class UserAlreadyExistsException extends Exception { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/favoritesDTO.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser; 2 | 3 | import java.util.List; 4 | 5 | import com.cognizant.moviecruiser.model.movie; 6 | 7 | public class favoritesDTO { 8 | 9 | 10 | 11 | private List movieList; 12 | 13 | private int nooffavorites; 14 | 15 | public List getMovieList() { 16 | return movieList; 17 | } 18 | 19 | public void setMovieList(List movieList) { 20 | this.movieList = movieList; 21 | } 22 | 23 | public int getNooffavorites() { 24 | return nooffavorites; 25 | } 26 | 27 | public void setNooffavorites(int nooffavorites) { 28 | this.nooffavorites = nooffavorites; 29 | } 30 | 31 | /** 32 | * @param movieList 33 | * @param nooffavorites 34 | */ 35 | public favoritesDTO(List movieList, int nooffavorites) { 36 | super(); 37 | this.movieList = movieList; 38 | this.nooffavorites = nooffavorites; 39 | } 40 | 41 | /** 42 | * 43 | */ 44 | public favoritesDTO() { 45 | super(); 46 | // TODO Auto-generated constructor stub 47 | } 48 | 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/model/Role.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.model; 2 | 3 | 4 | import java.util.List; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.JoinTable; 11 | import javax.persistence.ManyToMany; 12 | import javax.persistence.Table; 13 | 14 | @Entity 15 | @Table(name="role") 16 | public class Role { 17 | @Id 18 | @Column(name="ro_id") 19 | private int id; 20 | @Column(name="ro_name") 21 | private String name; 22 | 23 | @ManyToMany 24 | @JoinTable(name = "user_role", 25 | joinColumns = @JoinColumn(name = "ur_ro_id"), 26 | inverseJoinColumns = @JoinColumn(name = "ur_us_id")) 27 | private List users; 28 | 29 | public List getUsers() { 30 | return users; 31 | } 32 | 33 | public void setUsers(List users) { 34 | this.users = users; 35 | } 36 | public int getId() { 37 | return id; 38 | } 39 | public void setId(int id) { 40 | this.id = id; 41 | } 42 | public String getName() { 43 | return name; 44 | } 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/model/favorites.java: -------------------------------------------------------------------------------- 1 | //package com.cognizant.moviecruiser.model; 2 | // 3 | //import java.util.List; 4 | // 5 | //public class favorites { 6 | // 7 | // 8 | // private List movieList; 9 | // 10 | // private int nooffavorites; 11 | // 12 | // public List getMovieList() { 13 | // return movieList; 14 | // } 15 | // 16 | // public void setMovieList(List movieList) { 17 | // this.movieList = movieList; 18 | // } 19 | // 20 | // public int getNooffavorites() { 21 | // return nooffavorites; 22 | // } 23 | // 24 | // public void setNooffavorites(int nooffavorites) { 25 | // this.nooffavorites = nooffavorites; 26 | // } 27 | // 28 | // @Override 29 | // public String toString() { 30 | // return "favorites [movieList=" + movieList + ", nooffavorites=" + nooffavorites + "]"; 31 | // } 32 | // 33 | // /** 34 | // * @param movieList 35 | // * @param nooffavorites 36 | // */ 37 | // public favorites(List movieList, int nooffavorites) { 38 | // this.movieList = movieList; 39 | // this.nooffavorites = nooffavorites; 40 | // } 41 | // 42 | // /** 43 | // * 44 | // */ 45 | // public favorites() { 46 | // super(); 47 | // // TODO Auto-generated constructor stub 48 | // } 49 | // 50 | // 51 | //} 52 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/repository/MovieItemRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | 8 | import com.cognizant.moviecruiser.model.movie; 9 | 10 | public interface MovieItemRepository extends JpaRepository{ 11 | 12 | 13 | 14 | 15 | @Query("From movie m where m.active=1 and m.Date_of_Launch getMenuItemCustomer(); 17 | 18 | 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.cognizant.moviecruiser.model.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/java/com/cognizant/moviecruiser/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | 9 | import com.cognizant.moviecruiser.model.Users; 10 | import com.cognizant.moviecruiser.model.movie; 11 | 12 | public interface UserRepository extends JpaRepository{ 13 | 14 | public Users findByUsername(String username); 15 | 16 | 17 | @Query("SELECT u.movieItems from Users u WHERE u.username=?1") 18 | List getMovieItems(String username); 19 | 20 | // 21 | //@Query(value = "select sum(me_price) from movie_item where mo_id in(select fvt_mov_id from favorites where ct_us_id=(select us_id from user where us_username= :username))", nativeQuery = true) 22 | //public double getFavoritesTotal(@Param(value = "username") String username); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | server.port=7777 3 | 4 | 5 | # Spring Framework and application log 6 | logging.level.org.springframework=info 7 | logging.level.com.cognizant=debug 8 | 9 | # Hibernate logs for displaying executed SQL, input and output 10 | logging.level.org.hibernate.SQL=trace 11 | logging.level.org.hibernate.type.descriptor.sql=trace 12 | 13 | # Log pattern 14 | logging.pattern.console=%d{dd-MM-yy} %d{HH:mm:ss.SSS} %-20.20thread %5p %-25.25logger{25} %25M %4L %m%n 15 | 16 | # Database configuration 17 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 18 | spring.datasource.url=jdbc:mysql://localhost:3306/moviecruiser 19 | spring.datasource.username=root 20 | spring.datasource.password=password-1 21 | 22 | # Hibernate configuration 23 | spring.jpa.hibernate.ddl-auto=validate 24 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect 25 | 26 | spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true 27 | -------------------------------------------------------------------------------- /final-check-v2/monolithic-services/moviecruiser/src/test/java/com/cognizant/moviecruiser/MoviecruiserApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.moviecruiser; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class MoviecruiserApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /final-check-v2/ui-design/README.md: -------------------------------------------------------------------------------- 1 | README -------------------------------------------------------------------------------- /final-check-v2/webapp/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /final-check-v2/webapp/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /final-check-v2/webapp/README.md: -------------------------------------------------------------------------------- 1 | # Webapp 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.0.2. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /final-check-v2/webapp/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /final-check-v2/webapp/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to webapp!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /final-check-v2/webapp/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /final-check-v2/webapp/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /final-check-v2/webapp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webapp", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~7.0.0", 15 | "@angular/common": "~7.0.0", 16 | "@angular/compiler": "~7.0.0", 17 | "@angular/core": "~7.0.0", 18 | "@angular/forms": "~7.0.0", 19 | "@angular/http": "~7.0.0", 20 | "@angular/platform-browser": "~7.0.0", 21 | "@angular/platform-browser-dynamic": "~7.0.0", 22 | "@angular/router": "~7.0.0", 23 | "core-js": "^2.5.4", 24 | "rxjs": "~6.3.3", 25 | "zone.js": "~0.8.26" 26 | }, 27 | "devDependencies": { 28 | "@angular-devkit/build-angular": "~0.10.0", 29 | "@angular/cli": "~7.0.2", 30 | "@angular/compiler-cli": "~7.0.0", 31 | "@angular/language-service": "~7.0.0", 32 | "@types/node": "~8.9.4", 33 | "@types/jasmine": "~2.8.8", 34 | "@types/jasminewd2": "~2.0.3", 35 | "codelyzer": "~4.5.0", 36 | "jasmine-core": "~2.99.1", 37 | "jasmine-spec-reporter": "~4.2.1", 38 | "karma": "~3.0.0", 39 | "karma-chrome-launcher": "~2.2.0", 40 | "karma-coverage-istanbul-reporter": "~2.0.1", 41 | "karma-jasmine": "~1.1.2", 42 | "karma-jasmine-html-reporter": "^0.2.2", 43 | "protractor": "~5.4.0", 44 | "ts-node": "~7.0.0", 45 | "tslint": "~5.11.0", 46 | "typescript": "~3.1.1" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/Booking/favorites.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { FavoritesService} from './favorites.service'; 4 | 5 | describe('FavoritesService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: FavoritesService = TestBed.get(FavoritesService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/Booking/favorites.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, Output, EventEmitter } from '@angular/core'; 2 | import {favorites } from './favorites/favorites'; 3 | import { MovieService } from '../food/movie.service'; 4 | 5 | 6 | 7 | 8 | 9 | @Injectable({ 10 | providedIn: 'root' 11 | }) 12 | export class FavoritesService { 13 | 14 | 15 | @Output() cartUpdated = new EventEmitter(); 16 | 17 | favoritesempty:boolean=true; 18 | favoritesstatus:boolean; 19 | 20 | favorites1:favorites={movieList:[],total:0}; 21 | 22 | constructor(private movieservice:MovieService) { } 23 | 24 | getAllFavorites() 25 | { 26 | this.movieservice.getAllFavoritesItems().subscribe(data=>{ 27 | 28 | 29 | this.favorites1=data; 30 | if(this.favorites1.movieList.length==0) 31 | { 32 | this.favoritesempty=true; 33 | this.favoritesstatus=true; 34 | } 35 | else{ 36 | 37 | this.favoritesempty=false; 38 | this.favoritesstatus=false; 39 | } 40 | }) 41 | 42 | 43 | } 44 | 45 | getTotal() 46 | { 47 | this.favorites1.total=0; 48 | for(let i=0;i 5 |

Favorites

6 |
Favorite Item deleted Succesfully
7 |
No Items in the Favorites.Use 'Add to Favorites Option' in the Movie item list
8 | 9 |
10 |
    11 |
  • 12 |
    13 | {{iterate.title}} 14 | 15 | 16 | 17 |
    18 | 19 |

    20 | delete_forever 21 |

    22 | 23 |
  • 24 | 25 | 26 |
  • 27 |
    28 | No of Favorites{{this.favoritesservice.favorites1.movieList.length }} 29 | 30 |
    31 |
  • 32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/Booking/favorites/favorites.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FavoritesComponent } from './favorites.component'; 4 | 5 | describe('FavoritesComponent', () => { 6 | let component: FavoritesComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FavoritesComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FavoritesComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/Booking/favorites/favorites.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit} from '@angular/core'; 2 | 3 | import { favorites } from './favorites'; 4 | import { MovieService } from 'src/app/food/movie.service'; 5 | import { FavoritesService } from '../favorites.service'; 6 | 7 | @Component({ 8 | selector: 'app-shopping-favorites', 9 | templateUrl: './favorites.component.html', 10 | styleUrls: ['./favorites.component.css'] 11 | }) 12 | export class FavoritesComponent implements OnInit { 13 | 14 | 15 | 16 | favorites:favorites; 17 | 18 | stat:boolean; 19 | empty:boolean; 20 | 21 | constructor(private favoritesservice:FavoritesService,private _movieservice:MovieService) { } 22 | 23 | ngOnInit() { 24 | 25 | 26 | this.favoritesservice.getAllFavorites(); 27 | 28 | // this.favoritesservice.favorites1.total=this.favoritesservice.favorites1.movie.length; 29 | 30 | 31 | 32 | this.empty=this.favoritesservice.favoritesempty; 33 | } 34 | 35 | 36 | 37 | removeFromFavorites(favoritesId) 38 | { 39 | 40 | this._movieservice.deleteFavoritesItem(favoritesId).subscribe(data=>{this.favoritesservice.getAllFavorites();}) 41 | 42 | 43 | //added here 44 | 45 | this.empty=this.favoritesservice.favoritesempty; 46 | this.stat=this.favoritesservice.favoritesstatus; 47 | 48 | console.log(this.stat) 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/Booking/favorites/favorites.ts: -------------------------------------------------------------------------------- 1 | import { movie } from "src/app/movie"; 2 | 3 | 4 | export interface favorites 5 | { 6 | 7 | movieList:movie[]; 8 | // name:string,price:number; 9 | total:number; 10 | } -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { ItemEditComponent } from './food/item-edit/item-edit.component'; 4 | import { AuthGuardServiceService } from './auth-guard-service.service'; 5 | import { SignupComponent } from './site/signup/signup.component'; 6 | import { FavoritesComponent } from './Booking/favorites/favorites.component'; 7 | import { LoginComponent } from './site/login/login.component'; 8 | import { SearchComponent } from './food/search/search.component'; 9 | 10 | const routes: Routes = [ 11 | { path: '', redirectTo: 'search-bar', pathMatch: 'full'}, 12 | { path: 'edit-food-item/:id', component: ItemEditComponent, canActivate: [AuthGuardServiceService]}, 13 | { path: 'signup', component: SignupComponent}, 14 | { path: 'favorites', component: FavoritesComponent, canActivate: [AuthGuardServiceService]}, 15 | { path: 'login',component: LoginComponent}, 16 | { path: 'search-bar',component: SearchComponent}]; 17 | 18 | @NgModule({ 19 | imports: [RouterModule.forRoot(routes 20 | )], 21 | exports: [RouterModule] 22 | }) 23 | export class AppRoutingModule { } 24 | // { enableTracing: true } -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/webapp/src/app/app.component.css -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | })); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.debugElement.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'webapp'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.debugElement.componentInstance; 26 | expect(app.title).toEqual('webapp'); 27 | }); 28 | 29 | it('should render title in a h1 tag', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.debugElement.nativeElement; 33 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to webapp!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { AuthServiceService } from './site/auth-service.service'; 3 | import { Router } from '@angular/router'; 4 | import { MovieService } from './food/movie.service'; 5 | 6 | @Component({ 7 | selector: 'app-root', 8 | templateUrl: './app.component.html', 9 | styleUrls: ['./app.component.css'] 10 | }) 11 | export class AppComponent implements OnInit { 12 | 13 | ngOnInit(): void { 14 | this.loggedIn(); 15 | this.router.navigate(['search-bar']); 16 | } 17 | constructor(private authService:AuthServiceService,public router: Router,private MovieService:MovieService) { 18 | } 19 | title = 'truYum'; 20 | isLoggedIn:boolean = false; 21 | 22 | 23 | loggedIn():boolean { 24 | if(!this.authService.loggedInUser.loggedOut){ 25 | this.isLoggedIn = true; 26 | return true 27 | } 28 | else{ 29 | this.isLoggedIn = false; 30 | return false; 31 | } 32 | } 33 | clickOnAddFavorites(){ 34 | this.MovieService.clickedOnAdd = false; 35 | this.MovieService.addedToFav = false; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/auth-guard-service.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthGuardServiceService } from './auth-guard-service.service'; 4 | 5 | describe('AuthGuardServiceService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: AuthGuardServiceService = TestBed.get(AuthGuardServiceService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/auth-guard-service.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; 3 | import { AuthServiceService } from './site/auth-service.service'; 4 | import { Observable, Observer } from 'rxjs'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class AuthGuardServiceService implements CanActivate { 10 | 11 | constructor(private authService: AuthServiceService, private router: Router) { } 12 | 13 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean { 14 | // retain the url that is requested for authorization 15 | this.authService.redirectUrl = state.url; 16 | 17 | console.log('URL', state.url); 18 | 19 | return Observable.create((observer: Observer) => { 20 | if (this.authService.loggedIn) { 21 | console.log('Logged in'); 22 | observer.next(true); 23 | } else { 24 | console.log('Not Logged in'); 25 | this.router.navigate(['login'], { queryParams: { from: state.url.substr(1) } }); 26 | } 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/item-edit/item-edit.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/webapp/src/app/food/item-edit/item-edit.component.css -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/item-edit/item-edit.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ItemEditComponent } from './item-edit.component'; 4 | 5 | describe('ItemEditComponent', () => { 6 | let component: ItemEditComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ItemEditComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ItemEditComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/item-info/item-info.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/webapp/src/app/food/item-info/item-info.component.css -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/item-info/item-info.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ItemInfoComponent } from './item-info.component'; 4 | 5 | describe('ItemInfoComponent', () => { 6 | let component: ItemInfoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ItemInfoComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ItemInfoComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/item-info/item-info.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, Output, EventEmitter } from '@angular/core'; 2 | 3 | import { MovieService } from '../movie.service'; 4 | import { movie } from 'src/app/movie'; 5 | import { AuthServiceService } from 'src/app/site/auth-service.service'; 6 | 7 | 8 | 9 | @Component({ 10 | selector: 'app-item-info', 11 | templateUrl: './item-info.component.html', 12 | styleUrls: ['./item-info.component.css'] 13 | }) 14 | export class ItemInfoComponent { 15 | 16 | @Input() movieitem1:movie; 17 | 18 | @Output() addToFavoritesClicked:EventEmitter =new EventEmitter(); 19 | 20 | 21 | isAdmin:boolean; 22 | favAddedId:number; 23 | constructor(private _movieService: MovieService,private authservice:AuthServiceService){} 24 | ngOnInit() 25 | { 26 | 27 | 28 | this.isAdmin=this.authservice.isAdmin; 29 | 30 | 31 | 32 | 33 | 34 | } 35 | 36 | 37 | 38 | displayAddToCart(id:number) { 39 | this.favAddedId = id; 40 | console.log(this.favAddedId) 41 | } 42 | 43 | onAddToFavorites(itemId:number) 44 | { 45 | 46 | this.addToFavoritesClicked.emit(itemId); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/menu/menu.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/webapp/src/app/food/menu/menu.component.css -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/menu/menu.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
-------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/menu/menu.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MenuComponent } from './menu.component'; 4 | 5 | describe('MenuComponent', () => { 6 | let component: MenuComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ MenuComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MenuComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/menu/menu.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, EventEmitter } from '@angular/core'; 2 | 3 | 4 | import { MovieService } from '../movie.service'; 5 | 6 | import { movie } from 'src/app/movie'; 7 | import { AuthServiceService } from 'src/app/site/auth-service.service'; 8 | 9 | 10 | @Component({ 11 | selector: 'app-menu', 12 | templateUrl: './menu.component.html', 13 | styleUrls: ['./menu.component.css'] 14 | }) 15 | export class MenuComponent implements OnInit { 16 | 17 | 18 | @Input() 19 | movie:movie[]; 20 | 21 | addToFavoritesClicked =new EventEmitter(); 22 | 23 | isAdmin:boolean; 24 | constructor(private _movieService: MovieService,private authservice:AuthServiceService){} 25 | 26 | addedToFav:boolean; 27 | 28 | 29 | ngOnInit() 30 | { 31 | 32 | 33 | 34 | this._movieService.getAllMovies().subscribe(data =>this.movie=data); 35 | 36 | this._movieService.getSubject().subscribe((data) =>(this.movie=this._movieService.getItem(data))); 37 | 38 | 39 | 40 | this.authservice.addedToFav=false; 41 | 42 | 43 | } 44 | 45 | 46 | } -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/movie.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { MovieService } from './movie.service'; 4 | 5 | describe('FoodService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: MovieService = TestBed.get(MovieService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/search/search.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/webapp/src/app/food/search/search.component.css -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/search/search.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

Find Movie

5 |
6 | 7 |
8 | 9 | movie_creation 11 |
12 | 13 | 15 | 18 |
19 | 20 |
21 | 22 |
23 | 24 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/search/search.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SearchComponent } from './search.component'; 4 | 5 | describe('SearchComponent', () => { 6 | let component: SearchComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SearchComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SearchComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/food/search/search.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { MovieService } from '../movie.service'; 4 | import { movie } from 'src/app/movie'; 5 | 6 | 7 | @Component({ 8 | selector: 'app-search', 9 | templateUrl: './search.component.html', 10 | styleUrls: ['./search.component.css'] 11 | }) 12 | export class SearchComponent implements OnInit { 13 | 14 | constructor(private _foodservice:MovieService) { } 15 | filterlist:movie[]; 16 | 17 | //mov:movie[]; 18 | ngOnInit() { 19 | 20 | this._foodservice.getAllMovies().subscribe(data => this._foodservice.movie=data) 21 | console.log("updating") 22 | } 23 | search(event:any) 24 | { 25 | 26 | 27 | this._foodservice.getSubject().next(event.target.value) 28 | 29 | } 30 | 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/movie.ts: -------------------------------------------------------------------------------- 1 | export interface movie 2 | { 3 | 4 | id:number,title:string,box_office:number,active:boolean,date_of_Launch: Date,genre:string,has_teaser:boolean,image:string; 5 | 6 | } -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/site/auth-service.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthServiceService } from './auth-service.service'; 4 | 5 | describe('AuthServiceService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: AuthServiceService = TestBed.get(AuthServiceService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/site/login/login.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/webapp/src/app/site/login/login.component.css -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/site/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ LoginComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LoginComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/site/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormGroup, FormBuilder, Validators } from '@angular/forms'; 3 | import { AuthServiceService } from '../auth-service.service'; 4 | import { Router } from '@angular/router'; 5 | import { MovieService } from 'src/app/food/movie.service'; 6 | 7 | @Component({ 8 | selector: 'app-login', 9 | templateUrl: './login.component.html', 10 | styleUrls: ['./login.component.css'] 11 | }) 12 | export class LoginComponent implements OnInit { 13 | loginForm:FormGroup 14 | 15 | constructor(private formBuild:FormBuilder,private authService:AuthServiceService,private router:Router,private foodService:MovieService) { } 16 | 17 | ngOnInit() { 18 | this.loginForm = this.formBuild.group({ 19 | username: ['',[ 20 | Validators.required 21 | ]], 22 | password: ['',[ 23 | Validators.required 24 | ]] 25 | }) 26 | } 27 | get username(){ 28 | return this.loginForm.get('username'); 29 | } 30 | get password(){ 31 | return this.loginForm.get('password'); 32 | } 33 | toSignup() { 34 | this.router.navigate(['signup']) 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/site/signup/User.ts: -------------------------------------------------------------------------------- 1 | export interface User 2 | { 3 | 4 | 5 | firstname:string, 6 | lastname:string, 7 | username:string, 8 | password:string 9 | } -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/site/signup/signup.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/webapp/src/app/site/signup/signup.component.css -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/site/signup/signup.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SignupComponent } from './signup.component'; 4 | 5 | describe('SignupComponent', () => { 6 | let component: SignupComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SignupComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SignupComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/site/user-service.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { UserServiceService } from './user-service.service'; 4 | 5 | describe('UserServiceService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: UserServiceService = TestBed.get(UserServiceService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/app/site/user-service.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { HttpClient } from '@Angular/common/http'; 4 | import { User } from './signup/User'; 5 | import { Observable } from 'rxjs'; 6 | import { environment } from 'src/environments/environment'; 7 | 8 | @Injectable({ 9 | providedIn: 'root' 10 | }) 11 | export class UserServiceService { 12 | 13 | 14 | constructor(private router:Router,private http:HttpClient) { } 15 | userExists:boolean=true; 16 | addUser(user:any) { 17 | 18 | let NewUsers:User={firstname:user["firstname"],lastname:user["lastname"],username:user["username"],password:user["password"]} 19 | 20 | this.addUsers(NewUsers).subscribe(data=> 21 | { 22 | 23 | this.userExists=data; 24 | 25 | if(data) 26 | { 27 | this.router.navigate(['login']); 28 | } 29 | }, 30 | (error)=>{console.log(error);} 31 | ) 32 | 33 | } 34 | addUsers(user:User):Observable 35 | { 36 | 37 | return this.http.post(environment.baseUrl+"auth-service/users",user) 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/webapp/src/assets/.gitkeep -------------------------------------------------------------------------------- /final-check-v2/webapp/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /final-check-v2/webapp/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | baseUrl: 'http://localhost:4200/' 4 | 5 | }; 6 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | baseUrl: 'http://localhost:2004/' 8 | 9 | }; 10 | 11 | /* 12 | * For easier debugging in development mode, you can import the following file 13 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 14 | * 15 | * This import should be commented out in production mode because it will have a negative impact 16 | * on performance if an error is thrown. 17 | */ 18 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 19 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/final-check-v2/webapp/src/favicon.ico -------------------------------------------------------------------------------- /final-check-v2/webapp/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Webapp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /final-check-v2/webapp/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /final-check-v2/webapp/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /final-check-v2/webapp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "target": "es5", 13 | "typeRoots": [ 14 | "node_modules/@types" 15 | ], 16 | "lib": [ 17 | "es2018", 18 | "dom" 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /truyum-v2/README.md: -------------------------------------------------------------------------------- 1 | Whole Full Stack project using Spring + Angular 2 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/README.md: -------------------------------------------------------------------------------- 1 | README -------------------------------------------------------------------------------- /truyum-v2/micro-services/authentication-service/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/authentication-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/micro-services/authentication-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /truyum-v2/micro-services/authentication-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/authentication-service/src/main/java/com/cognizant/truyum/authenticationservice/AuthenticationServiceApplication.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.authenticationservice; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @SpringBootApplication 8 | @EnableDiscoveryClient 9 | public class AuthenticationServiceApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(AuthenticationServiceApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/authentication-service/src/main/java/com/cognizant/truyum/authenticationservice/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.authenticationservice; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | @Configuration 8 | public class WebConfig implements WebMvcConfigurer { 9 | 10 | @Override 11 | public void addCorsMappings(CorsRegistry registry) { 12 | registry.addMapping("/**").allowedMethods("*").allowedOrigins("http://localhost:4200"); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /truyum-v2/micro-services/authentication-service/src/main/java/com/cognizant/truyum/authenticationservice/exception/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.authenticationservice.exception; 2 | 3 | public class GlobalExceptionHandler { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/authentication-service/src/main/java/com/cognizant/truyum/authenticationservice/exception/UserAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.authenticationservice.exception; 2 | 3 | public class UserAlreadyExistsException extends Exception { 4 | 5 | 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/authentication-service/src/main/java/com/cognizant/truyum/authenticationservice/model/Role.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.authenticationservice.model; 2 | 3 | 4 | import java.util.List; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.JoinTable; 11 | import javax.persistence.ManyToMany; 12 | import javax.persistence.Table; 13 | 14 | @Entity 15 | @Table(name="role") 16 | public class Role { 17 | @Id 18 | @Column(name="ro_id") 19 | private int id; 20 | @Column(name="ro_name") 21 | private String name; 22 | 23 | @ManyToMany 24 | @JoinTable(name = "user_role", 25 | joinColumns = @JoinColumn(name = "ur_ro_id"), 26 | inverseJoinColumns = @JoinColumn(name = "ur_us_id")) 27 | private List users; 28 | 29 | public List getUsers() { 30 | return users; 31 | } 32 | 33 | public void setUsers(List users) { 34 | this.users = users; 35 | } 36 | public int getId() { 37 | return id; 38 | } 39 | public void setId(int id) { 40 | this.id = id; 41 | } 42 | public String getName() { 43 | return name; 44 | } 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /truyum-v2/micro-services/authentication-service/src/main/java/com/cognizant/truyum/authenticationservice/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.authenticationservice.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.cognizant.truyum.authenticationservice.model.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/authentication-service/src/main/java/com/cognizant/truyum/authenticationservice/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.authenticationservice.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | 9 | import com.cognizant.truyum.authenticationservice.model.MenuItem; 10 | import com.cognizant.truyum.authenticationservice.model.Users; 11 | 12 | public interface UserRepository extends JpaRepository{ 13 | 14 | public Users findByUsername(String username); 15 | 16 | 17 | @Query("SELECT u.menuItems from Users u WHERE u.username=?1") 18 | List getMenuItems(String username); 19 | 20 | 21 | @Query(value = "select sum(me_price) from menu_item where me_id in(select ct_pr_id from cart where ct_us_id=(select us_id from user where us_username= :username))", nativeQuery = true) 22 | public double getCartTotal(@Param(value = "username") String username); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/authentication-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=1001 2 | spring.application.name=auth-service 3 | eureka.client.serviceUrl.defaultZone=http://localhost:1003/eureka 4 | # Spring Framework and application log 5 | logging.level.org.springframework=info 6 | logging.level.com.cognizant=debug 7 | 8 | # Hibernate logs for displaying executed SQL, input and output 9 | logging.level.org.hibernate.SQL=trace 10 | logging.level.org.hibernate.type.descriptor.sql=trace 11 | 12 | # Log pattern 13 | logging.pattern.console=%d{dd-MM-yy} %d{HH:mm:ss.SSS} %-20.20thread %5p %-25.25logger{25} %25M %4L %m%n 14 | 15 | # Database configuration 16 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 17 | spring.datasource.url=jdbc:mysql://localhost:3306/truyum 18 | spring.datasource.username=root 19 | spring.datasource.password=password-1 20 | 21 | # Hibernate configuration 22 | spring.jpa.hibernate.ddl-auto=validate 23 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect 24 | 25 | spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true 26 | 27 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/authentication-service/src/test/java/com/cognizant/truyum/authenticationservice/AuthenticationServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.authenticationservice; 2 | 3 | import org.junit.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AuthenticationServiceApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/eureka-discovery-server-truyum/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/eureka-discovery-server-truyum/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/micro-services/eureka-discovery-server-truyum/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /truyum-v2/micro-services/eureka-discovery-server-truyum/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/eureka-discovery-server-truyum/src/main/java/com/cognizant/truyum/eurekadiscoveryservertruyum/EurekaDiscoveryServerTruyumApplication.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.eurekadiscoveryservertruyum; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaDiscoveryServerTruyumApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(EurekaDiscoveryServerTruyumApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/eureka-discovery-server-truyum/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=1003 2 | eureka.client.register-with-eureka=false 3 | eureka.client.fetch-registry=false 4 | logging.level.com.netflix.eureka=OFF 5 | logging.level.com.netflix.discovery=OFF 6 | 7 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/eureka-discovery-server-truyum/src/test/java/com/cognizant/truyum/eurekadiscoveryservertruyum/EurekaDiscoveryServerTruyumApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.eurekadiscoveryservertruyum; 2 | 3 | import org.junit.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class EurekaDiscoveryServerTruyumApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/micro-services/menuitem-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/src/main/java/com/cognizant/truyum/menuitemservice/MenuitemServiceApplication.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.menuitemservice; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @SpringBootApplication 8 | @EnableDiscoveryClient 9 | public class MenuitemServiceApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(MenuitemServiceApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/src/main/java/com/cognizant/truyum/menuitemservice/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.menuitemservice; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | @Configuration 8 | public class WebConfig implements WebMvcConfigurer { 9 | 10 | @Override 11 | public void addCorsMappings(CorsRegistry registry) { 12 | registry.addMapping("/**").allowedMethods("*").allowedOrigins("http://localhost:4200"); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/src/main/java/com/cognizant/truyum/menuitemservice/exception/CartEmptyException.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.menuitemservice.exception; 2 | 3 | public class CartEmptyException extends Exception { 4 | 5 | 6 | 7 | public CartEmptyException() 8 | { 9 | super("Cart is Empty"); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/src/main/java/com/cognizant/truyum/menuitemservice/exception/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.menuitemservice.exception; 2 | 3 | public class GlobalExceptionHandler { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/src/main/java/com/cognizant/truyum/menuitemservice/exception/UserAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.menuitemservice.exception; 2 | 3 | public class UserAlreadyExistsException extends Exception { 4 | 5 | 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/src/main/java/com/cognizant/truyum/menuitemservice/model/Role.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.menuitemservice.model; 2 | 3 | 4 | import java.util.List; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.JoinTable; 11 | import javax.persistence.ManyToMany; 12 | import javax.persistence.Table; 13 | 14 | @Entity 15 | @Table(name="role") 16 | public class Role { 17 | @Id 18 | @Column(name="ro_id") 19 | private int id; 20 | @Column(name="ro_name") 21 | private String name; 22 | 23 | @ManyToMany 24 | @JoinTable(name = "user_role", 25 | joinColumns = @JoinColumn(name = "ur_ro_id"), 26 | inverseJoinColumns = @JoinColumn(name = "ur_us_id")) 27 | private List users; 28 | 29 | public List getUsers() { 30 | return users; 31 | } 32 | 33 | public void setUsers(List users) { 34 | this.users = users; 35 | } 36 | public int getId() { 37 | return id; 38 | } 39 | public void setId(int id) { 40 | this.id = id; 41 | } 42 | public String getName() { 43 | return name; 44 | } 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/src/main/java/com/cognizant/truyum/menuitemservice/repository/MenuItemRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.menuitemservice.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | 8 | import com.cognizant.truyum.menuitemservice.model.MenuItem; 9 | 10 | 11 | public interface MenuItemRepository extends JpaRepository{ 12 | 13 | 14 | 15 | 16 | @Query("From MenuItem m where m.active=1 and m.Date_of_Launch getMenuItemCustomer(); 18 | 19 | 20 | // @Query("From MenuItem m where me_id=?1") 21 | // public MenuItem getMenuItem(long menuItemId); 22 | // 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/src/main/java/com/cognizant/truyum/menuitemservice/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.menuitemservice.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.cognizant.truyum.menuitemservice.model.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/src/main/java/com/cognizant/truyum/menuitemservice/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.menuitemservice.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | 9 | import com.cognizant.truyum.menuitemservice.model.MenuItem; 10 | import com.cognizant.truyum.menuitemservice.model.Users; 11 | 12 | public interface UserRepository extends JpaRepository{ 13 | 14 | public Users findByUsername(String username); 15 | 16 | 17 | @Query("SELECT u.menuItems from Users u WHERE u.username=?1") 18 | List getMenuItems(String username); 19 | 20 | 21 | @Query(value = "select sum(me_price) from menu_item where me_id in(select ct_pr_id from cart where ct_us_id=(select us_id from user where us_username= :username))", nativeQuery = true) 22 | public double getCartTotal(@Param(value = "username") String username); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=1002 2 | spring.application.name=menu-service 3 | eureka.client.serviceUrl.defaultZone=http://localhost:1003/eureka 4 | # Spring Framework and application log 5 | logging.level.org.springframework=info 6 | logging.level.com.cognizant=debug 7 | 8 | # Hibernate logs for displaying executed SQL, input and output 9 | logging.level.org.hibernate.SQL=trace 10 | logging.level.org.hibernate.type.descriptor.sql=trace 11 | 12 | # Log pattern 13 | logging.pattern.console=%d{dd-MM-yy} %d{HH:mm:ss.SSS} %-20.20thread %5p %-25.25logger{25} %25M %4L %m%n 14 | 15 | # Database configuration 16 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 17 | spring.datasource.url=jdbc:mysql://localhost:3306/truyum 18 | spring.datasource.username=root 19 | spring.datasource.password=password-1 20 | 21 | # Hibernate configuration 22 | spring.jpa.hibernate.ddl-auto=validate 23 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect 24 | 25 | spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true 26 | 27 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/menuitem-service/src/test/java/com/cognizant/truyum/menuitemservice/MenuitemServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.menuitemservice; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class MenuitemServiceApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/zuul-gateway-truyum/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/zuul-gateway-truyum/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/micro-services/zuul-gateway-truyum/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /truyum-v2/micro-services/zuul-gateway-truyum/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/zuul-gateway-truyum/src/main/java/com/cognizant/truyum/zuulgatewaytruyum/SimpleFilter.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.zuulgatewaytruyum; 2 | 3 | import com.netflix.zuul.ZuulFilter; 4 | import com.netflix.zuul.exception.ZuulException; 5 | 6 | public class SimpleFilter extends ZuulFilter { 7 | 8 | @Override 9 | public Object run() { 10 | // TODO Auto-generated method stub 11 | return null; 12 | } 13 | 14 | @Override 15 | public boolean shouldFilter() { 16 | // TODO Auto-generated method stub 17 | return true; 18 | } 19 | 20 | @Override 21 | public int filterOrder() { 22 | // TODO Auto-generated method stub 23 | return 1; 24 | } 25 | 26 | @Override 27 | public String filterType() { 28 | // TODO Auto-generated method stub 29 | return "pre"; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/zuul-gateway-truyum/src/main/java/com/cognizant/truyum/zuulgatewaytruyum/ZuulGatewayTruyumApplication.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.zuulgatewaytruyum; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.zuul.EnableZuulProxy; 6 | 7 | @SpringBootApplication 8 | @EnableZuulProxy 9 | public class ZuulGatewayTruyumApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(ZuulGatewayTruyumApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /truyum-v2/micro-services/zuul-gateway-truyum/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | zuul.routes.auth-service.url=http://localhost:1001 2 | zuul.routes.auth-service.sensitiveHeaders=Cookie,Set-Cookie 3 | zuul.routes.menu-service.url=http://localhost:1002 4 | zuul.routes.menu-service.sensitiveHeaders=Cookie,Set-Cookie 5 | ribbon.eureka.enabled=false 6 | server.port=1004 7 | spring.application.name=truyum-zuul-service 8 | eureka.client.serviceUrl.defaultZone=http://localhost:1003/eureka -------------------------------------------------------------------------------- /truyum-v2/micro-services/zuul-gateway-truyum/src/test/java/com/cognizant/truyum/zuulgatewaytruyum/ZuulGatewayTruyumApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.zuulgatewaytruyum; 2 | 3 | import org.junit.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ZuulGatewayTruyumApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/README.md: -------------------------------------------------------------------------------- 1 | README -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | 33 | 34 | 35 | /.settings 36 | /build 37 | .classpath 38 | .project 39 | /bin/ 40 | /target/ 41 | 42 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/monolithic-services/truyum/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/TruyumApplication.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TruyumApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(TruyumApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | @Configuration 8 | public class WebConfig implements WebMvcConfigurer { 9 | 10 | @Override 11 | public void addCorsMappings(CorsRegistry registry) { 12 | registry.addMapping("/**").allowedMethods("*").allowedOrigins("http://localhost:4200"); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/controller/CartController.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.DeleteMapping; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.PostMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import com.cognizant.truyum.DTO.CartDTO; 12 | import com.cognizant.truyum.service.CartEmptyException; 13 | import com.cognizant.truyum.service.CartService; 14 | 15 | @RestController 16 | @RequestMapping("/carts") 17 | public class CartController { 18 | 19 | @Autowired 20 | public CartService cartservice; 21 | 22 | 23 | 24 | 25 | 26 | @PostMapping("/{userName}/{menuItemId}") 27 | public void addCartItem(@PathVariable String userName,@PathVariable long menuItemId){ 28 | System.out.println("Inside Add Cart post Controller"); 29 | cartservice.addCartItem(userName, menuItemId); 30 | } 31 | 32 | @GetMapping("/{userName}") 33 | public CartDTO getAllCartItems(@PathVariable String userName) throws CartEmptyException{ 34 | return cartservice.getAllCartItems(userName); 35 | } 36 | 37 | @DeleteMapping("/{userName}/{menuItemId}") 38 | public void removeCartItem(@PathVariable String userName,@PathVariable long menuItemId) 39 | { 40 | cartservice.removeCartItem(userName, menuItemId); 41 | } 42 | 43 | 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/dao/CartDao.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.dao; 2 | 3 | import com.cognizant.truyum.DTO.CartDTO; 4 | 5 | 6 | 7 | 8 | public interface CartDao { 9 | 10 | 11 | public void addCartItem(String userName,long menuItemId); 12 | public CartDTO getAllCartItems(String userName); 13 | 14 | public void removeCartItem(String userName,long menuItemId); 15 | 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/dao/MenuItemDao.java: -------------------------------------------------------------------------------- 1 | //package com.cognizant.truyum.dao; 2 | // 3 | //import java.util.List; 4 | // 5 | //import org.springframework.beans.factory.annotation.Autowired; 6 | // 7 | //import com.cognizant.truyum.model.MenuItem; 8 | // 9 | // 10 | // 11 | // 12 | // 13 | //public interface MenuItemDao { 14 | // 15 | // public List getMenuItemListAdmin(); 16 | // 17 | // public List getMenuItemListCustomer(); 18 | // public void modifyMenuItem( MenuItem menuItem); 19 | // public MenuItem getMenuItem( long menuItemId); 20 | // 21 | // 22 | //} 23 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/exception/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.exception; 2 | 3 | public class GlobalExceptionHandler { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/exception/UserAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.exception; 2 | 3 | public class UserAlreadyExistsException extends Exception { 4 | 5 | 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/model/Cart.java: -------------------------------------------------------------------------------- 1 | //package com.cognizant.truyum.model; 2 | // 3 | //import java.util.List; 4 | // 5 | //import javax.persistence.Entity; 6 | //import javax.persistence.Table; 7 | // 8 | // 9 | // 10 | ////@Entity 11 | ////@Table(name="cart") 12 | //public class Cart { 13 | // 14 | // 15 | // 16 | // private static List menuItemList; 17 | // private double total; 18 | // public Cart(List menuItemList, double total) { 19 | // super(); 20 | // this.menuItemList = menuItemList; 21 | // this.total = total; 22 | // } 23 | // @Override 24 | // public String toString() { 25 | // return "Cart [menuItemList=" + menuItemList + ", total=" + total + "]"; 26 | // } 27 | // public List getMenuItemList() { 28 | // return menuItemList; 29 | // } 30 | // public void setMenuItemList(List menuItemList) { 31 | // this.menuItemList = menuItemList; 32 | // } 33 | // public double getTotal() { 34 | // return total; 35 | // } 36 | // public void setTotal(double total) { 37 | // this.total = total; 38 | // } 39 | // /** 40 | // * 41 | // */ 42 | // public Cart() { 43 | // super(); 44 | // // TODO Auto-generated constructor stub 45 | // } 46 | // 47 | // 48 | // 49 | //} 50 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/model/Role.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.model; 2 | 3 | 4 | import java.util.List; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.JoinTable; 11 | import javax.persistence.ManyToMany; 12 | import javax.persistence.Table; 13 | 14 | @Entity 15 | @Table(name="role") 16 | public class Role { 17 | @Id 18 | @Column(name="ro_id") 19 | private int id; 20 | @Column(name="ro_name") 21 | private String name; 22 | 23 | @ManyToMany 24 | @JoinTable(name = "user_role", 25 | joinColumns = @JoinColumn(name = "ur_ro_id"), 26 | inverseJoinColumns = @JoinColumn(name = "ur_us_id")) 27 | private List users; 28 | 29 | public List getUsers() { 30 | return users; 31 | } 32 | 33 | public void setUsers(List users) { 34 | this.users = users; 35 | } 36 | public int getId() { 37 | return id; 38 | } 39 | public void setId(int id) { 40 | this.id = id; 41 | } 42 | public String getName() { 43 | return name; 44 | } 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/repository/CartRepository.java: -------------------------------------------------------------------------------- 1 | //package com.cognizant.truyum.repository; 2 | // 3 | //import org.springframework.data.jpa.repository.JpaRepository; 4 | //import org.springframework.stereotype.Repository; 5 | // 6 | //import com.cognizant.truyum.DTO.CartDTO; 7 | // 8 | // 9 | // 10 | //@Repository 11 | //public interface CartRepository extends JpaRepository{ 12 | // 13 | // 14 | // 15 | // 16 | // 17 | //} 18 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/repository/MenuItemRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.jboss.logging.Param; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.Query; 8 | 9 | import com.cognizant.truyum.model.MenuItem; 10 | 11 | public interface MenuItemRepository extends JpaRepository{ 12 | 13 | 14 | 15 | 16 | @Query("From MenuItem m where m.active=1 and m.Date_of_Launch getMenuItemCustomer(); 18 | 19 | 20 | // @Query("From MenuItem m where me_id=?1") 21 | // public MenuItem getMenuItem(long menuItemId); 22 | // 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.cognizant.truyum.model.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | 9 | import com.cognizant.truyum.model.MenuItem; 10 | import com.cognizant.truyum.model.Users; 11 | 12 | public interface UserRepository extends JpaRepository{ 13 | 14 | public Users findByUsername(String username); 15 | 16 | 17 | @Query("SELECT u.menuItems from Users u WHERE u.username=?1") 18 | List getMenuItems(String username); 19 | 20 | 21 | @Query(value = "select sum(me_price) from menu_item where me_id in(select ct_pr_id from cart where ct_us_id=(select us_id from user where us_username= :username))", nativeQuery = true) 22 | public double getCartTotal(@Param(value = "username") String username); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/java/com/cognizant/truyum/service/CartEmptyException.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum.service; 2 | 3 | public class CartEmptyException extends Exception { 4 | 5 | 6 | 7 | public CartEmptyException() 8 | { 9 | super("Cart is Empty"); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | server.port=8888 3 | 4 | 5 | # Spring Framework and application log 6 | logging.level.org.springframework=info 7 | logging.level.com.cognizant=debug 8 | 9 | # Hibernate logs for displaying executed SQL, input and output 10 | logging.level.org.hibernate.SQL=trace 11 | logging.level.org.hibernate.type.descriptor.sql=trace 12 | 13 | # Log pattern 14 | logging.pattern.console=%d{dd-MM-yy} %d{HH:mm:ss.SSS} %-20.20thread %5p %-25.25logger{25} %25M %4L %m%n 15 | 16 | # Database configuration 17 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 18 | spring.datasource.url=jdbc:mysql://localhost:3306/truyum 19 | spring.datasource.username=root 20 | spring.datasource.password=password-1 21 | 22 | # Hibernate configuration 23 | spring.jpa.hibernate.ddl-auto=validate 24 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect 25 | 26 | spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true 27 | -------------------------------------------------------------------------------- /truyum-v2/monolithic-services/truyum/src/test/java/com/cognizant/truyum/TruyumApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.cognizant.truyum; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class TruyumApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /truyum-v2/ui-design/README.md: -------------------------------------------------------------------------------- 1 | README -------------------------------------------------------------------------------- /truyum-v2/webapp/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /truyum-v2/webapp/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /truyum-v2/webapp/README.md: -------------------------------------------------------------------------------- 1 | # Webapp 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.0.2. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /truyum-v2/webapp/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /truyum-v2/webapp/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to webapp!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /truyum-v2/webapp/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /truyum-v2/webapp/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /truyum-v2/webapp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webapp", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~7.0.0", 15 | "@angular/common": "~7.0.0", 16 | "@angular/compiler": "~7.0.0", 17 | "@angular/core": "~7.0.0", 18 | "@angular/forms": "~7.0.0", 19 | "@angular/http": "~7.0.0", 20 | "@angular/platform-browser": "~7.0.0", 21 | "@angular/platform-browser-dynamic": "~7.0.0", 22 | "@angular/router": "~7.0.0", 23 | "core-js": "^2.5.4", 24 | "rxjs": "~6.3.3", 25 | "zone.js": "~0.8.26" 26 | }, 27 | "devDependencies": { 28 | "@angular-devkit/build-angular": "~0.10.0", 29 | "@angular/cli": "~7.0.2", 30 | "@angular/compiler-cli": "~7.0.0", 31 | "@angular/language-service": "~7.0.0", 32 | "@types/node": "~8.9.4", 33 | "@types/jasmine": "~2.8.8", 34 | "@types/jasminewd2": "~2.0.3", 35 | "codelyzer": "~4.5.0", 36 | "jasmine-core": "~2.99.1", 37 | "jasmine-spec-reporter": "~4.2.1", 38 | "karma": "~3.0.0", 39 | "karma-chrome-launcher": "~2.2.0", 40 | "karma-coverage-istanbul-reporter": "~2.0.1", 41 | "karma-jasmine": "~1.1.2", 42 | "karma-jasmine-html-reporter": "^0.2.2", 43 | "protractor": "~5.4.0", 44 | "ts-node": "~7.0.0", 45 | "tslint": "~5.11.0", 46 | "typescript": "~3.1.1" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { ItemEditComponent } from './food/item-edit/item-edit.component'; 4 | import { AuthGuardServiceService } from './auth-guard-service.service'; 5 | import { SignupComponent } from './site/signup/signup.component'; 6 | import { CartComponent } from './shopping/cart/cart.component'; 7 | import { LoginComponent } from './site/login/login.component'; 8 | import { SearchComponent } from './food/search/search.component'; 9 | 10 | const routes: Routes = [ 11 | { path: '', redirectTo: 'search-bar', pathMatch: 'full'}, 12 | { path: 'edit-food-item/:id', component: ItemEditComponent, canActivate: [AuthGuardServiceService]}, 13 | { path: 'signup', component: SignupComponent}, 14 | { path: 'cart', component: CartComponent, canActivate: [AuthGuardServiceService]}, 15 | { path: 'login',component: LoginComponent}, 16 | { path: 'search-bar',component: SearchComponent}]; 17 | 18 | @NgModule({ 19 | imports: [RouterModule.forRoot(routes 20 | )], 21 | exports: [RouterModule] 22 | }) 23 | export class AppRoutingModule { } 24 | // { enableTracing: true } -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/webapp/src/app/app.component.css -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | })); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.debugElement.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'webapp'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.debugElement.componentInstance; 26 | expect(app.title).toEqual('webapp'); 27 | }); 28 | 29 | it('should render title in a h1 tag', () => { 30 | const fixture = TestBed.createComponent(AppComponent); 31 | fixture.detectChanges(); 32 | const compiled = fixture.debugElement.nativeElement; 33 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to webapp!'); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { AuthServiceService } from './site/auth-service.service'; 3 | import { Router } from '@angular/router'; 4 | import { FoodService } from './food/food.service'; 5 | 6 | @Component({ 7 | selector: 'app-root', 8 | templateUrl: './app.component.html', 9 | styleUrls: ['./app.component.css'] 10 | }) 11 | export class AppComponent implements OnInit { 12 | 13 | ngOnInit(): void { 14 | this.loggedIn(); 15 | this.router.navigate(['search-bar']); 16 | } 17 | constructor(private authService:AuthServiceService,public router: Router,private foodService:FoodService) { 18 | } 19 | title = 'truYum'; 20 | isLoggedIn:boolean = false; 21 | 22 | 23 | loggedIn():boolean { 24 | if(!this.authService.loggedInUser.loggedOut){ 25 | this.isLoggedIn = true; 26 | return true 27 | } 28 | else{ 29 | this.isLoggedIn = false; 30 | return false; 31 | } 32 | } 33 | clickOnAddCart(){ 34 | this.foodService.clickedOnAdd = false; 35 | this.foodService.addedToCart = false; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/auth-guard-service.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthGuardServiceService } from './auth-guard-service.service'; 4 | 5 | describe('AuthGuardServiceService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: AuthGuardServiceService = TestBed.get(AuthGuardServiceService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/auth-guard-service.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; 3 | import { AuthServiceService } from './site/auth-service.service'; 4 | import { Observable, Observer } from 'rxjs'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class AuthGuardServiceService implements CanActivate { 10 | 11 | constructor(private authService: AuthServiceService, private router: Router) { } 12 | 13 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean { 14 | // retain the url that is requested for authorization 15 | this.authService.redirectUrl = state.url; 16 | 17 | console.log('URL', state.url); 18 | 19 | return Observable.create((observer: Observer) => { 20 | if (this.authService.loggedIn) { 21 | console.log('Logged in'); 22 | observer.next(true); 23 | } else { 24 | console.log('Not Logged in'); 25 | this.router.navigate(['login'], { queryParams: { from: state.url.substr(1) } }); 26 | } 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/food.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { FoodService } from './food.service'; 4 | 5 | describe('FoodService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: FoodService = TestBed.get(FoodService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/item-edit/item-edit.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/webapp/src/app/food/item-edit/item-edit.component.css -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/item-edit/item-edit.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ItemEditComponent } from './item-edit.component'; 4 | 5 | describe('ItemEditComponent', () => { 6 | let component: ItemEditComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ItemEditComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ItemEditComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/item-info/item-info.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/webapp/src/app/food/item-info/item-info.component.css -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/item-info/item-info.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ItemInfoComponent } from './item-info.component'; 4 | 5 | describe('ItemInfoComponent', () => { 6 | let component: ItemInfoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ItemInfoComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ItemInfoComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/item-info/item-info.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; 2 | import { fooditem } from 'src/app/fooditem'; 3 | import { FoodService } from '../food.service'; 4 | import { AuthServiceService } from 'src/app/site/auth-service.service'; 5 | 6 | 7 | 8 | @Component({ 9 | selector: 'app-item-info', 10 | templateUrl: './item-info.component.html', 11 | styleUrls: ['./item-info.component.css'] 12 | }) 13 | export class ItemInfoComponent { 14 | 15 | @Input() fooditem1:fooditem; 16 | 17 | @Output() addToCartClicked:EventEmitter =new EventEmitter(); 18 | 19 | 20 | isAdmin:boolean; 21 | cartAddedId:number; 22 | addedToCart:boolean; 23 | 24 | 25 | constructor(private _foodService: FoodService,private authservice:AuthServiceService){} 26 | ngOnInit() 27 | { 28 | 29 | 30 | this.isAdmin=this.authservice.isAdmin; 31 | 32 | 33 | 34 | 35 | 36 | } 37 | 38 | 39 | 40 | displayAddToCart(id:number) { 41 | this.cartAddedId = id; 42 | console.log(this.cartAddedId) 43 | } 44 | 45 | onAddToCart(itemId:number) 46 | { 47 | console.log("From Clickedf"); 48 | this.addToCartClicked.emit(itemId); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/menu/menu.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/webapp/src/app/food/menu/menu.component.css -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/menu/menu.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
-------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/menu/menu.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MenuComponent } from './menu.component'; 4 | 5 | describe('MenuComponent', () => { 6 | let component: MenuComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ MenuComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MenuComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/menu/menu.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, EventEmitter } from '@angular/core'; 2 | 3 | import { fooditem } from 'src/app/fooditem'; 4 | import { FoodService } from '../food.service'; 5 | import { CartService } from 'src/app/shopping/cart.service'; 6 | import { MenuItemService } from 'src/app/services/menu-item.service'; 7 | import { AuthServiceService } from 'src/app/site/auth-service.service'; 8 | 9 | 10 | 11 | @Component({ 12 | selector: 'app-menu', 13 | templateUrl: './menu.component.html', 14 | styleUrls: ['./menu.component.css'] 15 | }) 16 | export class MenuComponent implements OnInit { 17 | 18 | 19 | @Input() 20 | 21 | addedToCart:boolean; 22 | 23 | fooditem:fooditem[]; 24 | 25 | addToCartClicked =new EventEmitter(); 26 | 27 | isAdmin:boolean; 28 | constructor(private _foodService: FoodService,private cartservice:CartService,private Menuitemservice:MenuItemService,private authservice:AuthServiceService){} 29 | 30 | ngOnInit() 31 | { 32 | this._foodService.getAllMenuItems().subscribe(fooditem =>this.fooditem=fooditem); 33 | 34 | this._foodService.getSubject().subscribe((data) =>(this.fooditem=this._foodService.getItem(data))); 35 | 36 | this.authservice.addedToCart=false; 37 | 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/search/search.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/webapp/src/app/food/search/search.component.css -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/search/search.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

Find Food

5 |
6 | 7 |
8 | 9 | free_breakfast 11 |
12 | 13 | 15 | 18 |
19 | 20 |
21 | 22 |
23 | 24 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/search/search.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SearchComponent } from './search.component'; 4 | 5 | describe('SearchComponent', () => { 6 | let component: SearchComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SearchComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SearchComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/food/search/search.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { fooditem } from 'src/app/fooditem'; 3 | import { FoodService } from '../food.service'; 4 | 5 | 6 | @Component({ 7 | selector: 'app-search', 8 | templateUrl: './search.component.html', 9 | styleUrls: ['./search.component.css'] 10 | }) 11 | export class SearchComponent implements OnInit { 12 | 13 | constructor(private _foodservice:FoodService) { } 14 | filterlist:fooditem[]; 15 | ngOnInit() { 16 | this._foodservice.getAllMenuItems().subscribe(data => this._foodservice.fooditem=data) 17 | console.log("updating") 18 | 19 | 20 | 21 | 22 | 23 | } 24 | search(event:any) 25 | { 26 | 27 | // this._foodservice.getItem(event.target.value).subscribe(filterlist=> this.filterlist=filterlist) 28 | 29 | this._foodservice.getSubject().next(event.target.value) 30 | 31 | } 32 | 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/fooditem.ts: -------------------------------------------------------------------------------- 1 | export interface fooditem 2 | { 3 | 4 | id:number,name:string,price:number,active:boolean,date_of_Launch: Date,category:string,free_delivery:boolean,image:string; 5 | 6 | } -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/services/menu-item.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { MenuItemService } from './menu-item.service'; 4 | 5 | describe('MenuItemService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: MenuItemService = TestBed.get(MenuItemService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/services/menu-item.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient, HttpHeaders } from '@angular/common/http'; 3 | import { environment } from 'src/environments/environment'; 4 | import { Observable, of } from 'rxjs'; 5 | import { fooditem } from '../fooditem'; 6 | 7 | // const httpOptions = { 8 | // headers: new HttpHeaders({ 9 | // 'Content-Type': 'application/json', 10 | // }) 11 | // }; 12 | @Injectable({ 13 | providedIn: 'root' 14 | }) 15 | export class MenuItemService { 16 | 17 | constructor(private httpClient: HttpClient) { } 18 | // getAllMenuItems():Observable{ 19 | // console.log("hola") 20 | // let username='user' 21 | // let password='pwd' 22 | // const headers = new HttpHeaders({ Authorization: 'Basic ' + btoa(username + ':' + password) }); 23 | // return this.httpClient.get(`${environment.baseUrl}`+'menu-items',{headers}) 24 | // } 25 | } -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/shopping/cart.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { CartService } from './cart.service'; 4 | 5 | describe('CartService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: CartService = TestBed.get(CartService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/shopping/cart/cart.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/webapp/src/app/shopping/cart/cart.component.css -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/shopping/cart/cart.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |

Cart

6 |
Cart Item deleted Succesfully
7 |
No Items in the Cart.Use 'Add to Cart Option' in menu item list
8 | 9 |
10 | 11 |
    12 |
  • 13 |
    14 | {{iterate.name}}{{iterate.price | currency:'INR'}} 15 |
    16 | 17 |

    18 | delete_forever 19 |

    20 | 21 |
  • 22 | 23 | 24 |
  • 25 |
    26 | Total{{this.cartservice.cart1.total | currency:'INR'}} 27 | 28 |
    29 |
  • 30 |
31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/shopping/cart/cart.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CartComponent } from './cart.component'; 4 | 5 | describe('CartComponent', () => { 6 | let component: CartComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ CartComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CartComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/shopping/cart/cart.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit} from '@angular/core'; 2 | import { CartService } from '../cart.service'; 3 | import { cart } from './cartitem'; 4 | import { FoodService } from 'src/app/food/food.service'; 5 | import { AuthServiceService } from 'src/app/site/auth-service.service'; 6 | 7 | @Component({ 8 | selector: 'app-shopping-cart', 9 | templateUrl: './cart.component.html', 10 | styleUrls: ['./cart.component.css'] 11 | }) 12 | export class CartComponent implements OnInit { 13 | 14 | 15 | 16 | cart:cart; 17 | 18 | stat:boolean; 19 | empty:boolean; 20 | addedToCart:boolean; 21 | constructor(private cartservice:CartService,private _foodservice:FoodService,private authservice:AuthServiceService) { } 22 | 23 | ngOnInit() { 24 | 25 | 26 | this.cartservice.getAllCart(); 27 | 28 | 29 | //this.addedToCart=this.authservice.addedToCart; 30 | this.empty=this.cartservice.cartempty; 31 | } 32 | 33 | 34 | 35 | removeFromCart(cartId) 36 | { 37 | 38 | this._foodservice.deleteCartItem(cartId).subscribe(data=>{this.cartservice.getAllCart();}) 39 | 40 | 41 | 42 | 43 | this.empty=this.cartservice.cartempty; 44 | this.stat=this.cartservice.cartstatus; 45 | 46 | console.log(this.stat) 47 | 48 | } 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/shopping/cart/cartitem.ts: -------------------------------------------------------------------------------- 1 | import { fooditem } from "src/app/fooditem"; 2 | 3 | export interface cart 4 | { 5 | 6 | menuItemList:fooditem[]; 7 | // name:string,price:number; 8 | total:number; 9 | } -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/site/auth-service.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthServiceService } from './auth-service.service'; 4 | 5 | describe('AuthServiceService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: AuthServiceService = TestBed.get(AuthServiceService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/site/login/login.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/webapp/src/app/site/login/login.component.css -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/site/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ LoginComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LoginComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/site/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormGroup, FormBuilder, Validators } from '@angular/forms'; 3 | import { AuthServiceService } from '../auth-service.service'; 4 | import { Router } from '@angular/router'; 5 | import { FoodService } from 'src/app/food/food.service'; 6 | 7 | 8 | @Component({ 9 | selector: 'app-login', 10 | templateUrl: './login.component.html', 11 | styleUrls: ['./login.component.css'] 12 | }) 13 | export class LoginComponent implements OnInit { 14 | loginForm:FormGroup 15 | 16 | constructor(private formBuild:FormBuilder,private authService:AuthServiceService,private router:Router,private foodService:FoodService) { } 17 | 18 | ngOnInit() { 19 | this.loginForm = this.formBuild.group({ 20 | username: ['',[ 21 | Validators.required 22 | ]], 23 | password: ['',[ 24 | Validators.required 25 | ]] 26 | }) 27 | } 28 | get username(){ 29 | return this.loginForm.get('username'); 30 | } 31 | get password(){ 32 | return this.loginForm.get('password'); 33 | } 34 | toSignup() { 35 | this.router.navigate(['signup']) 36 | } 37 | 38 | onSubmit() 39 | { 40 | 41 | //this.authenticationservice.authenticate(this.user,this.password).subscribe(data=>) 42 | 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/site/signup/User.ts: -------------------------------------------------------------------------------- 1 | export interface User 2 | { 3 | 4 | 5 | firstname:string, 6 | lastname:string, 7 | username:string, 8 | password:string 9 | } -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/site/signup/signup.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/webapp/src/app/site/signup/signup.component.css -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/site/signup/signup.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SignupComponent } from './signup.component'; 4 | 5 | describe('SignupComponent', () => { 6 | let component: SignupComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SignupComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SignupComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/site/user-service.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { UserServiceService } from './user-service.service'; 4 | 5 | describe('UserServiceService', () => { 6 | beforeEach(() => TestBed.configureTestingModule({})); 7 | 8 | it('should be created', () => { 9 | const service: UserServiceService = TestBed.get(UserServiceService); 10 | expect(service).toBeTruthy(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/app/site/user-service.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { HttpClient } from '@angular/common/http'; 4 | import { environment } from 'src/environments/environment'; 5 | 6 | import { Observable } from 'rxjs'; 7 | import { User } from './signup/User'; 8 | 9 | @Injectable({ 10 | providedIn: 'root' 11 | }) 12 | export class UserServiceService { 13 | 14 | constructor(private router:Router,private http:HttpClient) { } 15 | userExists:boolean=true; 16 | addUser(user:any) { 17 | 18 | let NewUsers:User={firstname:user["firstname"],lastname:user["lastname"],username:user["username"],password:user["password"]} 19 | 20 | this.addUsers(NewUsers).subscribe(data=> 21 | { 22 | 23 | this.userExists=data; 24 | console.log(this.userExists); 25 | if(data) 26 | { 27 | console.log("inside if user serivce"+this.userExists); 28 | this.router.navigate(['login']); 29 | } 30 | }, 31 | (error)=>{console.log(error);} 32 | ) 33 | 34 | } 35 | 36 | 37 | 38 | addUsers(user:User):Observable 39 | { 40 | 41 | return this.http.post(environment.baseUrl+"auth-service/users",user) 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/webapp/src/assets/.gitkeep -------------------------------------------------------------------------------- /truyum-v2/webapp/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /truyum-v2/webapp/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | baseUrl: 'http://localhost:4200/' 4 | }; 5 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | baseUrl: 'http://localhost:1004/' 8 | }; 9 | 10 | 11 | 12 | /* 13 | * For easier debugging in development mode, you can import the following file 14 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 15 | * 16 | * This import should be commented out in production mode because it will have a negative impact 17 | * on performance if an error is thrown. 18 | */ 19 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 20 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rupesh99326/Java-Full-Stack-Projects/3640d0571bd7296c5d68137642de2ef25ba0e713/truyum-v2/webapp/src/favicon.ico -------------------------------------------------------------------------------- /truyum-v2/webapp/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Webapp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /truyum-v2/webapp/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /truyum-v2/webapp/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /truyum-v2/webapp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "target": "es5", 13 | "typeRoots": [ 14 | "node_modules/@types" 15 | ], 16 | "lib": [ 17 | "es2018", 18 | "dom" 19 | ] 20 | } 21 | } 22 | --------------------------------------------------------------------------------