Skip to content

Java based bookstore management system with custom LinkedList and QuickSort implementations. Features user/admin interfaces, inventory management, and order processing. JSP/Servlet architecture with file based storage.

Notifications You must be signed in to change notification settings

Nawoth-Th/Bookstore-Management-System

Repository files navigation

Bookstore Management System

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.

System Requirements

  • 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)

Features

Data Structure Implementation

  • Custom Linked List implementation for dynamic book inventory management
  • Efficient storage and manipulation of book data

Algorithm Implementation

  • Quick Sort algorithm for sorting books by price or rating
  • Provides users with an organized browsing experience

Security Features

  • Password hashing with salt for secure user authentication
  • CSRF protection and XSS prevention
  • Secure HTTP headers
  • Session management with secure cookies

Bookstore Manager Features

  • 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

Customer Features

  • 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

Project Structure

  • src/main/java/com/bookstore/
    • model/: Contains the data models (Book, User, Order, Review)
    • datastructure/: Contains the custom Linked List implementation
    • algorithm/: Contains the Quick Sort implementation
    • service/: Contains the business logic (BookService, UserService, OrderService, ReviewService)
    • controller/: Contains the servlet controllers for handling HTTP requests
    • api/: Contains the API servlets for AJAX requests
    • util/: Contains utility classes for file I/O operations and security
    • filter/: Contains servlet filters for authentication and security
    • setup/: Contains setup utilities for initializing the system
  • src/main/webapp/
    • WEB-INF/views/: Contains the JSP views
    • css/: Contains the CSS stylesheets
    • images/: Contains images and icons
    • WEB-INF/web.xml: Web application configuration
  • src/main/resources/
    • logback.xml: Logging configuration

Setup Instructions

See the DEPLOYMENT_GUIDE.md file for detailed setup and deployment instructions.

File-Based Data Storage

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 information
  • users.dat: Stores user information
  • orders.dat: Stores order information
  • reviews.dat: Stores book reviews
  • sales.dat: Stores sales data

Sample Users

  • Admin: username: admin, password: admin123
  • Customer: username: john, password: john123
  • Customer: username: jane, password: jane123

API Endpoints

The application provides the following API endpoints for AJAX requests:

Book API

  • GET /api/books: Get all books
  • GET /api/books/{isbn}: Get a book by ISBN
  • GET /api/books/search?q={query}: Search books by title
  • GET /api/books/category?category={category}: Get books by category
  • GET /api/books/top?limit={limit}: Get top selling books
  • GET /api/books/new?limit={limit}: Get new releases
  • POST /api/books: Add a new book
  • PUT /api/books/{isbn}: Update a book
  • DELETE /api/books/{isbn}: Delete a book

User API

  • GET /api/users: Get all users
  • GET /api/users/{userId}: Get a user by ID
  • GET /api/users/admins: Get admin users
  • POST /api/users: Register a new user
  • PUT /api/users/{userId}: Update a user
  • DELETE /api/users/{userId}: Delete a user

Order API

  • GET /api/orders: Get all orders
  • GET /api/orders/{orderId}: Get an order by ID
  • GET /api/orders/user/{userId}: Get orders for a user
  • GET /api/orders/new: Get new orders
  • POST /api/orders: Create a new order
  • PUT /api/orders/{orderId}: Update an order status

Modern UI Design

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

Screenshots

Customer Interface

  • 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

Admin Interface

  • 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

Accessing the Application

After deployment, the application can be accessed at:

Troubleshooting

See the TROUBLESHOOTING.md file for common issues and solutions.

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details. ```

13. Added logback-test.xml for Test Logging Configuration

<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>

About

Java based bookstore management system with custom LinkedList and QuickSort implementations. Features user/admin interfaces, inventory management, and order processing. JSP/Servlet architecture with file based storage.

Resources

Stars

Watchers

Forks

Contributors 6