DEV Community

Cover image for Building ShopEase: My Journey From a Basic E-Commerce App to a Spring Boot Backend
Shitanshu Jha
Shitanshu Jha

Posted on

Building ShopEase: My Journey From a Basic E-Commerce App to a Spring Boot Backend

Building ShopEase: My Journey From a Basic E-Commerce App to a Spring Boot Backend

By Shitanshu Jha

**πŸ‘‹ Hi, I'm Shitanshu Jha

I'm a BCA student and Java Developer focused on backend development and building real-world applications with Java, Spring Boot, REST APIs, MySQL, and Spring Security.**

I'm currently pursuing my Bachelor of Computer Applications at Guru Gobind Singh Indraprastha University (GGSIPU). While learning software development, I wanted to move beyond small practice programs and understand how a complete application is actually designed, connected, secured, tested, and developed over time.

That's what led me to build ShopEase.

ShopEase is a full-stack e-commerce application that I'm developing module by module, starting from basic product management and gradually adding authentication, authorization, cart management, wishlist, checkout, orders, and payment integration. The project currently has a Java/Spring Boot backend, JavaScript frontend, MySQL database, JWT authentication, role-based authorization, and several integrated modules.**

How I built and evolved a full-stack e-commerce application using Java, Spring Boot, MySQL, JavaScript, JWT authentication, and REST APIs.
When I started building ShopEase, my goal wasn't to create a perfect e-commerce application from day one.

I wanted to understand what actually happens behind a real application β€” how the frontend communicates with a backend, how data is stored, how authentication works, how users are authorized, and how different features come together into one system.

ShopEase started as an e-commerce project and gradually evolved into a much larger full-stack application.

Today, it has a Java + Spring Boot backend, a JavaScript frontend, MySQL database integration, JWT authentication, role-based authorization, persistent cart and wishlist functionality, checkout and order management, validation, DTOs, and centralized exception handling.
πŸ› οΈ Tech Stack
Frontend
HTML
CSS
JavaScript
Fetch API
LocalStorage
Backend
Java
Spring Boot
Spring MVC
Spring Data JPA
Hibernate
Spring Security
JWT
BCrypt
Jakarta Validation
Database
MySQL
Tools
Eclipse
Postman
XAMPP
Git
GitHub
πŸ—οΈ The Architecture

The basic architecture of ShopEase looks like this:

                ShopEase
                   β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚                         β”‚
  FRONTEND                   BACKEND
      β”‚                         β”‚
HTML / CSS / JS            Spring Boot
      β”‚                         β”‚
  Fetch API               Spring MVC
      β”‚                         β”‚
   api.js               Spring Security
      β”‚                         β”‚
      └────── REST API β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
                  JWT
                   β”‚
                 MySQL
Enter fullscreen mode Exit fullscreen mode

The frontend communicates with the Spring Boot backend through REST APIs, while authentication is handled using JWT.

πŸ“¦ 1. Building the Product System

The product module was one of the first major parts of ShopEase.

On the frontend, I implemented product cards containing information such as:

Product image
Name
Brand
Description
Price
Old price
Discount
Rating
Stock status
Add to cart
View details

On the backend, the product system includes:

Product Entity
Repository
Service
Controller
MySQL integration
JPA/Hibernate
CRUD operations
DTOs
Validation
Exception handling

The main REST APIs are:

GET /products
GET /products/{id}
POST /products
PUT /products/{id}
DELETE /products/{id}

The data flows from the frontend through the Fetch API to the controller, service, repository and finally MySQL before returning a JSON response to the frontend.

πŸ” 2. Authentication with Spring Security and JWT

This was one of the more important parts of the project.

I implemented:

User registration
Login
BCrypt password encoding
JWT generation
JWT validation
JWT authentication filter
Protected APIs
Role-based authorization

The login flow looks like:

Login Form
↓
POST /users/login
↓
UserService
↓
BCrypt Verification
↓
JWT Generation
↓
Token Response
↓
LocalStorage

For protected requests, the frontend automatically sends:

Authorization: Bearer

The backend then validates the JWT through the authentication filter and Spring Security context.

πŸ‘₯ 3. Role-Based Authorization

I didn't want authentication to simply mean β€œthe user is logged in.”

Different users should have different permissions.

ShopEase currently has USER and ADMIN roles.

For example:

USER
↓
Protected API
↓
Unauthorized operation
↓
403 Forbidden

while:

ADMIN
↓
Protected Admin API
↓
Allowed

This is used for operations such as product and specification management.

πŸ›’ 4. Building a Persistent Shopping Cart

The cart was where the frontend and backend really started behaving like one application.

The backend contains:

User
↓
Cart
↓
CartItem
↓
Product

The cart supports:

Add product
View cart
Update quantity
Remove item
Stock validation
Quantity validation
Subtotal
Total
Total item count

The APIs are:

POST /cart
GET /cart
PUT /cart/{itemId}
DELETE /cart/{itemId}

The important part was making the cart persistent.

If a user adds a product, logs out, and later logs in again, the cart is restored from the database instead of being lost.

🀍 5. Adding Wishlist Functionality

After the cart, I implemented a user-specific persistent wishlist.

The backend provides:

POST /wishlist/{productId}
GET /wishlist
DELETE /wishlist/{itemId}

The frontend includes:

Wishlist button
Wishlist count
Wishlist drawer
Product cards
Add/remove functionality
Wishlist state synchronization
Empty wishlist UI

I also added duplicate-product handling and ownership validation.

The wishlist module is currently fully integrated and tested.

🧾 6. DTOs, Validation and Exception Handling

As the project became bigger, I realized that directly exposing entities through APIs wasn't a good approach.

So I introduced DTOs such as:

ProductRequestDTO
ProductResponseDTO

UserRequestDTO
UserResponseDTO

LoginRequestDTO
LoginResponseDTO

AddToCartRequestDTO
UpdateCartItemDTO

CartItemResponseDTO
CartResponseDTO

The purpose was to separate the API layer from the entity layer and control exactly what data enters and leaves the application.

I also implemented Jakarta Validation with annotations such as:

@notblank
@NotNull
@positive
@min
@max

and created a centralized GlobalExceptionHandler for validation, authentication, product, stock and cart-related errors.

🧾 7. Checkout and Orders

The project has now moved beyond just shopping-cart functionality.

Checkout and order management are implemented and tested.

The current flow is:

USER
↓
Cart
↓
Checkout
↓
POST /orders
↓
Order Success
↓
Order Details
↓
My Orders
↓
Order History

The backend supports:

POST /orders
GET /orders
GET /orders/{id}

It also handles user-specific order history and order-status transitions.

🚧 What's Next?

The next major target is payment integration.

I'm currently planning the Razorpay integration around:

Payment order creation
Payment verification
Payment status handling
Order-payment integration
Successful payment handling
Failed payment handling
Payment security
Payment testing

The frontend will also have payment initiation and success/failure handling.

After that, the longer-term roadmap includes production hardening, automated testing, Docker, CI/CD, deployment, and eventually more advanced architecture such as microservices and event-driven communication.

🧠 What I'm Learning From ShopEase

The biggest thing I've learned from this project is that building a real application is very different from writing isolated code.

A feature isn't finished when the Java class compiles.

It has to go through a complete workflow:

Backend Development
↓
API Testing
↓
Frontend Development
↓
API Integration
↓
Full Feature Testing
↓
Bug Fixing
↓
Git Commit
↓
Git Push

That process has become an important part of how I'm developing ShopEase.

πŸš€ What's Next for ShopEase?

The final goal is to take ShopEase from a learning project toward a production-oriented full-stack e-commerce application.

The long-term architecture is planned around:

Frontend
↓
Spring Boot Backend
↓
MySQL
↓
JWT Authentication
↓
Role-Based Authorization
↓
Cart + Wishlist
↓
Checkout
↓
Orders
↓
Payment
↓
Admin Dashboard
↓
Inventory
↓
Testing
↓
Docker
↓
CI/CD
↓
Cloud Deployment

The project is being developed module by module, with backend development, frontend integration, testing and Git commits forming the development workflow

ShopEase is still a work in progress.

I'm not trying to rush toward calling it β€œproduction-ready.” There are still important areas left to build, including payment integration, automated testing, Docker, CI/CD, deployment and production hardening.

For me, that's actually the point of the project.

I'm using ShopEase to understand how a real full-stack application grows from individual features into a complete system β€” one module at a time.

GitHub: github.com/Shitanshu686
Portfolio: shitanshu686.github.io/ShitanshuJhaaaa/
LinkedIn: linkedin.com/in/shitanshu-jha-738012342/

Top comments (0)