BookHaven is a comprehensive, full-stack e-commerce application designed for buying and selling books online. It features a robust Spring Boot backend and a dynamic, interactive React frontend, providing a seamless shopping experience for customers and powerful management tools for administrators.
- Enhanced Home Page: A professional, engaging layout featuring a hero section, "New Arrivals" and "Top Rated Books" carousels, and a "Browse by Genre" section.
- Book Cover Images: Book cover images are displayed throughout the application, providing a more visual and engaging experience.
- Book Recommendations: A "You Might Also Like" section on the book details page, suggesting other books by the same author.
- Enhanced User Profile: A redesigned profile page that includes a "My Reviews" section and a "My Wishlist" preview, in addition to editable user information.
- Browse Store: Explore a vast catalog of books with a modern, responsive grid layout.
- Advanced Search: Find books by title, author, publication year range, and price range.
- Wishlist/Favorites: Add books to a personal wishlist to save for later.
- Shopping Cart: Add books to your cart, adjust quantities, and manage your selection.
- Secure Checkout: A multi-step checkout process with shipping address collection and mock payment integration.
- Order Tracking: View order history and track the status of your purchases (Pending, Approved, Delivered).
- Real-time Notifications: Receive instant alerts when your order status changes.
- Live Chat: Communicate directly with administrators in real-time for support via a floating chat widget.
- Comprehensive Admin Dashboard: A unified dashboard with key stats (total books, users, orders), recent order management, and a searchable, paginated inventory management table.
- Order Fulfillment: Approve, Deliver, or Cancel orders. Stock is automatically deducted upon approval.
- Customer Insights: Click on any username in the order list to view their full contact details and shipping address.
- Admin Notifications: Receive alerts whenever a new order is placed.
- Live Chat Interface: A dedicated page to view all user chats and respond in real-time.
- Inventory Management: Add new books, update pricing/stock, and remove outdated items, including book cover image URLs.
- Customer Messages: View inquiries sent by users through the contact form.
- Role-Based Access: Strict security ensuring only admins can access sensitive features.
- React 18: Component-based UI library.
- Bootstrap 5: Responsive styling framework.
- Framer Motion: Production-ready animation library.
- Axios: Promise-based HTTP client.
- React Router: Client-side routing.
- React Stomp Hooks & SockJS: For real-time WebSocket communication.
- React Icons: Comprehensive icon library.
- Java 21: Core programming language.
- Spring Boot 3.5: Application framework.
- Spring Security: Robust authentication and authorization (RBAC).
- Spring WebSocket: For real-time, two-way communication.
- Spring Data MongoDB: NoSQL database integration.
- Maven: Dependency management.
- Java JDK 21+
- Node.js & npm
- MongoDB (running locally on default port 27017)
-
Clone the repository
git clone <repository-url> cd BookApplication
-
Backend Setup Navigate to the root directory and run:
mvn clean install mvn spring-boot:run
The backend server will start on
http://localhost:8080. -
Frontend Setup Open a new terminal, navigate to the frontend folder, and run:
cd frontend npm install npm startThe application will open automatically at
http://localhost:3000.
- Register: Create a new customer account.
- Tip: Include "admin" in your username (e.g.,
superadmin) to automatically register as an Administrator.
- Tip: Include "admin" in your username (e.g.,
- Login: Access your personalized dashboard.
- Shop: Browse books, add them to your cart, and proceed to checkout.
- Chat: Use the floating chat icon to communicate with support.
- Manage: If logged in as Admin, use the Dashboard to fulfill orders and manage inventory.
src/main/java: Spring Boot Backendcontroller: REST & WebSocket Controllers (BookRestController,OrderRestController,AuthRestController,CartRestController,NotificationRestController,ChatController,UserRestController,ReviewRestController)domain: Data Models (Book,User,Order,Cart,Notification,ChatMessage,Review)repo: MongoDB Repositoriesconfig: Security & WebSocket Configuration
frontend: React Frontendsrc/components: UI Components (Home,BookList,Cart,Checkout,AdminDashboard,NotificationDropdown,ChatWidget,AdminChat,Profile,UserReviews,WishlistPreview)src/context: State Management (AuthContext,CartContext)public: Static Assets
This project is licensed under the MIT License.