Code Monkey home page Code Monkey logo

ujjawalyt / ecommerce-web-api Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 224 KB

The Ecommerce-Web-Api is a backend implementation of the Product Management System built with Spring Boot. This web-based application enables organizations to effectively manage their product inventory and sales. The API provides various endpoints to perform operations related to product management

Java 100.00%
java spring-boot hibernate mysql postman spring-data-jpa spring-mvc swagger-ui

ecommerce-web-api's Introduction

Ecommerce-Web-Api

The Ecommerce-Web-Api is a backend implementation of the Product Management System built with Spring Boot. This web-based application enables organizations to effectively manage their product inventory and sales. The API provides various endpoints to perform operations related to product management such as adding, updating, and deleting products, as well as retrieving products based on various criteria such as category, price range, and availability. Additionally, it also provides endpoints for managing user accounts, such as creating new accounts, updating account details, and logging in and out of the system. With its user-friendly interface and robust functionality, the Ecommerce-Web-Api is an essential tool for any organization looking to streamline their product management and sales processes.

Technical Stacks

  • Spring Boot
  • Spring Framework
  • Spring Data JPA
  • MySQL
  • Hibernate
  • Java
  • Swagger UI
  • Postman

Modules

  • Admin Login Module
  • Users Login Module
  • Admin Module
  • Users Module
  • Category Module
  • Product Module
  • Cart Module
  • Orders Module
  • ProductBill Module

Features

  • Admin Login Features :- This module provides the functionality for admin authentication and validation to access the admin dashboard. The following features are included:

    • Admins can log in with their username and password.
    • The module validates the admin's credentials and generates a session token for the admin to access the admin dashboard.
    • The session token is stored securely and used to verify the admin's identity for subsequent requests.
  • Users Login Features :- This module provides the functionality for user authentication and validation to access user-specific features. The following features are included:

    • Users can register and create an account with a username and password.
    • Users can log in with their username and password.
    • The module validates the user's credentials and generates a session token for the user to access user-specific features.
    • The session token is stored securely and used to verify the user's identity for subsequent requests.
  • Admin Features :- This module provides the functionality for admins to manage the application. The following features are included:

    • Admins can view and manage users and their information.
    • Admins can view and manage products and their information.
    • Admins can view and manage orders and their information.
    • Admins can view and manage product bills and their information.
  • Users Features :- This module provides the functionality for users to manage their accounts and access user-specific features. The following features are included:

    • Users can view and update their profile information.
    • Users can view their order history.
    • Users can view and manage their cart.
  • Category Features :- This module provides the functionality for admins to manage product categories. The following features are included:

    • Admins can view and manage categories.
    • Admins can add new categories.
  • Product Features :- This module provides the functionality for admins to manage products. The following features are included:

    • Admins can view and manage products.
    • Admins can add new products.
    • Users can view product details and add products to their cart.
  • Cart Features :- This module provides the functionality for users to manage their carts. The following features are included:

    • Users can view and manage their cart.
    • Users can add and remove products from their cart.
  • Orders Features:- This module provides the functionality for admins to manage orders. The following features are included:

    • Admins can view and manage orders.
    • Users can view their order history and order details.
  • ProductBill Features:- This module provides the functionality for admins to generate bills for orders. The following features are included:

    • Admins can view and manage product bills.
    • Product bills are generated automatically for orders.

ER Diagram

The following Diagram depicts the flow of our Entity Relation Diagram to simplify the work flow. ecom er digram

Project Structure

Screenshot 2023-04-13 095658

Installation & Run

  • Before running the API server, you have to update the database configuration inside the application.properties file
  • Update the port number, username and password as per your local database configuration
    server.port=8888

    spring.datasource.url=jdbc:mysql://localhost:3306/ecomdb;
    spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
    spring.datasource.username=root
    spring.datasource.password=ujjawal
    

API Root Endpoint

https://localhost:8888/

http://localhost:8888/swagger-ui.html

Admin Module

  • POST /save : Adds a new admin to the system.
  • POST /login : Allows an admin to login to the system using their username and password.Request Body: JSON object representing the admin's login credentials
  • DELETE /logout/{sessionKey} : Path Parameters: sessionKey The session key of the admin to logout
  • PUT /update/{sessionKey}: Path Parameters: sessionKey The session key of the admin to update Request Body: JSON object representing the updated admin details
  • DELETE /delete/{sessionKey} : Path Parameters : sessionKey The session key of the admin to delete

