Capstone · Java Programming (Core to Spring Boot)
Capstone: a clinic appointment booking API
The brief
Sehat Clinic, a small two-doctor clinic in Bengaluru, takes bookings on a paper register and keeps double-booking the same slot. You build its backend as a Spring Boot REST API: doctors and appointments stored with Spring Data JPA, validated input, no double booking, clear JSON errors, each doctor's day in time order, cancellation, unit and integration tests, and a JAR that runs anywhere with Java.
Why it matters
A layered Spring Boot REST API with JPA, validation, error handling and tests is the single most common task in Java backend jobs in India, from service companies to health-tech start-ups such as appointment and pharmacy apps. A finished, documented one is the best portfolio project to show in a Java interview: you can demo it with curl and explain every layer.
Skills you practise
- Spring Initializr and the Maven Wrapper
- Actuator health
- JPA entities and Spring Data repositories
- data.sql seeding
- @RestController and ResponseEntity
- Bean Validation
- @RestControllerAdvice error handling
- derived queries
- Mockito unit tests
- @SpringBootTest
- mvn package and java -jar
You need
- JDK 21 (Spring Boot 3 and 4 need Java 17 or newer; 21 is the reference here)
- Internet access for start.spring.io and the first Maven download (the project includes the Maven Wrapper, so no separate Maven install is needed)
- curl: built into Windows 10 and 11 as curl.exe (type curl.exe in PowerShell, because plain curl there is a different command), and on Linux and macOS as curl
- A text editor or IDE (VS Code with the Extension Pack for Java, or IntelliJ IDEA Community Edition) and a terminal
What you will have at the end
The clinic Spring Boot project in a Git repository: entities, repositories, service, controllers and error handling, at least 6 passing tests, a README with every endpoint and curl example, and the runnable JAR. Link it from your CV and be ready to demo it with curl.
How it is marked (rubric, 100 points)
| Working APIEvery check passes: health, doctors, 201 with Location, 400 with field messages, 409, 404s, the sorted day list, 204 on cancel, and the JAR on port 9090. | 35 |
|---|---|
| Clean layersThin controllers, rules in a @Transactional service, Spring Data repositories, records as DTOs, constructor injection. | 20 |
| Errors and validationBean Validation on every input field; one @RestControllerAdvice gives every error a clear JSON body and the right status. | 15 |
| TestsMockito unit tests for the rules and a @SpringBootTest of the real flow; you have seen them fail. | 15 |
| Documentation and hygieneA README another developer can follow, a .gitignore, and no secrets or target/ in Git. | 15 |
0/10 steps done
Step 1 of 10
Generate the project and start it
The generated app starts: the log shows the Spring Boot banner, Tomcat started on port 8080 and Started ClinicApplication.
On start.spring.io choose Maven, Java, the current Spring Boot 3.x or 4.x release and Java 21. Group com.sehat, Artifact clinic (so the package is com.sehat.clinic and the main class ClinicApplication). Add Spring Web, Validation, Spring Data JPA, H2 Database and Spring Boot Actuator. Unzip it, copy in application.properties, and run it with the Maven Wrapper. Leave it running in its own terminal and use a second terminal for curl; stop it with Ctrl+C before restarting after code changes.
$ .\mvnw spring-boot:run (Linux/macOS: ./mvnw spring-boot:run)Also check yourself
Your notes: application.properties, data.sql, README.md
Write down each command you ran. It goes into your project summary.