https://github.com/kareemwaleed266/library-management-system-api
A secure ASP.NET Core Web API for managing library books, users, and roles with JWT authentication and EF Core.
https://github.com/kareemwaleed266/library-management-system-api
aspnetcore backend-api entityframework jwt-authentication library-management-system-api sqlserver
Last synced: about 1 month ago
JSON representation
A secure ASP.NET Core Web API for managing library books, users, and roles with JWT authentication and EF Core.
- Host: GitHub
- URL: https://github.com/kareemwaleed266/library-management-system-api
- Owner: kareemwaleed266
- Created: 2025-06-28T09:23:46.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-06-28T10:22:39.000Z (11 months ago)
- Last Synced: 2025-06-28T10:31:33.974Z (11 months ago)
- Topics: aspnetcore, backend-api, entityframework, jwt-authentication, library-management-system-api, sqlserver
- Language: C#
- Homepage:
- Size: 7.59 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Library Management System API
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.
---
## ๐ Features
- โ
**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
---
## ๐ ๏ธ Tech Stack
| 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 |
---
## ๐งฑ Project Structure Overview
### **Presentation Layer** โ (API)
- `Controllers/`: RESTful endpoints for HTTP communication
- `Middlewares/`: Global error handling, JWT validation
- `Extensions/`: Service and middleware setup helpers
- `Helper/`: Token creation and encryption utilities
---
### **Business Layer** โ (Services)
Located in `Library.Service/`:
- `BookService/`: Business logic for books
- `UserService/`: Manages users and roles
- `TransactionService/`: Borrow and return operations
- `TokenService/`: Handles JWT token creation and refreshing
- `Dtos/`: Each service has its own DTOs to decouple data models
---
### **Data Access Layer** โ (Repositories)
- `Library.Repository/`: Contains repositories that interact with the database using EF Core
---
### **Infrastructure Layer** โ (Database & Identity)
- `Library.Data/`:
- `Entities/IdentityEntities/`: Identity user/role entities
- `Migrations/`: EF Core migration files
---
### โ๏ธ App Entry & Config
- `Program.cs`: Main app entry point (DI setup, Middleware, App config)
- `appsettings.json`: DB connection strings, JWT keys, and app secrets
---
## ๐ฆ Getting Started
### 1. Clone the repository
```bash
git clone https://github.com/kareemwaleed266/library-management-api.git
cd library-management-api/Library