A comprehensive REST API powering a full-featured e-commerce platform. Handles products, customers, sellers, carts, and orders — with robust session-based authentication at every layer.
Built with a modern, production-ready Java ecosystem designed for scalability and maintainability.
The platform is designed around six domain-driven modules connected through a clean REST layer with session-based auth.
Session-based authentication with 1-hour token expiry. Separate login flows for Customers and Sellers with secure registration and logout.
Full customer lifecycle — profile management, address handling, credit card updates, password resets, and order history tracking.
Administrator role with product catalog control. Sellers manage inventory, view customers, and track orders across the platform.
Complete product CRUD — category browsing, seller-specific listings, quantity management, and detail updates.
Persistent shopping cart with add, remove, view, and clear operations. Linked to authenticated customer sessions.
End-to-end order lifecycle — place from cart, update pending orders, cancel, and query by date. Full order history with details.
30+ RESTful endpoints organized by module. Click any module to explore its routes.
// Request Body { "mobileId": "9999999999", "password": "abhi8080" } // Response — 200 OK { "sessionId": 23, "token": "customer_0ad57094", "userId": 19, "userType": "customer", "sessionStartTime": "2022-06-10T10:48:20", "sessionEndTime": "2022-06-10T11:48:20" }
Enterprise-grade authentication and role-based access control baked into every endpoint.
Every API call is validated against a session token with 1-hour expiry. No token = no access.
Customers and Sellers have distinct auth flows, permissions, and data access scopes throughout the system.
Robust request validation at every step — mobile number, email format, password strength, and required fields.
JPA/Hibernate handles entity mapping, relationships, and auto schema generation with production-ready queries.
Auto-generated interactive API documentation at /swagger-ui/index.html for easy testing and exploration.
Complete Entity-Relationship diagram included in the repository, documenting all table relationships visually.
Get the API running locally in under 5 minutes.
Pull the project from GitHub to your local machine.
git clone https://github.com/abhishek2k21/E-Commerce-Backend.git cd E-Commerce-Backend
Update application.properties with your MySQL credentials.
server.port=8080 spring.datasource.url=jdbc:mysql://localhost:3306/ecommercedb spring.datasource.username=root spring.datasource.password=root
Start the Spring Boot server. The API will be available at localhost:8080 and Swagger docs at /swagger-ui/index.html.
mvn spring-boot:run
Import the endpoints into Postman and start testing. Register a customer first, login to get a session token, then explore all modules.