A full-stack clinic management application built with Java and Spring Boot. It provides role-based workflows for administrators, doctors, and patients, including doctor management, appointment scheduling, availability management, and electronic prescriptions.
This project was developed as the capstone for the IBM Java Developer Professional Certificate and extended with additional business rules, automated tests, containerization, and CI-oriented build configuration.
- Sign in to a protected admin dashboard
- Create, update, delete, list, and filter doctors
- Manage doctor contact information, specialties, and available time slots
- Sign in to a protected doctor dashboard
- View appointments by date and patient name
- Manage available time slots
- Create a prescription for an assigned appointment
- Register and sign in
- Browse and filter doctors by name, specialty, and availability
- Book and reschedule one-hour appointments
- View appointments and prescriptions
- Appointments cannot be scheduled in the past
- A doctor must be available during the selected time slot
- Doctors and patients cannot have overlapping appointments
- Only the patient who owns an appointment can update it
- Only the assigned doctor can create its prescription
- Email addresses are unique per user type
- Request data is validated and API errors use consistent responses
| Area | Technologies |
|---|---|
| Backend | Java 17, Spring Boot 3.4.4, Spring MVC |
| Persistence | Spring Data JPA, Hibernate, MySQL 8, Spring Data MongoDB, MongoDB 6 |
| Security | Spring Security, BCrypt, JWT (JJWT 0.12.6) |
| Frontend | Thymeleaf, HTML, CSS, JavaScript |
| Testing | JUnit 5, Spring Boot Test, MockMvc, Testcontainers |
| Infrastructure | Maven, Docker, Docker Compose, Spring Boot Actuator |
The application follows a layered architecture:
- Presentation layer: Thymeleaf views, static JavaScript modules, MVC controllers, and REST controllers
- Application layer: services, business rules, DTO mapping, validation, and exception handling
- Data layer: JPA repositories for relational data and MongoDB repositories for prescriptions
MySQL stores administrators, doctors, patients, appointments, and doctor availability. MongoDB stores prescription documents associated with appointments.
java-database-capstone/
├── app/
│ ├── src/main/java/ # Controllers, services, models, DTOs and repositories
│ ├── src/main/resources/
│ │ ├── static/ # CSS and JavaScript
│ │ ├── templates/ # Thymeleaf views
│ │ └── application*.properties
│ ├── src/test/java/ # Unit and integration tests
│ ├── Dockerfile
│ ├── docker-compose.yml
│ └── pom.xml
├── user_stories.md
└── README.md
- Docker Engine or Docker Desktop
- Docker Compose
git clone https://github.com/maikelsalazar/java-database-capstone.git
cd java-database-capstone/appCreate an app/.env file:
DB_URL=jdbc:mysql://mysql:3306/cms
DB_USER=root
DB_PASSWORD=root
MONGO_URI=mongodb://mongodb:27017/prescriptions
JWT_SECRET=replace-with-a-base64-encoded-256-bit-secret
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin@1234Generate a suitable JWT secret on macOS or Linux:
openssl rand -base64 32Do not commit the .env file or real credentials.
docker compose up --buildOpen http://localhost:8080.
The default services are:
| Service | Address |
|---|---|
| Application | http://localhost:8080 |
| MySQL | localhost:3306 |
| MongoDB | localhost:27017 |
To run in the background or stop the stack:
docker compose up --build -d
docker compose downUse docker compose down -v only when you also want to delete the database volumes.
- JDK 17
- Maven 3.9+
- MySQL 8
- MongoDB 6
From the app directory, configure the required environment variables and run:
./mvnw spring-boot:runIf the Maven wrapper is unavailable, use:
mvn spring-boot:runDocker must be running because the integration tests use Testcontainers for MySQL and MongoDB.
Run unit tests:
mvn testRun the complete test suite, including integration tests:
mvn verifyIntegration test classes use the *IT.java suffix and are executed by Maven Failsafe. Unit test classes use *Test.java and are executed by Maven Surefire.
When the application is running, its health information is available at:
GET http://localhost:8080/actuator/health
The application exposes REST endpoints under /api/ for:
- Authentication for administrators, doctors, and patients
- Doctor creation, update, deletion, listing, and filtering
- Patient registration and appointment retrieval
- Appointment booking, filtering, and rescheduling
- Prescription creation and retrieval
The frontend consumes these endpoints and uses Thymeleaf for server-rendered dashboard pages.
Some authenticated routes receive the JWT as a path parameter because this was part of the original capstone specification. In a production system, tokens should be sent through the Authorization: Bearer <token> header, HTTPS should be mandatory, secrets should be managed outside the repository, and production database credentials should use least privilege.
Detailed functional requirements, Gherkin scenarios, acceptance criteria, priorities, and story points are available in user_stories.md.
Maikel José Salazar Fermín