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.
- 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 Listing
- Product Details
- Product Categories
- Product Search
- Product Management APIs
- Product Image Handling
- Admin Product Management
- Add products to cart
- Update product quantity
- Remove products from cart
- Calculate cart totals
- Checkout workflow
- Place orders
- View order history
- View individual order details
- Order status management
- Admin order management
- Spring Security
- JWT Authentication
- Role-Based Access Control
- Protected REST APIs
- Admin-only endpoints
- Secure password handling
- Protected frontend routes
- Admin Dashboard
- Manage Products
- Manage Users
- Manage Orders
- Update User Roles
- Protected Admin Routes
- Stripe Payment Integration
- Stripe PaymentIntent API
- Test payment support
Stripe integration is currently in progress.
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 β
ββββββββββββββββββββββββ
- Java
- Spring Boot
- Spring MVC
- Spring Data JPA
- Hibernate
- Spring Security
- JWT
- REST APIs
- Maven
- React.js
- JavaScript
- Vite
- Tailwind CSS
- Axios
- React Router
- React Hook Form
- Lucide React Icons
- PostgreSQL
- Stripe
- IntelliJ IDEA
- VS Code
- Git
- GitHub
- Postman
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
git clone https://github.com/Dinesh-colud/ecommerce-fullstack.git
cd ecommerce-fullstackNavigate to the backend directory:
cd backendCreate 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=trueDo not commit real database passwords, JWT secrets, Stripe keys, or SMTP credentials to GitHub.
Using Maven:
./mvnw spring-boot:runOn Windows:
mvnw.cmd spring-boot:runThe backend will normally start on:
http://localhost:8080
Open another terminal and navigate to:
cd frontendInstall dependencies:
npm installCreate/configure the .env file:
VITE_API_BASE_URL=http://localhost:8080/api
VITE_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_keyStart the React development server:
npm run devThe frontend will normally be available at:
http://localhost:5173
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
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
The backend exposes RESTful APIs for different application modules.
POST /api/auth/signup
POST /api/auth/signin
POST /api/auth/forgot-password
POST /api/auth/reset-password
GET /api/auth/user
GET /api/products
POST /api/products
PUT /api/products/{id}
DELETE /api/products/{id}
GET /api/cart
POST /api/cart
PUT /api/cart
DELETE /api/cart/{id}
POST /api/orders
GET /api/orders
GET /api/orders/{id}
POST /api/payment/create-payment-intent
API endpoints may evolve as development continues.
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.
Project screenshots are available in the images directory.
- π Home / Product Listing
- π Login & Registration
- ποΈ Product Browsing
- π Product Search
- π Shopping Cart
- π³ Checkout
- π¦ Orders
- π€ User Profile
- π¨βπΌ Admin Dashboard
- π¦ Product Management
- π₯ User Management
The REST APIs can be tested using:
- Postman
- Browser
- React Frontend
For backend API testing, verify: Authentication Products Cart Orders Users Payments
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_keyBackend 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.
- Docker containerization
- Cloud deployment
- CI/CD pipeline
- Performance optimization
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
Dinesh Rajbhar
Java Backend / Full Stack Developer
github.com/Dinesh-colud/ecommerce-fullstack
If you find this project useful, consider giving it a β on GitHub.
This project is developed for learning and portfolio purposes.