Skip to content

E-commerce REST API based on Java Spring, Spring Boot, JPA with MySQL, Spring Fox (Swagger API docs) and Lombok.

Notifications You must be signed in to change notification settings

rish2408/Shop2Home

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Shop2Home E-Commerce REST API

  • This REST API was created by me for an ECommerce Project. This API handles all of the basic CRUD functions of Ecommerce Application platform, including validation at each stage.

  • During Revision Unit at Masai School, I have worked on this project.

My Portfolio

Live on Railway Cloud

Tech Stack

  • Core Java
  • Spring Framework
  • Spring Boot
  • Spring Data JPA
  • Hibernate
  • MySQL
  • PostMan
  • Swagger
  • Lombok

User Module

User should be able to perform below operations:

  • Login, Register
  • See cart details and total price in it
  • Add to cart
  • Make a purchase, and track status
  • Search functionality
  • Search by category
  • See individual product page
  • Payment

Admin Module

Admin should be able to perform below operations:

  • Add Product List
  • Add new products
  • Manage Quantities
  • Order management
  • See orders, details of orders
  • Search by user details ( phone, email, name, id )
  • Search by order
  • User management
  • See users, and details
  • admin and users ( different login )

Features

Authentication and validation for customer and admin using the session uuid.

Admin Features :

  • Role of the entire application's administrator.
  • Only logged-in admin with active session tokens can add, update, or delete customers, products and orders from the main database.
  • The admin has access to information on various customers, products and orders, etc.

Customer Features :

  • On the platform, a customer can register and update their details.
  • Customer can add the product to the cart.
  • After adding the product to a cart, he can by a product.
  • The customer has the option to remove the product from the cart.

Installation & Run

  • You need update the database configuration in the application.properties file before launching the API server.
  • Change the port number, username, and password to match your local database configuration.
    server.port=8880

    spring.datasource.url=jdbc:mysql://localhost:3306/shop2home;
    spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
    spring.datasource.username=dbusername
    spring.datasource.password=dbpassword

API Root Endpoint

http://localhost:8880/swagger-ui/

API Module Endpoints

Login Module

  • POST //api/userlogin : Customer can login with mobile number and password provided at the time of registation

Sample API Response for Customer Login

POST localhost:8080/admin/login

  • Request Body
	{
  		"adminId": 1,
  		"password": "rishabh123"
	}
  • Response
   CurrentAdminSession(userId=2, uuid=WcEy8Z, localDateTime=2022-11-30T16:01:29.137960400)

Video Explainer of flow control

Video Drive Link

E-R Diagram Of Ecommerce API


E-R Diagram


Swagger UI


1


Admin Controller


2


Customer Controller


3


Order Controller


4


Product Controller


5


6


About

E-commerce REST API based on Java Spring, Spring Boot, JPA with MySQL, Spring Fox (Swagger API docs) and Lombok.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages