An ASP.NET Core 9.0 MVC application for managing a small library. Users can browse the catalog, borrow and return books, manage their profiles and addresses, and administrators can monitor inventory and generate Excel-style reports.
- Public catalog with search and detailed book pages that include cover images and publication data.
- User authentication with session-based login/logout and active/inactive user handling.
- Borrowing workflow to check out and return books, with stock tracking and per-user status visibility.
- Address and profile management for storing user details alongside library activity.
- Reports that export borrowing and inventory data via ClosedXML.
- Random motivational quotes on the home page using Quotable/DummyJSON as fallbacks.
- Framework: ASP.NET Core 9.0 MVC
- Data access: Entity Framework Core 9 with SQL Server
- Object mapping: AutoMapper
- Exports: ClosedXML
- Session management: Built-in ASP.NET Core session middleware
- .NET 9 SDK
- SQL Server instance reachable from the app
- Copy
BooksApi/appsettings.jsontoBooksApi/appsettings.Development.json(already present) if you want environment-specific settings. - Update
ConnectionStrings:DefaultConnectionto point to your SQL Server.
"ConnectionStrings": {
"DefaultConnection": "Server=localhost,1433;Database=BookDb;User Id=sa;Password=YourPassword;TrustServerCertificate=True;"
}cd BooksApi
dotnet restore
dotnet ef database updateThe dotnet ef command applies migrations from the Migrations/ folder to create the required tables (Books, Users, Addresses, Borrow).
cd BooksApi
dotnet runThe site defaults to https://localhost:5001 (or the console output port). Static assets (covers, CSS, JS) are served from wwwroot.
BooksApi/Program.cs– dependency injection setup, session middleware, routing, static assets.BooksApi/Data/AppDbContext.cs– EF Core context for books, users, addresses, and borrow records.BooksApi/Models/– entity models such asBooksModel,UserModel,AddressModel,BorrowModel.BooksApi/Controllers/– MVC controllers for home, books, borrowing, users, employers, reports, and clients.BooksApi/Services/– domain services for authentication, session handling, borrowing logic, reporting, and CRUD operations.BooksApi/Views/– Razor views for pages and components;wwwroot/contains static assets.
dotnet test– run any available tests in the solution.dotnet ef migrations add <Name>– add a new database migration.dotnet ef database update– apply migrations to the configured database.
Provide licensing terms here if applicable.