A comprehensive Java web-based Online Bookstore Management System with a modern UI design. This system implements core data structures and algorithms while providing a user-friendly web interface for both bookstore managers and customers.
- Java Development Kit (JDK) 22
- Apache Tomcat 11.x
- IntelliJ IDEA Ultimate Edition (recommended) or any Java IDE
- Maven 3.8.x or later
- Modern web browser (Chrome, Firefox, Safari, Edge)
- Custom Linked List implementation for dynamic book inventory management
- Efficient storage and manipulation of book data
- Quick Sort algorithm for sorting books by price or rating
- Provides users with an organized browsing experience
- Password hashing with salt for secure user authentication
- CSRF protection and XSS prevention
- Secure HTTP headers
- Session management with secure cookies
- Inventory Management: Add, edit, and delete books with detailed information
- Inventory Status: View total books available, monthly sales figures, and registered customer details
- Order Management: View and update order statuses (Pending, Shipped, Delivered, Cancelled)
- User Management: Manage user accounts and permissions
- Analytics Dashboard: View sales trends and top-selling books
- Book Browsing: View available books through a responsive web interface
- Advanced Search: Search for books by title, author, category, and price range
- Book Recommendations: Get personalized book recommendations
- User Accounts: Create accounts and log in securely
- Shopping Cart: Add books to cart and proceed to checkout
- Order History: View order history and order details
- Reviews: Add and view book reviews
- Favorites: Save books to a favorites list
src/main/java/com/bookstore/model/: Contains the data models (Book, User, Order, Review)datastructure/: Contains the custom Linked List implementationalgorithm/: Contains the Quick Sort implementationservice/: Contains the business logic (BookService, UserService, OrderService, ReviewService)controller/: Contains the servlet controllers for handling HTTP requestsapi/: Contains the API servlets for AJAX requestsutil/: Contains utility classes for file I/O operations and securityfilter/: Contains servlet filters for authentication and securitysetup/: Contains setup utilities for initializing the system
src/main/webapp/WEB-INF/views/: Contains the JSP viewscss/: Contains the CSS stylesheetsimages/: Contains images and iconsWEB-INF/web.xml: Web application configuration
src/main/resources/logback.xml: Logging configuration
See the DEPLOYMENT_GUIDE.md file for detailed setup and deployment instructions.
This application uses file-based storage for all data (books, users, orders). The data is stored in the following location:
- Windows:
C:\Users\<username>\bookstore_data\ - macOS/Linux:
/Users/<username>/bookstore_data\
The following files are used for data storage:
books.dat: Stores book informationusers.dat: Stores user informationorders.dat: Stores order informationreviews.dat: Stores book reviewssales.dat: Stores sales data
- Admin: username:
admin, password:admin123 - Customer: username:
john, password:john123 - Customer: username:
jane, password:jane123
The application provides the following API endpoints for AJAX requests:
GET /api/books: Get all booksGET /api/books/{isbn}: Get a book by ISBNGET /api/books/search?q={query}: Search books by titleGET /api/books/category?category={category}: Get books by categoryGET /api/books/top?limit={limit}: Get top selling booksGET /api/books/new?limit={limit}: Get new releasesPOST /api/books: Add a new bookPUT /api/books/{isbn}: Update a bookDELETE /api/books/{isbn}: Delete a book
GET /api/users: Get all usersGET /api/users/{userId}: Get a user by IDGET /api/users/admins: Get admin usersPOST /api/users: Register a new userPUT /api/users/{userId}: Update a userDELETE /api/users/{userId}: Delete a user
GET /api/orders: Get all ordersGET /api/orders/{orderId}: Get an order by IDGET /api/orders/user/{userId}: Get orders for a userGET /api/orders/new: Get new ordersPOST /api/orders: Create a new orderPUT /api/orders/{orderId}: Update an order status
The application features a modern, responsive UI design with the following characteristics:
- Clean and minimalist design
- Responsive layout that works on all device sizes
- Consistent color scheme and typography
- User-friendly navigation
- Interactive elements with hover effects
- Accessible design with proper contrast and focus states
- Home Page: Displays featured books, categories, and a search bar
- Book Details: Shows book information, reviews, and purchase options
- Shopping Cart: Allows users to manage their selected books
- Checkout: Provides a streamlined checkout process
- Order History: Shows past orders and their status
- Dashboard: Displays key metrics and recent orders
- Book Management: Allows adding, editing, and deleting books
- Order Management: Shows all orders with status update options
- User Management: Displays all users with admin privilege options
After deployment, the application can be accessed at:
See the TROUBLESHOOTING.md file for common issues and solutions.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details. ```
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="com.bookstore" level="DEBUG" />
<root level="INFO">
<appender-ref ref="CONSOLE" />
</root>
</configuration>