{"id":14956852,"url":"https://github.com/bzdgn/product-catalog-spring-mvc-demo","last_synced_at":"2025-10-24T10:31:03.922Z","repository":{"id":81112729,"uuid":"69203856","full_name":"bzdgn/product-catalog-spring-mvc-demo","owner":"bzdgn","description":"A Product Catalog Demonstration Project Using Spring MVC and Mongo DB","archived":false,"fork":false,"pushed_at":"2016-09-26T18:46:34.000Z","size":312,"stargazers_count":15,"open_issues_count":0,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-29T10:22:15.114Z","etag":null,"topics":["java","maven","mongo","mongo-db","mongodb","product-catalog","spring","spring-mvc","webapp"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bzdgn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-26T02:01:15.000Z","updated_at":"2024-08-26T04:26:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"154cc4e6-8ffa-444a-baca-61625ef2ef6a","html_url":"https://github.com/bzdgn/product-catalog-spring-mvc-demo","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"d488cdc4c2132cbeb861af7dd68cb0c3b24db22f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzdgn%2Fproduct-catalog-spring-mvc-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzdgn%2Fproduct-catalog-spring-mvc-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzdgn%2Fproduct-catalog-spring-mvc-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzdgn%2Fproduct-catalog-spring-mvc-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bzdgn","download_url":"https://codeload.github.com/bzdgn/product-catalog-spring-mvc-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237950886,"owners_count":19392667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","maven","mongo","mongo-db","mongodb","product-catalog","spring","spring-mvc","webapp"],"created_at":"2024-09-24T13:13:37.863Z","updated_at":"2025-10-24T10:31:03.341Z","avatar_url":"https://github.com/bzdgn.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 01 Screenshots;\n\n## 01-A) Product List Page\n\n![alt text](http://leventdivilioglu.com/prod-cata-ss/01_products-list-page.png \"Product List Page\")\n\n## 01-B) Product Details Page\n\n![alt text](http://leventdivilioglu.com/prod-cata-ss/02_product-detail-page.png \"Product Detail Page\")\n\n## 01-C) Product Details Page Confirmation Modal\n\n![alt text](http://leventdivilioglu.com/prod-cata-ss/03_product-detail-page-confirmation.png \"Product Detail Page Confirmation\")\n\n## 01-D) Shopping Cart Page\n\n![alt text](http://leventdivilioglu.com/prod-cata-ss/04_shopping-cart-page.png \"Shopping Cart Page\")\n\n## 01-E) Search Functionality\n\n![alt text](http://leventdivilioglu.com/prod-cata-ss/05_search-functionality.png \"Search Screenshot\")\n\n## 01-F) List Products By Selected Category\n\n![alt text](http://leventdivilioglu.com/prod-cata-ss/06-list-by-category.png \"Category Listing Screenshot\")\n\n# 02 Project Startup\n\n\tFollowing maven archetype is used to create web application\n\n`\tmvn archetype:generate\n\t\t-DgroupId=com.levent.pcd\n\t\t-DartifactId=ProductCatalogDemo\n\t\t-DarchetypeArtifactId=maven-archetype-webapp\n\t\t-DinteractiveMode=false\n\t\t\n\tmvn archetype:generate -DgroupId=com.levent.pcd -DartifactId=ProductCatalogDemo -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false`\n\n# 03 Project Setup\n\n- MongoDB is needed for this project\n- On windows, simply run the command below (notify that you have to specify a dbpath parameter)\n\n`mongod --port 27017 --dbpath D:\\MONGOTEST\\data`\n\nI'm using the command below on my windows machine;\n\n`C:\\Program Files\\MongoDB\\Server\\3.0\\bin\u003emongod --port 27017 --dbpath D:\\MONGOTEST\\data`\n\n# 04 Project Data\n\n- Database name is specified on `servlet-config.xml` (WEB-INF/config/servlet-config.xml), \nand set to `levent`. You can change or set an arbitrary name for it.\n\n- Use the database name specified on `servlet-config.xml`\n\n`use levent`\n\n- Create a collection named `products` with the following command, you can run it on mongo client;\n\n`db.createCollection('products')`\n\n- Populate the collection with the following command, just copy and paste it on mongo client.\nAlso notify that database data is located on `src/resources/database-data` folder;\n\n`db.runCommand({\n\tinsert: 'products',\n\tdocuments: [\n\t\t{\n\t\t\t_id: '1',\n\t\t\tproductCode: 'AX329T',\n\t\t\tcategories: ['men'],\n\t\t\tproductName: 'Light Brown Men Shoe 1',\n\t\t\timageUrl: '01_men_one.jpg',\n\t\t\tprice: 68.39,\n\t\t\tsize: 43,\n\t\t\tcolor: 'lightbrown'\n\t\t},\n\t\t{\n\t\t\t_id: '2',\n\t\t\tproductCode: '6X3D93',\n\t\t\tcategories: ['men'],\n\t\t\tproductName: 'Brown Men Shoe 2',\n\t\t\timageUrl: '02_men_two.jpg',\n\t\t\tprice: 81.99,\n\t\t\tsize: 41,\n\t\t\tcolor: 'brown'\n\t\t},\n\t\t{\n\t\t\t_id: '3',\n\t\t\tproductCode: 'NX3G66',\n\t\t\tcategories: ['men'],\n\t\t\tproductName: 'Dark Brown Men Shoe 3',\n\t\t\timageUrl: '03_men_three.jpg',\n\t\t\tprice: 70.26,\n\t\t\tsize: 42,\n\t\t\tcolor: 'darkbrown'\n\t\t},\n\t\t{\n\t\t\t_id: '4',\n\t\t\tproductCode: '37Y29D',\n\t\t\tcategories: ['women'],\n\t\t\tproductName: 'Black High Heel Women Shoe',\n\t\t\timageUrl: '04_women_one.jpg',\n\t\t\tprice: 99.84,\n\t\t\tsize: 36,\n\t\t\tcolor: 'black'\n\t\t},\n\t\t{\n\t\t\t_id: '5',\n\t\t\tproductCode: '223JDH',\n\t\t\tcategories: ['women'],\n\t\t\tproductName: 'Black Women Shoe 2', \n\t\t\timageUrl: '05_women_two.jpg',\n\t\t\tprice: 102.67,\n\t\t\tsize: 37,\n\t\t\tcolor: 'black'\n\t\t},\n\t\t{\n\t\t\t_id: '6',\n\t\t\tproductCode: '7DGFF1',\n\t\t\tcategories: ['men', 'children', 'boy'],\n\t\t\tproductName: 'Black Blue Boy Shoe 1',\n\t\t\timageUrl: '06_men_children_01.jpg',\n\t\t\tprice: 51.14,\n\t\t\tsize: 3,\n\t\t\tcolor: 'blue'\n\t\t},\n\t\t{\n\t\t\t_id: '7',\n\t\t\tproductCode: 'DJ7CY3',\n\t\t\tcategories: ['men',\t'children', 'boy'],\n\t\t\tproductName: 'White Cream Boy Sport Shoe 2',\n\t\t\timageUrl: '07_men_children_02.jpg',\n\t\t\tprice: 43.36,\n\t\t\tsize: 4,\n\t\t\tcolor: 'cream'\n\t\t},\n\t\t{\n\t\t\t_id: '8',\n\t\t\tproductCode: '3HDAA7',\n\t\t\tcategories: ['girl', 'children', 'women'],\n\t\t\tproductName: 'Girl Pinky White Shoe 1',\n\t\t\timageUrl: '08_girl_children_01.jpg',\n\t\t\tprice: 45.44,\n\t\t\tsize: 2,\n\t\t\tcolor: 'white'\n\t\t},\n\t\t{\n\t\t\t_id: '9',\n\t\t\tproductCode: 'JFJE7X',\n\t\t\tcategories: ['girl', 'children'],\n\t\t\tproductName: 'Girl Pinky Black Shoe 2',\n\t\t\timageUrl: '09_girl_children_02.jpg',\n\t\t\tprice: 55.24,\n\t\t\tsize: 3,\n\t\t\tcolor: 'pink'\n\t\t}\n\t]\n})`\n\n# 05 Explanation\n\nThere are several packages due to N-tier application model. Front Controllers are located on `controller` package. Controller classes invokes classes under Service and Business packages. Business package is an additional abstraction for service. Service layer uses Repository package classes and that's all.\n\nThere is only one model class, `Product`. However for session scoped shopping cart data, there is also `ShoppingCartMap` class, and also there is an `ShoppingCartEntry` class which I use to store the orders per Product Code, it's actually a map.\n\nThere is a very simple Strategy Pattern implementation on `ShoppingHandlerImpl` class. `ShoppingHandlerImpl` has a price handler instance which is actually a PriceStrategy interface. This is a very primitive demonstration of Strategy Design Pattern.\n\nThere are some several Rest Endpoints under `RestServicesController` class. One of them with request mapping `services/addToCart` is used for the update of session scoped variable on product details add-to-cart functionality, see `product-details.jsp` view under `WEB-INF/jsp`\n\nI used twitter bootstrap on for page layout for a better view and responsive design.\n\n# 06 Further Notes\n\nBecause that I need trivial image data to run the project, I've fetched some images from google and none of them\nbelongs to me.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbzdgn%2Fproduct-catalog-spring-mvc-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbzdgn%2Fproduct-catalog-spring-mvc-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbzdgn%2Fproduct-catalog-spring-mvc-demo/lists"}