A secure and scalable ASP.NET Core Web API for managing library data including books, users, roles, and transactions.
Built using Entity Framework Core, ASP.NET Identity, JWT Authentication, and follows Clean Architecture principles.
- ✅ User Authentication & Authorization with JWT and ASP.NET Identity
- 📘 Book & Library Management (CRUD operations)
- 🧩 Role-based Access Control
- 🔐 Token security with encryption and claims
- 🔍 Filtering, Searching, Sorting, Pagination
- 🧾 Swagger UI for testing endpoints
- 📊 Centralized Logging via NLog
- 🔁 Layered Clean Architecture (Service/Repo/API Separation)
- 📦 DTO Mapping using AutoMapper
Layer | Technology |
---|---|
Framework | ASP.NET Core 6.0 |
ORM | Entity Framework Core |
Database | SQL Server |
Auth | ASP.NET Identity + JWT |
Docs | Swagger (Swashbuckle) |
Logging | NLog |
Mapping | AutoMapper |
Controllers/
: RESTful endpoints for HTTP communicationMiddlewares/
: Global error handling, JWT validationExtensions/
: Service and middleware setup helpersHelper/
: Token creation and encryption utilities
Located in Library.Service/
:
BookService/
: Business logic for booksUserService/
: Manages users and rolesTransactionService/
: Borrow and return operationsTokenService/
: Handles JWT token creation and refreshingDtos/
: Each service has its own DTOs to decouple data models
Library.Repository/
: Contains repositories that interact with the database using EF Core
Library.Data/
:Entities/IdentityEntities/
: Identity user/role entitiesMigrations/
: EF Core migration files
Program.cs
: Main app entry point (DI setup, Middleware, App config)appsettings.json
: DB connection strings, JWT keys, and app secrets
git clone https://github.com/kareemwaleed266/library-management-api.git
cd library-management-api/Library