Assignment 9-A

Spring Boot Web Application

Build a complete Spring Boot web application with REST APIs. Apply Spring MVC, dependency injection, and JPA to create a production-ready application.

8-10 hours
Advanced
200 Points
Submit Assignment
What You'll Practice
  • Create Spring Boot application
  • Build REST APIs
  • Implement MVC pattern
  • Integrate database with JPA
  • Apply dependency injection
Contents
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.properties for database
  • Set up proper package structure (controller, service, repository, model)

Part 2: Entity Classes and Repositories (50 points)

  • Create Book entity with JPA annotations (@Entity, @Id, @GeneratedValue)
  • Create Author entity with relationship to books
  • Create Category entity
  • 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 BookController with 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:
  1. Complete Spring Boot project with Maven/Gradle build files
  2. src/main/java/ - All Java source files
  3. src/main/resources/ - Application properties
  4. src/test/java/ - Unit tests (bonus)
  5. API_DOCUMENTATION.md - API endpoints documentation
  6. README.md - Setup and run instructions
  7. 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