Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ Full Stack E-Commerce Application

A modern Full Stack E-Commerce Web Application built using React.js, Spring Boot, Spring Security, JWT, PostgreSQL, REST APIs, and Tailwind CSS.

The project follows a real-world full-stack architecture with a separate React frontend and Spring Boot backend. It includes user authentication, product management, shopping cart, order management, admin functionality, and secure backend APIs.

🚧 Project Status: Actively in development β€” Stripe payment integration and some advanced features are in progress.


🌟 Features

πŸ‘€ User Features

  • User Registration
  • User Login / Logout
  • JWT-based Authentication
  • Role-based Authorization
  • User Profile
  • Browse Products
  • Search Products
  • Product Details
  • Add Products to Cart
  • Update Cart Quantity
  • Remove Products from Cart
  • Checkout
  • Order Placement
  • Order History
  • View Order Details
  • Forgot Password / Reset Password

πŸ›οΈ Product Management

  • Product Listing
  • Product Details
  • Product Categories
  • Product Search
  • Product Management APIs
  • Product Image Handling
  • Admin Product Management

πŸ›’ Shopping Cart

  • Add products to cart
  • Update product quantity
  • Remove products from cart
  • Calculate cart totals
  • Checkout workflow

πŸ“¦ Order Management

  • Place orders
  • View order history
  • View individual order details
  • Order status management
  • Admin order management

πŸ” Security

  • Spring Security
  • JWT Authentication
  • Role-Based Access Control
  • Protected REST APIs
  • Admin-only endpoints
  • Secure password handling
  • Protected frontend routes

πŸ‘¨β€πŸ’Ό Admin Features

  • Admin Dashboard
  • Manage Products
  • Manage Users
  • Manage Orders
  • Update User Roles
  • Protected Admin Routes

πŸ’³ Payment

  • Stripe Payment Integration
  • Stripe PaymentIntent API
  • Test payment support

Stripe integration is currently in progress.


πŸ—οΈ Project Architecture

The application follows a client-server architecture:

                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚      React.js        β”‚
                β”‚      Frontend        β”‚
                β”‚                      β”‚
                β”‚ Vite + Tailwind CSS  β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β”‚ REST API
                           β–Ό
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚     Spring Boot      β”‚
                β”‚       Backend        β”‚
                β”‚                      β”‚
                β”‚ Spring Security      β”‚
                β”‚ JWT Authentication   β”‚
                β”‚ REST Controllers     β”‚
                β”‚ Service Layer        β”‚
                β”‚ Repository Layer     β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β”‚ JPA / Hibernate
                           β–Ό
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚     PostgreSQL       β”‚
                β”‚       Database       β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚       Stripe         β”‚
                β”‚  Payment Processing  β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Backend

  • Java
  • Spring Boot
  • Spring MVC
  • Spring Data JPA
  • Hibernate
  • Spring Security
  • JWT
  • REST APIs
  • Maven

Frontend

  • React.js
  • JavaScript
  • Vite
  • Tailwind CSS
  • Axios
  • React Router
  • React Hook Form
  • Lucide React Icons

Database

  • PostgreSQL

Payment

  • Stripe

Development Tools

  • IntelliJ IDEA
  • VS Code
  • Git
  • GitHub
  • Postman

πŸ“ Project Structure

ecommerce-fullstack/ β”‚ β”œβ”€β”€ backend/ β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ main/ β”‚ β”‚ β”‚ β”œβ”€β”€ java/ β”‚ β”‚ β”‚ └── resources/ β”‚ β”‚ β”œβ”€β”€ test/ β”‚ β”‚ └── ... β”‚ β”‚ β”‚ β”œβ”€β”€ pom.xml β”‚ β”œβ”€β”€ mvnw β”‚ └── mvnw.cmd β”‚ β”œβ”€β”€ frontend/ β”‚ β”œβ”€β”€ public/ β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ api/ β”‚ β”‚ β”œβ”€β”€ components/ β”‚ β”‚ β”œβ”€β”€ context/ β”‚ β”‚ β”œβ”€β”€ hooks/ β”‚ β”‚ β”œβ”€β”€ pages/ β”‚ β”‚ β”œβ”€β”€ routes/ β”‚ β”‚ └── ... β”‚ β”‚ β”‚ β”œβ”€β”€ package.json β”‚ β”œβ”€β”€ vite.config.js β”‚ β”œβ”€β”€ tailwind.config.js β”‚ └── ... β”‚ β”œβ”€β”€ images/ β”‚ └── README.md

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/Dinesh-colud/ecommerce-fullstack.git

cd ecommerce-fullstack

βš™οΈ Backend Setup

Navigate to the backend directory:

cd backend

Configure PostgreSQL

Create a PostgreSQL database and configure the database credentials in:

backend/src/main/resources/application.properties

Example:

spring.datasource.url=jdbc:postgresql://localhost:5432/ecommerce
spring.datasource.username=your_username
spring.datasource.password=your_password

spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true

Do not commit real database passwords, JWT secrets, Stripe keys, or SMTP credentials to GitHub.

Run Backend

Using Maven:

./mvnw spring-boot:run

On Windows:

mvnw.cmd spring-boot:run

The backend will normally start on:

http://localhost:8080

🎨 Frontend Setup

Open another terminal and navigate to:

cd frontend

Install dependencies:

npm install

Create/configure the .env file:

VITE_API_BASE_URL=http://localhost:8080/api
VITE_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key

Start the React development server:

npm run dev

The frontend will normally be available at:

http://localhost:5173

πŸ”„ Application Workflow

User
 β”‚
 β–Ό
React Frontend
 β”‚
 β”‚ Axios
 β–Ό
Spring Boot REST API
 β”‚
 β”œβ”€β”€ Spring Security
 β”‚       β”‚
 β”‚       └── JWT Authentication
 β”‚
 β”œβ”€β”€ Controller
 β”‚
 β”œβ”€β”€ Service
 β”‚
 β”œβ”€β”€ Repository
 β”‚
 β–Ό
PostgreSQL

For checkout:

User
 β”‚
 β–Ό
Cart
 β”‚
 β–Ό
Checkout
 β”‚
 β–Ό
Order Creation
 β”‚
 β–Ό
Stripe PaymentIntent
 β”‚
 β–Ό
Payment Confirmation
 β”‚
 β–Ό
Order Completed

πŸ” Authentication & Authorization

The application uses Spring Security with JWT-based authentication.

Authentication flow:

1. User registers
       ↓
2. User logs in
       ↓
3. Backend validates credentials
       ↓
4. JWT is generated
       ↓
5. Client maintains authenticated session
       ↓
6. Protected API requests are authorized

Role-based authorization is used to separate normal user functionality from admin functionality.

Example:

USER
 β”œβ”€β”€ Browse Products
 β”œβ”€β”€ Manage Cart
 β”œβ”€β”€ Place Orders
 └── View Orders

ADMIN
 β”œβ”€β”€ Manage Products
 β”œβ”€β”€ Manage Users
 └── Manage Orders

πŸ”Œ REST API

The backend exposes RESTful APIs for different application modules.

Authentication

POST   /api/auth/signup
POST   /api/auth/signin
POST   /api/auth/forgot-password
POST   /api/auth/reset-password
GET    /api/auth/user

Products

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

Cart

GET    /api/cart
POST   /api/cart
PUT    /api/cart
DELETE /api/cart/{id}

Orders

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

Payments

POST   /api/payment/create-payment-intent

API endpoints may evolve as development continues.


πŸ’³ Stripe Payment Integration

The project uses Stripe PaymentIntent for payment processing.

The integration is designed around the following flow:

Frontend
   β”‚
   β–Ό
Checkout
   β”‚
   β–Ό
Spring Boot Backend
   β”‚
   β–Ό
Stripe PaymentIntent
   β”‚
   β–Ό
Payment Confirmation

Stripe secret keys must remain on the backend and should never be exposed in the React frontend.

For frontend configuration, only the Stripe publishable key should be used.


πŸ–ΌοΈ Screenshots

Project screenshots are available in the images directory.

Application Screens

  • 🏠 Home / Product Listing
  • πŸ” Login & Registration
  • πŸ›οΈ Product Browsing
  • πŸ”Ž Product Search
  • πŸ›’ Shopping Cart
  • πŸ’³ Checkout
  • πŸ“¦ Orders
  • πŸ‘€ User Profile
  • πŸ‘¨β€πŸ’Ό Admin Dashboard
  • πŸ“¦ Product Management
  • πŸ‘₯ User Management

πŸ§ͺ Testing

The REST APIs can be tested using:

  • Postman
  • Browser
  • React Frontend

For backend API testing, verify: Authentication Products Cart Orders Users Payments

πŸ”’ Environment Variables

Sensitive configuration should be stored using environment variables or local configuration files.

Example frontend:

VITE_API_BASE_URL=http://localhost:8080/api
VITE_STRIPE_PUBLISHABLE_KEY=your_key

Backend configuration should include values such as: Database URL Database Username Database Password JWT Secret Stripe Secret Key Mail Configuration

Never commit real credentials to GitHub.

🚧 Future Enhancements

  • Docker containerization
  • Cloud deployment
  • CI/CD pipeline
  • Performance optimization

πŸ“š Learning Objectives

This project was developed to gain practical experience with:

  • Full-stack application architecture
  • REST API development
  • Spring Boot
  • Spring Security
  • JWT authentication
  • Role-based authorization
  • JPA/Hibernate
  • PostgreSQL
  • React.js
  • State management using React Context
  • Axios API integration
  • React Router
  • Tailwind CSS
  • Form handling and validation
  • Payment gateway integration
  • Git and GitHub

πŸ‘¨β€πŸ’» Author

Dinesh Rajbhar

Java Backend / Full Stack Developer

GitHub

github.com/Dinesh-colud

Project Repository

github.com/Dinesh-colud/ecommerce-fullstack


⭐ Support

If you find this project useful, consider giving it a ⭐ on GitHub.


πŸ“„ License

This project is developed for learning and portfolio purposes.

About

Full Stack E-Commerce Application built with React, Spring Boot, Spring Security (JWT), PostgreSQL, REST APIs, and Stripe Payment Integration (In Progress).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages