A REST API for medical clinic management built with Spring Boot and MySQL.
This API provides endpoints for managing doctors, patients, and appointments in a medical clinic system, featuring JWT authentication and complete CRUD operations.
- JWT Authentication
- Doctor management
- Patient records
- Appointment scheduling
- Input validation
- Error handling
- MySQL integration
- Flyway migrations
- Java 23
- Spring Boot 3
- Spring Data JPA
- Hibernate
- Maven
- MySQL
- Flyway
- Lombok
- JUnit
- Mockito
- JDK 23
- Maven 3.8+
- MySQL 8.0+ Server running on port 3306
- Database created
-
Clone the repository
-
Create database:
CREATE DATABASE api;
CREATE DATABASE api_test;
- Configure database properties in
application.properties
:
spring.datasource.url=
spring.datasource.username=
spring.datasource.password=
- Build the project:
mvn clean install
- Run the application:
mvn spring-boot:run
Full API documentation is available at /swagger-ui.html when the application is running.
POST /#
- Login to obtain JWT token
POST /medicos
- Register new doctorGET /medicos
- List active doctorsPUT /medicos
- Update doctor infoDELETE /medicos/{id}
- Delete doctor
POST /pacientes
- Register new patientGET /pacientes
- List active patientsPUT /pacientes
- Update patient infoDELETE /pacientes/{id}
- Delete patient
POST /consultas
- Schedule appointment
- JWT Token authentication
- Protected endpoints require Authorization header:
Bearer {token}
src/
├── main/
│ ├── java/
│ │ └── dev/raniery/med/voll/api/
│ │ ├── controller/
│ │ ├── domain/
│ │ ├── infra/
│ │ └── user/
│ └── resources/
│ └── db/migration/
└── test/
└── java/
Run tests with:
mvn test
- Build the project:
mvn package -f pom.xml
- Run the application:
java "-Dspring.profiles.active=prod" "-DDATABASE_URL=" "-DDATABASE_USERNAME=" "-DDATABASE_PASSWORD=" -jar API-0.0.1-SNAPSHOT.jar