Video demo of important end points
NOTE: jar file and code has since been updated after video upload, certain behavior maybe slightly different from video, and end points are more than what's in video Key behaviors and endpoints should be the same.
One way to play with this app
- All data are persisted in RDS(mysql), so the data you change is going to be permanent.
- User info(comes with shopping cart summary)
- Same user's shopping cart detail
- Same user's receipt of current shopping cart
- Please do not delete this user:)
- List Of Users
- swagger of aws app
java -jar ecomm-0.0.1-SNAPSHOT.jar
the project was built with jdk 17 + spring boot 3.0.2, runs on default 8080 port.
./gradlew clean build
./gradlew clean test
If you have your own gradle setup you could also use that.
For the sake of easier navigation I put swagger in.
url: jdbc:h2:mem:testDB user: sa no password
- adding or remove deal to product, you need to specific an action, it's either 'add' or 'remove' are right now supported
http://localhost:8080/products/{id}/{action}/{dealId}
- Due to time constrain, user/customer management and security/authentication is not built
- I created two roles: ADMIN, CUSTOMER and a few users for demo purpose
- But I didn't really build any feature around user/customer managements or authentication
- Role do not anything at this moment
- USER ID is used as entry point for shopping cart, receipt calculation and some other logic temporarily
- All can be changed if needed.
- products and deals are built with many-to-many relationship, but again due to time constrain:
- For now, you can only add or remove deal to a product not the other way around
- You can only add one deal at a time to a product
- Multiple deals can be added to one product, but for receipt calculation, only one (with smaller deal ID) will be honored.
- Did not get time to build yet, only a very basic placeholder
- Using H2 im-memory database as indicated
- If I misunderstood the intention, please let me know, I can easily change this.
- This is represented as user+product+quantity in cartItems table.
- Right now receipt is only a subtotal calculation (a snapshot of shopping cart) and not persist
- So at anytime time a user goes to its receipt end point will see final price after discounts applied, subtotal and total amount due
- But this action will not change anything in the shopping cart
- My idea is that checkout process will permanently clear shopping cart, produce order, final receipt etc. which are not yet supported