A Spring Boot Monolith for the Capgemini Training Evaluation Exceller 2026 sprint project.
This project is a Hospital Management System (HMS) designed to manage hospital operations such as patient records, physician details, appointments, prescriptions, room stays, nurse assignments, procedures, and department affiliations using a structured relational database.
The goal of this application is to provide a clean, maintainable, and scalable backend for hospital workflows in a single Spring Boot monolith. The system is designed around the provided database schema and follows a layered architecture with clear separation of concerns.
The application will support:
- Patient management
- Physician and department management
- Appointment scheduling
- Medication and prescription tracking
- Room and stay management
- Procedure and treatment records
- Nurse and on-call tracking
- Secure API design with future-ready structure
This project is intentionally designed as a monolith because:
- It is easier to build and deliver within the evaluation timeline
- It reduces deployment and debugging complexity
- It is ideal for a 14-day sprint project
- It keeps all modules in one codebase while still maintaining modular package structure
The codebase is organized as a modular monolith, meaning each domain has its own package and responsibilities, but everything is deployed as one application.
The project is based on the following major database entities from the shared HMS schema:
PhysicianDepartmentAffiliated_WithProceduresTrained_InPatientNurseAppointmentMedicationPrescribesBlockRoomOn_CallStayUndergoes
These tables represent the core hospital workflow and will be mapped into Spring Boot entities, repositories, services, DTOs, and controllers.
Below is the recommended end-to-end professional folder structure for the monolith.
capgemini-hms-backend/
├── README.md
├── pom.xml
├── .gitignore
├── docker-compose.yml
├── Dockerfile
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ └── capgemini
│ │ │ └── hms
│ │ │ ├── CapgeminiHmsBackendApplication.java
│ │ │ │
│ │ │ ├── config
│ │ │ │ ├── SwaggerConfig.java
│ │ │ │ ├── JpaConfig.java
│ │ │ │ └── WebConfig.java
│ │ │ │
│ │ │ ├── security
│ │ │ │ ├── JwtAuthenticationFilter.java
│ │ │ │ ├── JwtService.java
│ │ │ │ ├── SecurityConfig.java
│ │ │ │ └── CustomUserDetailsService.java
│ │ │ │
│ │ │ ├── exception
│ │ │ │ ├── GlobalExceptionHandler.java
│ │ │ │ ├── ResourceNotFoundException.java
│ │ │ │ ├── DuplicateResourceException.java
│ │ │ │ └── BadRequestException.java
│ │ │ │
│ │ │ ├── common
│ │ │ │ ├── constants
│ │ │ │ ├── enums
│ │ │ │ ├── response
│ │ │ │ └── util
│ │ │ │
│ │ │ ├── auth
│ │ │ │ ├── controller
│ │ │ │ ├── dto
│ │ │ │ ├── service
│ │ │ │ ├── serviceImpl
│ │ │ │ └── model
│ │ │ │
│ │ │ ├── physician
│ │ │ │ ├── controller
│ │ │ │ ├── dto
│ │ │ │ ├── entity
│ │ │ │ ├── repository
│ │ │ │ ├── service
│ │ │ │ ├── serviceImpl
│ │ │ │ └── mapper
│ │ │ │
│ │ │ ├── department
│ │ │ │ ├── controller
│ │ │ │ ├── dto
│ │ │ │ ├── entity
│ │ │ │ ├── repository
│ │ │ │ ├── service
│ │ │ │ ├── serviceImpl
│ │ │ │ └── mapper
│ │ │ │
│ │ │ ├── patient
│ │ │ │ ├── controller
│ │ │ │ ├── dto
│ │ │ │ ├── entity
│ │ │ │ ├── repository
│ │ │ │ ├── service
│ │ │ │ ├── serviceImpl
│ │ │ │ └── mapper
│ │ │ │
│ │ │ ├── nurse
│ │ │ │ ├── controller
│ │ │ │ ├── dto
│ │ │ │ ├── entity
│ │ │ │ ├── repository
│ │ │ │ ├── service
│ │ │ │ ├── serviceImpl
│ │ │ │ └── mapper
│ │ │ │
│ │ │ ├── appointment
│ │ │ │ ├── controller
│ │ │ │ ├── dto
│ │ │ │ ├── entity
│ │ │ │ ├── repository
│ │ │ │ ├── service
│ │ │ │ ├── serviceImpl
│ │ │ │ └── mapper
│ │ │ │
│ │ │ ├── medication
│ │ │ │ ├── controller
│ │ │ │ ├── dto
│ │ │ │ ├── entity
│ │ │ │ ├── repository
│ │ │ │ ├── service
│ │ │ │ ├── serviceImpl
│ │ │ │ └── mapper
│ │ │ │
│ │ │ ├── procedure
│ │ │ │ ├── controller
│ │ │ │ ├── dto
│ │ │ │ ├── entity
│ │ │ │ ├── repository
│ │ │ │ ├── service
│ │ │ │ ├── serviceImpl
│ │ │ │ └── mapper
│ │ │ │
│ │ │ ├── room
│ │ │ │ ├── controller
│ │ │ │ ├── dto
│ │ │ │ ├── entity
│ │ │ │ ├── repository
│ │ │ │ ├── service
│ │ │ │ ├── serviceImpl
│ │ │ │ └── mapper
│ │ │ │
│ │ │ ├── stay
│ │ │ │ ├── controller
│ │ │ │ ├── dto
│ │ │ │ ├── entity
│ │ │ │ ├── repository
│ │ │ │ ├── service
│ │ │ │ ├── serviceImpl
│ │ │ │ └── mapper
│ │ │ │
│ │ │ ├── prescription
│ │ │ │ ├── controller
│ │ │ │ ├── dto
│ │ │ │ ├── entity
│ │ │ │ ├── repository
│ │ │ │ ├── service
│ │ │ │ ├── serviceImpl
│ │ │ │ └── mapper
│ │ │ │
│ │ │ └── oncall
│ │ │ ├── controller
│ │ │ ├── dto
│ │ │ ├── entity
│ │ │ ├── repository
│ │ │ ├── service
│ │ │ ├── serviceImpl
│ │ │ └── mapper
│ │ │
│ │ └── resources
│ │ ├── application.properties # Default configuration
│ │ ├── application-dev.properties # Development environment config
│ │ ├── application-prod.properties # Production environment config
│ │ │
│ │ ├── db # Database scripts
│ │ │ ├── schema.sql # Table creation scripts
│ │ │ └── data.sql # Initial/sample data
│ │ │
│ │ ├── templates # Thymeleaf HTML templates (View Layer)
│ │ │ ├── index.html # Dashboard / Home page
│ │ │ │
│ │ │ ├── patient/ # Patient UI pages
│ │ │ │ ├── list.html
│ │ │ │ ├── create.html
│ │ │ │ └── edit.html
│ │ │ │
│ │ │ ├── physician/ # Doctor UI pages
│ │ │ │ ├── list.html
│ │ │ │ └── create.html
│ │ │ │
│ │ │ ├── appointment/ # Appointment UI pages
│ │ │ │ ├── list.html
│ │ │ │ └── create.html
│ │ │ │
│ │ │ ├── room/ # Room & stay management UI
│ │ │ ├── medication/ # Medication UI
│ │ │ ├── prescription/ # Prescription UI
│ │ │ │
│ │ │ ├── fragments/ # Reusable UI components
│ │ │ │ ├── header.html
│ │ │ │ ├── footer.html
│ │ │ │ └── sidebar.html
│ │ │ │
│ │ │ └── error/ # Error pages
│ │ │ ├── 404.html
│ │ │ └── 500.html
│ │ │
│ │ ├── static # Static assets (CSS, JS, Images)
│ │ │ ├── css/
│ │ │ │ └── styles.css
│ │ │ │
│ │ │ ├── js/
│ │ │ │ └── main.js
│ │ │ │
│ │ │ ├── images/
│ │ │ └── vendor/ # Bootstrap / external libraries (optional)
│ │ │
│ │ └── messages.properties # Thymeleaf internationalization (optional)
│ │
│ └── test
│ └── java
│ └── com
│ └── capgemini
│ └── hms
│ ├── physician
│ ├── patient
│ ├── appointment
│ └── ...Contains framework-level configuration like Swagger, JPA, CORS, and application setup.
Contains JWT-based authentication and authorization setup.
Contains custom exceptions and a global exception handler for clean API responses.
Contains shared utilities, constants, enums, and response wrappers used across all modules.
Each domain package represents one business area of the HMS and follows the same internal structure:
controller→ REST endpointsdto→ request/response objectsentity→ JPA entity classesrepository→ database access layerservice→ business interfaceserviceImpl→ business logic implementationmapper→ DTO/entity conversion
Handles:
- Physician registration and management
- Doctor profiles
- Specialization and position tracking
- Head of department references
Maps to:
PhysicianAffiliated_WithTrained_In
Handles:
- Department creation
- Department head assignment
- Department-wise physician mapping
Maps to:
DepartmentAffiliated_With
Handles:
- Patient registration
- Personal details
- PCP assignment
Maps to:
Patient
Handles:
- Nurse records
- Registration status
- Nurse workforce management
Maps to:
NurseOn_Call
Handles:
- Patient appointments
- Prep nurse assignment
- Physician assignment
- Appointment timing and room details
Maps to:
Appointment
Handles:
- Medicine catalog
- Brand and description details
- Prescription linkage
Maps to:
Medication
Handles:
- Which physician prescribed which medication
- Patient-medication relation
- Dose and prescription date
Maps to:
Prescribes
Handles:
- Hospital procedures
- Procedure cost and name
- Training and treatment mapping
Maps to:
ProceduresTrained_In
Handles:
- Room details
- Room type
- Availability
- Block mapping
Maps to:
RoomBlock
Handles:
- Patient admission
- Room stay duration
- Admission and discharge tracking
Maps to:
Stay
Handles:
- Nurse on-call schedule
- Block assignment
- Start/end duty timings
Maps to:
On_Call
Handles:
- Procedure performed during a patient stay
- Physician and assisting nurse details
Maps to:
Undergoes
Controller → Service → Repository → Database
- Client sends request to controller
- Controller validates and forwards to service
- Service applies business logic
- Repository handles database interaction
- Response is returned in a standard format
All APIs should ideally return a consistent response format such as:
{
"success": true,
"message": "Patient created successfully",
"data": {}
}This makes the backend cleaner and easier to consume by frontend or testing tools.
- Create Spring Boot project
- Configure database connection
- Add dependencies
- Setup Swagger and global exception handling
- Patient
- Physician
- Department
- Appointment
- Nurse
- Medication
- Prescription
- Room
- Stay
- Procedure
- On-call
- Undergoes
- Validation
- Logging
- Error handling
- Testing
- Deployment
Since this is a group project, use a clean GitHub workflow:
main→ stable final codedevelop→ active integration branchfeature/<module-name>→ individual task branches
Example feature branches:
feature/patient-modulefeature/physician-modulefeature/appointment-modulefeature/room-modulefeature/prescription-module
Each team member should work on one feature branch and create a Pull Request into develop.
For the main branch:
- Require pull request before merge
- Require at least 1 approval
- Restrict direct pushes
- Optionally require passing checks before merge
This ensures no one commits directly to production-ready code.
- Java 17+
- Spring Boot
- Spring Web
- Spring Data JPA
- Spring Security
- MySQL
- Lombok
- Maven
- Swagger / OpenAPI
- Docker for deployment
To keep the project professional, use consistent naming rules:
- Package name:
com.capgemini.hms - Entity names: singular form
- Repository names:
EntityRepository - Service names:
EntityService - Controller names:
EntityController - DTO names:
EntityRequestDto,EntityResponseDto
- Keep the schema-driven development approach
- Follow the exact column names carefully while mapping entities
- Do not overcomplicate with microservices
- Build reusable code for validation and exception handling
- Keep APIs clean and easy to test in Postman or Swagger
The final goal is to deliver a well-structured, production-style Hospital Management System backend that demonstrates:
- Good architecture
- Team collaboration
- Clean coding standards
- Real-world Spring Boot practices
- Strong database understanding
This project is developed for Capgemini Training Evaluation Exceller 2026 and is intended for academic and evaluation purposes.