01
Assignment Overview
Build a Book Management System using Spring Boot. This application will allow users to manage books, authors, and categories through a RESTful API with a database backend.
Skills Applied: Spring Basics (9.1), Spring MVC (9.2), and Spring Boot (9.3) from Module 9.
Spring Boot
Auto-configuration, starters, embedded server
REST APIs
Controllers, request mapping, ResponseEntity
JPA/Hibernate
Entities, repositories, CRUD operations
02
Requirements
Part 1: Project Setup (30 points)
- Initialize Spring Boot project with Spring Initializr
- Include dependencies: Web, JPA, H2/MySQL, Validation, Lombok
- Configure
application.propertiesfor database - Set up proper package structure (controller, service, repository, model)
Part 2: Entity Classes and Repositories (50 points)
- Create
Bookentity with JPA annotations (@Entity, @Id, @GeneratedValue) - Create
Authorentity with relationship to books - Create
Categoryentity - Implement JpaRepository interfaces for CRUD operations
- Add validation annotations (@NotNull, @Size, etc.)
Part 3: Service Layer (40 points)
- Create service interfaces and implementations
- Implement business logic in service layer
- Use @Service and @Transactional annotations
- Inject repositories using constructor injection
Part 4: REST Controllers (50 points)
- Create
BookControllerwith all CRUD endpoints - Implement proper HTTP methods: GET, POST, PUT, DELETE
- Use @PathVariable and @RequestBody appropriately
- Return proper HTTP status codes
- Implement pagination and sorting
Part 5: Error Handling and Validation (30 points)
- Create global exception handler with @ControllerAdvice
- Handle validation errors properly
- Return meaningful error responses
- Implement custom exceptions
03
Submission Guidelines
Folder Structure: Submit the complete Spring Boot project
Required Files:
- Complete Spring Boot project with Maven/Gradle build files
src/main/java/- All Java source filessrc/main/resources/- Application propertiessrc/test/java/- Unit tests (bonus)API_DOCUMENTATION.md- API endpoints documentationREADME.md- Setup and run instructions- Postman collection for testing (optional)
Ready to submit? Test all endpoints with Postman!
Submit Now
04
Grading Rubric
| Criteria | Points | Description |
|---|---|---|
| Project Setup | 30 | Proper Spring Boot configuration |
| Entities & Repositories | 50 | JPA entities and repository interfaces |
| Service Layer | 40 | Business logic implementation |
| REST Controllers | 50 | All CRUD endpoints working |
| Error Handling | 30 | Global exception handling |
| Total | 200 |