Skip to content

πŸ“š BookNest: A Library Management System πŸ“š Organize and manage your books and authors effortlessly with BookNest! Built using ASP.NET Core and Entity Framework Core, this project offers robust features like CRUD operations, responsive design with Bootstrap, secure data handling, and more. Perfect for both small and large library collections! πŸ› οΈπŸ”

Notifications You must be signed in to change notification settings

DeepakScripter/BookNest

Repository files navigation

πŸ“š BookNest: A Library Management System

Welcome to BookNest β€” a comprehensive library management system designed to simplify the organization and management of books and authors. Whether you're managing a small personal library or a large collection, BookNest provides all the essential tools you need.

πŸ› οΈ Project Overview

BookNest is a powerful web application built using ASP.NET Core and Entity Framework Core. It allows users to manage books and authors, perform CRUD operations, search through the collection, and ensure data integrity. The project follows the MVC (Model-View-Controller) architecture, promoting a clean, maintainable, and scalable codebase.

🎯 Features

  • πŸ“š Book Management: Create, Read, Update, and Delete (CRUD) operations for books.
  • πŸ‘€ Author Management: Manage author information with full CRUD capabilities.
  • πŸ” Search Functionality: Easily search for books and authors in the collection.
  • πŸ“± Responsive Design: The user interface is built with Bootstrap, ensuring a seamless experience across devices.
  • βœ… Data Validation: Ensures data integrity and consistency with built-in validation.
  • πŸ”’ Security: Protects user data with authentication and secure handling of sensitive information.

πŸ›‘ Prerequisites

Before running this project, ensure you have the following installed:

πŸš€ Getting Started

Follow these steps to get the project up and running on your local machine:

  1. πŸ“₯ Clone the Repository

    git clone https://github.com/your-username/BookNest.git
  2. πŸ“‚ Navigate to the Project Directory

    cd BookNest
  3. πŸ“¦ Restore Dependencies

    dotnet restore
  4. πŸ”„ Update Database

    • Ensure your SQL Server is running.
    • Update the appsettings.json with your database connection string.
    • Run the following command to create the database:
      dotnet ef database update
  5. ▢️ Run the Application

    dotnet run

    The application should now be running on http://localhost:5000.

πŸ“ Architecture

The project follows the MVC (Model-View-Controller) pattern:

  • πŸ“ Model: Represents the application data (e.g., Books, Authors).
  • 🎨 View: Handles the user interface (HTML, CSS, and Razor views).
  • πŸ”§ Controller: Manages the interaction between Model and View, processing user input and returning the appropriate response.

πŸ—ƒοΈ Database Design

The database schema was created using Entity Framework Core's Code-First approach. The main entities are:

  • πŸ“š Book: Represents a book in the library.
  • πŸ‘€ Author: Represents an author who has written one or more books.

πŸ”— Relationships

  • πŸ”„ One-to-Many Relationship: An author can write multiple books, but each book is written by one author.

πŸ›‘οΈ Security

Security is a key consideration in BookNest:

  • βœ”οΈ Data Validation: Ensures that user inputs are correctly formatted and prevents invalid data from being saved.
  • πŸ”‘ Authentication: User authentication is managed through ASP.NET Core Identity, ensuring that only authorized users can access sensitive data.
  • πŸ›‘οΈ SQL Injection Protection: All database interactions are handled through Entity Framework Core, which automatically protects against SQL injection attacks.

πŸ“Š Performance Optimization

Performance is optimized using:

  • πŸ”„ Asynchronous Programming: Improves application responsiveness by handling multiple requests concurrently.
  • βš™οΈ Optimized Queries: Efficient database queries using LINQ, with eager loading to minimize the number of database calls.

πŸ§ͺ Testing

The application is tested using:

  • πŸ” Unit Testing: Ensures that individual components work as expected.
  • πŸ”— Integration Testing: Tests the interaction between different components.
  • πŸ‘¨β€πŸ’» Manual Testing: Ensures the user interface behaves as expected.

πŸ”§ Deployment

