A secure and user-friendly Book Management System built with Spring Boot, featuring JWT-based authentication, full CRUD operations for books and users, and the ability to assign books to users. Designed with modular architecture and clean REST APIs.
-
🔐 JWT Authentication
- Secure user login and signup
- Token-based access control for APIs
-
📚 Book Management
- Add, update, delete, and view books
- Assign books to registered users
-
👤 User Management
- Register new users
- Login to receive JWT
- View user details and assigned books
-
🧪 Unit & Integration Testing
- Written using JUnit & Mockito
- Spring Boot 3.x
- Spring Security + JWT
- Spring Data JPA + Hibernate
- PostgreSQL (or H2 for testing)
- Lombok
- JUnit + Mockito
- ModelMapper or MapStruct
- User signs up (
/api/auth/signup) - User logs in (
/api/auth/login) → receives JWT - JWT is passed in
Authorization: Bearer <token>for secure endpoints
POST /api/auth/signup– Register new userPOST /api/auth/login– Login and receive JWT
GET /api/books– List all booksPOST /api/books– Add new bookPUT /api/books/{id}– Update bookDELETE /api/books/{id}– Delete bookPOST /api/books/assign?userId=1&bookId=2– Assign a book to a user
GET /api/users/{id}– Get user details and assigned books
🛡️ All routes (except signup/login) are protected and require a valid JWT token.
- Clone the repo
git clone https://github.com/your-username/book-management-store.git
cd book-management-store