Wellness Cart
A backend-driven e-commerce system focused on cart ownership, order lifecycle integrity, and role-based access control.
Short Explanation
Wellness Cart is a full-stack e-commerce system designed around backend correctness rather than UI flows. It enforces one-cart-per-user ownership, stateless JWT-based authentication, and state-driven order processing with immutable audit history, ensuring data integrity across the Cart → Order lifecycle.
Project Goals
The goal of this project was to design a backend-first e-commerce system with clear domain boundaries, enforced cart ownership, and state-driven order processing. The project emphasizes stateless authentication, role-based access control, and immutable order history to ensure data consistency, traceability, and long-term maintainability.
Tech Stack Used
- React.js: Implemented user and admin interfaces aligned with backend authorization rules and state-driven flows.
- Tailwind CSS: Styled the application with responsive layouts and consistent design patterns.
- Spring Boot: Built secure, modular REST APIs with JWT authentication and role-based access control.
- MySQL: Modeled and managed relational data for core eCommerce workflows such as cart and order processing.
- Postman: Validated API contracts, authentication flows, and error scenarios before frontend integration.
Features
State-Driven Order Lifecycle
Implements an explicit order state machine to manage lifecycle transitions, enforce backend ownership rules, and maintain immutable audit logs for complete traceability of user and admin actions.
Stateless Authentication & Role-Based Access Control
Uses JWT-based stateless authentication with Spring Security, clear 401/403 access semantics, and token versioning to invalidate active sessions and securely enforce user and admin permissions.
Cart Ownership & Domain Invariants
Models the Cart as a domain aggregate with strict ownership and invariant enforcement, preventing invalid cart states during item mutation and enabling a safe, one-way transition from Cart to Order.
Controlled Product & Catalog State Management
Defines explicit product availability and mutation rules through admin-managed state changes and auditable updates, ensuring consistent catalog behavior under concurrent access.
Demo Previews
Click any preview to watch in full width.
Video Demo
For the feature demo, watch it below:
The Problems and How I Deal With It
- Handling authentication and logout securely in a stateless system without relying on server-side sessions.
- Preventing multiple active carts per user and avoiding ownership conflicts during checkout.
- Ensuring order lifecycle correctness and avoiding invalid or skipped state transitions.
- Maintaining data integrity during concurrent cart and product mutations.
- Preserving order integrity when products are modified or removed from the catalog.
- Clearly separating user and admin capabilities to avoid unauthorized access or accidental data corruption.
- Providing traceability for critical actions (order updates, cancellations, status changes) without allowing historical data mutation.
Lessons Learned
- Designing explicit domain boundaries and invariants early prevents complexity from leaking across services and controllers.
- State machines make complex workflows easier to reason about than scattered conditional logic.
- Stateless authentication simplifies horizontal scalability but requires deliberate strategies for secure logout and token invalidation.
- Auditability and immutability should be designed upfront, as retrofitting them later introduces significant complexity.