Git Product home page Git Product logo

ecomm's Introduction

E-Commerce DEMO Project

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

Run the app locally

run it (make sure you have java 17+)

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.

you could also build it from source

./gradlew  clean build

Run Tests

./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

Notes Regarding Endpoints

  • 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}

More notes

User/customer Management and Security/Authentication

  • 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

  • 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.

Exception handling

  • Did not get time to build yet, only a very basic placeholder

Data Persistence

  • Using H2 im-memory database as indicated
  • If I misunderstood the intention, please let me know, I can easily change this.

Shopping Cart/Basket

  • This is represented as user+product+quantity in cartItems table.

Receipt

  • 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

ecomm's People

Contributors

byegates avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.