The application can be deployed on any platform that supports .NET Core. The recommended deployment method is using Azure App Service for a cloud-based deployment:

  1. βš™οΈ Build the Application
    dotnet publish -c Release
  2. ☁️ Deploy to Azure
    • Use the Azure CLI or Azure Portal to deploy the application.
    • Set up CI/CD pipelines for automated deployment.

πŸ“„ HTML Layout Overview

1. HTML Structure:

  • πŸ“„ : Declares the document type and version of HTML.
  • πŸ”€ : Sets the character encoding to UTF-8.
  • πŸ“± : Ensures responsive design.
  • 🎨 : Links Bootstrap CSS.
  • πŸ’» <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>: Links Bootstrap JS for interactive components.

2. Navbar:

  • πŸ”— navbar, navbar-expand-lg, navbar-dark, bg-dark: Bootstrap classes for styling and responsive behavior.
  • 🏷️ navbar-brand: Brand link.
  • πŸ”² navbar-toggler: Button for mobile view.

3. Form Elements:

  • πŸ› οΈ asp-action: Specifies the action method in the controller.
  • 🎨 form-control: Applies Bootstrap styling to form controls.
  • ❌ text-danger: Styles validation error messages.
  • πŸ–±οΈ btn, btn-dark, btn-primary: Bootstrap button classes for styling.

4. Table:

  • πŸ“Š table, table-striped, table-bordered, table-dark: Bootstrap classes for table styling.

Common Bootstrap Classes:

  • πŸ“¦ container: Centers content and adds responsive padding.
  • πŸ”² row: Creates a horizontal group of columns.
  • πŸ“ col-md-*: Defines column width based on screen size.
  • πŸ”— navbar, navbar-expand-lg, navbar-dark, bg-dark: Navbar styling and behavior.
  • πŸ“‹ form-group: Wraps form controls with margin and padding.
  • 🎨 form-control: Styles input fields, textareas, and selects.
  • πŸ–±οΈ btn, btn-dark, btn-primary: Button styling.
  • πŸ“Š table, table-striped, table-bordered, table-dark: Table styling and behavior.
  • ❌ text-danger: Styles text as red for error messages.

ASP.NET Core Tags:

  • πŸ”§ asp-action: Specifies the action method to handle form submissions.
  • πŸ”— asp-for: Binds form elements to model properties.
  • ❌ asp-validation-for: Displays validation error messages.

πŸ“š EPPlus Library Usage

EPPlus is used to generate Excel files in BookNest. Here's a summary of its usage in the DownloadExcel method:

  1. Fetching Data: Retrieves all books from the bookService.
  2. License Context: Sets the EPPlus license context to NonCommercial for non-commercial use. For commercial use, you need a valid license.
  3. Excel Package Creation: Creates a new Excel package and adds a worksheet named "Books".
  4. Header Row: Sets the first row of the worksheet with column headers such as "Title", "Genre", "ISBN", etc.
  5. Populating Data: Iterates through the list of books and fills the worksheet with data starting from the second row.
  6. Saving the File: Saves the data to a memory stream, which is then returned as a file download response with the appropriate content type for an Excel file.

Additional Notes:

  • EPPlus License: Ensure compliance with the EPPlus license terms. Use LicenseContext.NonCommercial for non-commercial projects or LicenseContext.Commercial with a valid commercial license.
  • Error Handling: Consider adding error handling to manage exceptions during the Excel generation process.

πŸ‘₯ Contributing

We welcome contributions to improve BookNest! To contribute:

  1. 🍴 Fork the repository.
  2. 🌿 Create a new branch for your feature or bugfix.
  3. πŸ”„ Submit a pull request once your changes are complete.

πŸ“„ License

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

πŸ’¬ Contact

For any questions, feel free to reach out via:

About

πŸ“š BookNest: A Library Management System πŸ“š Organize and manage your books and authors effortlessly with BookNest! Built using ASP.NET Core and Entity Framework Core, this project offers robust features like CRUD operations, responsive design with Bootstrap, secure data handling, and more. Perfect for both small and large library collections! πŸ› οΈπŸ”

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published