SmartHealth project containing:
- Backend (Spring Boot) β
SmartHealth/ - User Frontend (HTML, CSS and JavaScript) β
sh/ - Admin Frontend (HTML, CSS and JavaScript) β
admin/
SmartHealth/
ββ SmartHealth/ β Spring Boot backend
ββ sh/ β User frontend
ββ admin/ β Admin frontend
- Import the Gradle project SmartHealth into your IDE (STS, Eclipse, IntelliJ). (Optional)
- Open
src/main/resources/application.propertiesand configure the following:- Database Connection: Update
spring.datasource.driver-class-name,spring.datasource.url,spring.datasource.username, andspring.datasource.passwordaccording to your database setup. - Image Storage Path: Set
smarthealth.paths.image-storage-pathto the desired location for storing profile images. - CORS Configuration: Update properties starting with
smarthealth.corsto allow cross-origin requests as per your requirements. - Other Properties: Adjust settings like server port, log file path, etc. as needed.
- Database Connection: Update
- Run the application:
- From IDE: Execute the
mainmethod inSmartHealthApplicationclass. - From Command Line:
- Navigate to the SmartHealth/ directory.
- Build the project:
(Use
./gradlew clean build
./gradlew clean build -x testto skip tests.) - After a successful build, navigate to
build/libs/and run:java -jar SmartHealth-1.0.0.jar
- From IDE: Execute the
-
Database Connection Errors (e.g.,
JDBCConnectionException, driver not found, connection refused):- Verify database driver, URL, host, port, username, and password.
- Ensure the database server is running and accessible.
-
Mapper Class Dependency Issues (when running from IDE):
-
These are usually caused by missing generated
MapperImplclasses. You can resolve this by either:
a) Running./gradlew clean build
and checking if the
MapperImplclasses are generated under
build/generated/sources/annotationProcessor/java/main/com/ps/mapper/.
If generated, the application should start. You may need to link source file as above location based on your IDE.b) Enabling Annotation Processing in your IDE settings.
β‘ Tip: If you frequently modify mapper interfaces, enabling annotation processing in your IDE is recommended. Otherwise, youβll need to rebuild the project every time via Gradle.
-
-
Simple Hosting
- Copy the
sh/(User Frontend) andadmin/(Admin Frontend) folders to your hosting server. - Example: If youβre using XAMPP, place both folders inside
\xampp\htdocs\. - Start Apache and access the applications via:
- http://localhost/sh
- http://localhost/admin
(or based on your server configuration)
- Copy the
-
Using Virtual Hosts (Recommended for cleaner URLs)
-
You can configure custom domain mappings for better accessibility.
-
Example: If your project resides in
F:/Projects/SmartHealthand youβre using XAMPP, add the following configuration to
\xampp\apache\conf\extra\httpd-vhosts.conf:<VirtualHost *:80> ServerName smarthealth DocumentRoot "F:/Projects/SmartHealth/sh" <Directory "F:/Projects/SmartHealth/sh"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> ServerName admin.sh DocumentRoot "F:/Projects/SmartHealth/admin" <Directory "F:/Projects/SmartHealth/admin"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted </Directory> </VirtualHost>
-
After saving the configuration:
- Restart Apache server.
- Update your systemβs
hostsfile to map domains:127.0.0.1 smarthealth 127.0.0.1 admin.sh - Access the apps via:
- http://smarthealth
- http://admin.sh
(or according to your chosen domain names)
Note: Change
BASE_API_URLvalue according to your backend configuration. You will foundBASE_API_URLinside/sh/js/constant.jsand/admin/assets/js/constant.jsfiles. -
- π Stateless session management using JWT
- π‘οΈ Role-based access control (Doctor, Patient, Admin)
- β Secure Authentication & Authorization
-
π€ Account Management
- π Register, π Login, πͺ Logout
- π Dashboard with key statistics
- π§Ύ Profile management (π View & βοΈ Update profile, π Change password)
-
π Availability Management
- β‘ Generate availability slots using multiple modes:
- π AUTO (default auto generation)
- π CUSTOM_ONE_TIME
- β»οΈ CUSTOM_CONTINUOUS
- β MANUAL
- π§ Update slot generation preferences anytime
- ποΈ Bulk delete slots (with validations)
- π View availability slots with filters & pagination
- π View detailed slot information
- β‘ Generate availability slots using multiple modes:
-
π Appointment Management
- π View appointments with filters & pagination
- π View appointment details
- π Update appointment status (Approved β , Completed π―, Cancelled β)
-
π΄ Leave Management
- βοΈ Apply for leave
- π View applied leaves with filters & pagination
-
π€ Account Management
- π Register, π Login, πͺ Logout
- π Dashboard with appointment statistics
- π§Ύ Profile management (π View & βοΈ Update profile, π Change password)
-
π Doctor Search & Booking
- π¨ββοΈ Search doctors with filters & pagination
- π View doctor availability slots
- π Book appointments for self or relatives (sub-profiles)
-
π Appointment Management
- π View appointments with filters & pagination
- π View appointment details
- β Cancel appointments
-
π€ Account Management
- π Register, π Login, πͺ Logout
- π Dashboard with real-time statistics (users, slots, appointments, leaves, holidays)
-
π₯ User Management
- π©ββοΈ View doctors & π§βπ€βπ§ patients with filters & pagination
- π Activate / Deactivate users
- π View detailed user profiles
-
π Slot Management
- π View all availability slots with filters & pagination
- ποΈ Delete slots
- π View slot details
-
π Appointment Management
- π View all appointments with filters & pagination
- π View appointment details
- π Update appointment status
-
π΄ Leave & Holiday Management
- π View leave requests (Doctors)
- β Approve / β Reject leave requests
- π Manage holidays (β Add / ποΈ Delete with pagination)
- π Spring Security β Authentication & Authorization
- π JWT β Secure stateless session management
- π Swagger UI β API visualization & testing
- ποΈ Spring Data JPA β Database interaction
- π Spring Web β RESTful API development
- π MapStruct β DTO β Entity mapping
- β¨ Lombok β Boilerplate code reduction
- π JaCoCo β Test coverage reporting
- π§ͺ JUnit β Unit & integration testing
Swagger UI is integrated for interactive API documentation.
It allows you to:
- π Explore all available REST APIs
- π§ͺ Test endpoints directly from the browser
- π View request/response schemas and parameters
Once your backend is running, open:
π http://localhost:9902/swagger-ui.html
Most of our APIs require a JWT token in the request header:
Authorization: Bearer <your_token>
Currently, the Swagger setup does not include an input field for headers, so youβll need to configure Swagger/OpenAPI for header-based authentication before you can test secured endpoints directly from Swagger UI.
Until then, use an API client like Postman or cURL for testing JWT-protected APIs.
We use JaCoCo to measure unit and integration test coverage across the project.
It provides detailed reports in both HTML and XML formats.
Run the following Gradle commands from the project root: Include jacocoTestReport at the end of command to generate test report.
# Clean, build, run tests and generate test report
./gradlew clean build jacocoTestReport
# Run tests and generate test report
./gradlew test jacocoTestReportπ Report Location
After execution, you can find the report at: build/reports/jacoco/test/html/index.html.
Open the file in your browser to explore detailed coverage (classes, methods, lines, branches).
- Displays upcoming appointments and key statistics at a glance.
- Provides a quick overview of bookings, completed visits, and cancellations.
- View and update personal details (name, dob, height, weight, etc.).
- Upload / change profile picture.
- Update password for secure login.
- Search for doctors using filters (specialization, name, degree, availability, etc.).
- Results are paginated for smooth browsing.
- View doctor availability slots in real-time.
- Select a preferred date & time to book.
- Option to book for self or for a relative (sub-profile).
- List of all appointments with filters & pagination.
- View detailed appointment information.
- Option to cancel appointment if needed.
- Displays todayβs appointments, slot statistics, and quick insights.
- Helps doctors manage their day efficiently.
- View and update personal details (name, dob, degree, experience, etc.).
- Upload / change profile picture.
- Update password for secure login.
- Generate availability slots using multiple modes:
- π AUTO
- π CUSTOM_ONE_TIME
- β»οΈ CUSTOM_CONTINUOUS
- β MANUAL
- View generated slots with filters & pagination.
- Delete unwanted slots or update preferences anytime.
- View appointments booked by patients in available slots.
- Access detailed information for each appointment.
- Change appointment status (Approve β , Complete π―, Cancel β).
- Apply for leave (single or multiple days).
- View applied leaves with filters & pagination.
- Leave requests are sent to Admin for approval/rejection.
- Displays overall platform statistics including doctors, patients, appointments, and system activity.
- Provides quick insights for platform monitoring.
- View and update personal details (name).
- Upload / change profile picture.
- Update password for secure login.
- View all registered doctors with filters & pagination.
- Activate / Deactivate doctors.
- Access detailed doctor profiles.
- View all registered patients with filters & pagination.
- Activate / Deactivate patients.
- Access detailed patient profiles.
- View all doctor availability slots.
- Delete slots if required.
- View details about slot.
- View all appointments across the platform.
- Filter, sort, and paginate appointments.
- Update appointment status: Approve, Cancel, Complete.
- View Appointment details.
- β Add holidays (festivals, national holidays, etc.).
- β Delete holidays.
- Ensures no slots are generated on holidays.
- β Approve / β Reject doctor leave requests.
- On approval, system auto-cancels slots & appointments.
- Maintains smooth doctor availability management.































