The CHU Hospital Management System is a comprehensive web-based application. This system provides an integrated solution for managing hospital buildings, personnel, patients, services, and notifications, enabling efficient hospital administration and improved patient care.
- Backend: Java 17, Spring Boot 3.2.3
- Frontend: Thymeleaf, HTML5, CSS3, JavaScript
- Database: MySQL 8
- Build Tool: Maven
- Design Patterns: Factory Method, Abstract Factory, Adapter, Composite, Mediator, Facade, Observer
The application follows a layered architecture:
- Presentation Layer: Thymeleaf templates, CSS, JavaScript
- Controller Layer: Spring MVC controllers
- Service Layer: Business logic and service implementations
- Repository Layer: Data access using Spring Data JPA
- Domain Layer: Entity classes representing the domain model
The system implements several design patterns to ensure maintainability, extensibility, and code reusability:
- Factory Method: Used for creating different types of buildings (Administration, Laboratory, Emergency)
- Abstract Factory: Used for creating different types of users (Doctors, Nurses, Administrators, etc.)
- Adapter: Used to adapt rooms for different purposes (e.g., converting emergency rooms to surgery rooms)
- Composite: Used for organizing services in hierarchical structures
- Mediator: Used for communication between department heads
- Facade: Used to simplify patient management operations
- Observer: Used for notification system between services
- Add, edit, view, and delete hospital buildings
- Categorize buildings by type (Administration, Laboratory, Emergency, etc.)
- Track building details (location, size, functionality)
- Manage different types of personnel (Doctors, Nurses, Administrators, Directors, Support Staff)
- Track personnel details and specializations
- Assign personnel to services and departments
- Register and manage patient information
- Track patient medical status
- Transfer patients between sections
- Process patient discharge
- Create and manage hospital services
- Assign services to buildings
- Assign personnel as service heads
- Adapt services for different purposes
- Send notifications to personnel
- Broadcast important announcements
- Track notification status
- Organize patients into medical sections
- Assign doctors to sections
- Track section capacity and occupancy
- Java 17 or higher
- MySQL 8.0 or higher
- Maven 3.6 or higher
- Create a MySQL database named
chu_db
- Configure database connection in
src/main/resources/application.properties
git clone https://github.com/ElazzouziHassan/chu-system.git
cd chu-management
- Ensure Java 17 is installed and configured:
java -version
- Ensure Maven is installed:
mvn -version
- Install MySQL 8.0 if not already installed
- Create a MySQL database:
CREATE DATABASE chu_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
- Create a database user (optional):
CREATE USER 'chu_user'@'localhost' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON chu_db.* TO 'chu_user'@'localhost'; FLUSH PRIVILEGES;
- Update database configuration in
src/main/resources/application.properties
:spring.datasource.url=jdbc:mysql://localhost:3306/chu_db?createDatabaseIfNotExist=true spring.datasource.username=chu_user spring.datasource.password=your_password
./mvnw clean install
- Using Maven:
./mvnw spring-boot:run
- Or using the JAR file:
java -jar target/chu-management-0.0.1-SNAPSHOT.jar
- Open a web browser and navigate to:
http://localhost:8080
- Default login credentials (if applicable):
- Username:
admin
- Password:
admin
- Username:
- Use Spring DevTools for automatic restarts during development
- Run with development profile for additional logging:
mvn spring-boot:run -Dspring-boot.run.profiles=dev
- For frontend changes, refresh the browser to see updates
- For database schema changes, set
spring.jpa.hibernate.ddl-auto=update
in development