The Book Haven is a library management system built using ASP.NET Core. It allows librarians and members to manage books, track loans, handle returns, and impose penalties for overdue returns. The system includes features such as:
- Book search and categorization.
- Member management.
- Loan and return tracking.
- Automated penalty system for late returns.
- Book Borrowing: Allows users to borrow books from the library with a predefined loan period and track due dates.
- Book Returning: Users can return borrowed books, with penalties applied for overdue returns.
- Penalty Calculation: Calculates and tracks penalties for books returned after the due date Automatically.
- Book Availability: Updates and tracks the availability of books based on the number of copies available.
- Member Management: Handles basic member information such as adding , removing , and viewing members.
- Book Search: Provides a search functionality for finding available books by title, author, or category.
Entities | Relationship Name | Description |
---|---|---|
Book - Author | WrittenBy | A book can be written by one or more authors. |
Book - Category | BelongsTo | A book can belong to one category. |
Member - Loan | Borrows | A member can borrow multiple loans. |
Book - Loan | Includes | A loan can include one book, but a book can be loaned multiple times. |
Member - Penalty | Incurs | A member may incur penalties for late returns. |
Loan - Penalty | ResultsIn | A loan may result in a penalty if the book is returned late. |
The project follows the N-Tier Architecture, divided into three main layers:
- API Layer: This layer handles HTTP requests, returns responses, and contains controllers for managing requests related to books, members, loans, categories, and penalties.
- Business Logic Layer (BLL): Implements the business logic for handling library operations. This layer processes data, applies rules, and coordinates the interaction between the API and DAL.
- Data Access Layer (DAL): Handles all database operations using Entity Framework Core, and follows the Repository Pattern for data access abstraction.
- Shared Layer: Contains the DTOs (Data Transfer Objects) and AutoMapper profiles used for object mapping between the API and the database.
The Repository Pattern abstracts the data access logic from the business logic, making it easier to manage and modify data access without affecting other layers. Each entity has its own repository interface and implementation, providing a clean way to manage database operations.
The Unit of Work Pattern ensures that changes made to the database in a transaction are coordinated across multiple repositories, preventing partial updates and ensuring data consistency.
The-Book-Haven/
│
├── API
│ ├── Controllers
│ └── Mappings
│
├── BLL
│ ├── Services
│ └── Business Logic
│
├── DAL
│ ├── Repositories
│ ├── UnitOfWork
│ └── DbContext
│
└── Shared
└── DTOs
- Backend: ASP.NET Core MVC, Entity Framework Core
- Database: SQL Server
- Frontend: HTML, CSS, JavaScript, Razor Views
- Version Control: Git
- Clone the repository:
git clone https://github.com/Abdalla7med/The-Book-Haven.git
git clone https://github.com/yourusername/the-book-haven.git
cd the-book-haven
Update the connection string in appsettings.json to match your SQL Server instance. Run the following command to create the database and apply migrations:
dotnet ef database update
Use the following commands to build and run the project:
dotnet build
dotnet run
Once the project is running, navigate to http://localhost:5000 (or as specified in your launch settings) to access the application.
To get a detailed understanding of how to use the system, refer to theUser Manual file.
Search Books: Use the search bar to find books by title, author, or category. Borrow a Book: Navigate to the desired book and click "Borrow." Select the member to assign the loan. Return a Book: Navigate to the member's loan list and select "Return" to register the return and check for penalties. Penalties: The system will automatically calculate penalties for overdue returns and notify the member.
Feel free to fork this repository and submit pull requests to contribute new features or fix bugs. Make sure to follow the contributing guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
For any inquiries or issues, you can reach me at:
GitHub: Abdalla7med Email: abdullah.sherdy.work@gmail.com