This is a very simple online shopping application using Java 11, Spring Boot, Spring Cloud + JPA/Hibernate + JUnit.
A very limited set of functionalities:
- The application is simply a simple web page that shows all products on which customers can filter, short and search for products based on different criteria such as name, price, brand, colour etc.
- All product prices are subject to change at any time and the company wants to keep track of it.
- If a customer finds a product that they like, they can add it to their shopping cart and proceed to place an order.
- For audit support, all customers' activities such as searching, filtering and viewing product's details need to be stored in the database. However, failure to store customer activity is completely transparent to customer and should have no impact to the activity itself.
- Customer can login simply by clicking the button “Login with Facebook”. No further account registration is required.
- No online payment is supported yet. Customer is required to pay by cash when the product got delivered.
- SOLID Principles
- DRY Principle
- KISS Principle
- Modularity: split each business domain in each module
- Abstraction: define abstraction layer for service
- Consistency: the same structure for each module, same way for receiving request, returning response, ...
- Builder Pattern
- Factory Method Pattern
- Chain of responsibility Pattern
Besides that I also AOP for listening on search/ view event on service and audit the customer's activity. We can enable/ disable this feature easily without any affect to the business logic.
- JDK 11
- Intellij
- Maven
- Spring boot 2.3.1.RELEASE
- Spring Cloud Hoxton.SR5
- Mysql
- Junit 5
- Lombok
- spring-cloud-config-server : Config server which provides an HTTP resource-based API for external configuration, in this project we stored the database configuration on Github.
- spring-cloud-starter-config : provides server-side and client-side support for externalized configuration in a distributed system.
- spring-cloud-starter-netflix-eureka-server : Eureka Server (Service Registry). This library allows services to find and communicate with each other without hard-coding hostname and port.
- spring-cloud-starter-netflix-eureka-client : Eureka Client, for registering the service with Service Registry.
- spring-cloud-starter-netflix-ribbon : Load balancer client.
- spring-boot-starter-actuator : monitor and manage the application.
- spring-boot-starter-web : for building web, including RESTful, applications.
- spring-boot-starter-test : for testing the web RESTful API.
- spring-boot-starter-aop : for aspect-oriented programming with Spring AOP and AspectJ. We use this feature for implementing the customer audit feature.
- spring-boot-starter-data-jpa: for using Spring Data JPA with Hibernate.
- mysql-connector-java: JDBC driver for MySQL.
- spring-boot-starter-validation: for using Java Bean Validation with Hibernate Validator.
- spring-boot-starter-security: for using Spring Security
- spring-security-test: for the testing Spring Security
- jjwt: JSON Web Token Support For Java.
- auth0: Java implementation of JSON Web Token (JWT).
- spring-boot-devtools: Developer Tools for supporting Automatic Restart, LiveReload.
- log4jdbc-spring-boot-starter: for using Log4jdbc with Spring Boot, it can log SQL that is ready to run with actual values.
- modelmapper: to make object mapping easy, by automatically determining how one object model maps to another, based on conventions.
- commons-lang3: The utilities for supporting the operations on String, Number, Reflection, Random, ...
- commons-collections4: Commons Collections for supporting the operations on Collections data structures in Java.
root
|--- ic-backend
|---|--- ic-account : The API for authentication
|---|--- ic-audit : The API for the audit the customer's activities
|---|--- ic-order : The API for the order management
|---|--- ic-product : The API for the product management
|---|--- ic-core : The core feature of iccommerce application
|--- ic-config-server : Provides an HTTP resource-based API for external configuration
|--- ic-discoverry-server : This is a service registry (service discovery server)
|--- external-resources : Including architecture, database design, SQL script, api postman collection
|--- README : Introduce about the project and guideline
Database for authentication (account) service
Database for product service
Database for order service
Database for audit service
Please follow this guideline
Please follow this guideline
Please follow this guideline
Please go to the discovery server at this link: http://localhost:9000/