Users Module

  • POST /save : Adds a new user to the system.
  • POST /login : Allows a user to login with their username and password. Request Body: UserLoginDto object in JSON format
  • DELETE/logout : Allows a user to logout from the system. Request Header: Authorization containing the session key
  • PUT /update : Updates an existing user in the system. Request Header: Authorization containing the session key Request Body: User object in JSON format
  • DELETE /delete/{id} : Deletes an existing user from the system Path Parameters:id: The ID of the user to delete Request Header: Authorization containing the session key
  • GET /Users/{id} : Retrieves a user by their ID Path Parameters: id: The ID of the user to retrieve Request Header: Authorization containing the session key

Category Module

  • POST /save/{adminKey} : The admin key to authenticate the request, Request Body: JSON object representing the category to be added.
  • PUT /update/{adminKey}/{categoryId} : adminKey: The admin key to authenticate the request categoryId: The id of the category to be updated. Request Body: JSON object representing the updated category details.
  • DELETE /delete/{adminKey}/{categoryId} : adminKey: The admin key to authenticate the request categoryId: The id of the category to be deleted.
  • GET /getAll/{adminKey} : adminKey : The admin key to authenticate the request.
  • GET /getById/{adminKey}/{categoryId} : adminKey: The admin key to authenticate the request categoryId: The id of the category to be retrieved.

Category Module

  • POST /save/{categoryId}/{adminKey} : Adds a new product to the system and associates it with the specified category.
  • DELETE /delete/{productId}/{adminKey} : Deletes a product from the system based on its unique identifier and the admin key provided.
  • GET /{productId} : Retrieves a product from the system based on its unique identifier.
  • GET /getAll : Retrieves all products stored in the system.
  • GET /{productName} : Retrieves a list of products that match the given product name.
  • PUT /update/{productId}/{adminKey} : Updates a product's details based on its unique identifier and the admin key provided.
  • GET /getAll/sortByPrice : Retrieves all products sorted by price in either ascending or descending order.
  • GET ResponseEntity : Retrieves all products sorted by rating in ascending order.
  • GET /getAllByRatingDesc : Retrieves all products sorted by rating in descending order.

Cart Module

  • POST /add/{productId}/{userId} :This endpoint adds a product to the cart of the specified user.
  • DELETE /delete/{productId}/{userId} : This endpoint removes a product from the cart of the specified user.
  • PUT /update/{productId}/{userId}/{quantity} : This endpoint increases the quantity of a product in the cart of the specified user.
  • PUT /{productId}/{userId}/{quantity} : This endpoint decreases the quantity of a product in the cart of the specified user.
  • PUT/update/{productId}/{userId}/{quantity} : This endpoint increases the quantity of a product in the cart of the specified user.
  • GET /getAllProduct/{userId}/{cartId} : This endpoint retrieves a list of all products in the specified user's cart with the specified cart ID.
  • PUT /remove/{userId} :This endpoint removes all products from the cart for the specified user.

Orders Module

  • POST /{userId}/{cartId} : Creates a new order from the specified cart.Request Body: JSON representation of the Orders object containing information about the new order.
  • GET /{userId}/{orderId} : Retrieves the details of the specified order.Returns: The Orders object containing the details of the specified order.
  • DELETE /{orderId}/{userId} : Deletes the specified order from the system.Returns: The Orders object representing the deleted order.
  • PUT /{orderId}/{status} : Updates the status of the specified order.Returns: The updated Orders object with the status updated.

ProductBill Module

  • POST /{orderId}/{userId}:Adds the billing information for a given order and calculates the total amount payable for the user.Returns a ProductBill object with the updated total amount
  • GET /{billId}/{userId} : Retrieves the billing information for a given bill ID and user ID. Returns a ProductBill object containing the billing information.

some screenshots of the Swagger UI

!ecom ecom1

Screenshot 2023-04-13 100529

Screenshot 2023-04-13 100602

screenshort1

For any feedback, report, suggestions, you can contact with me

Let's Connect...

THANK YOU

ecommerce-web-api's People

Contributors

ujjawalyt avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

niteshpalcode

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.