Clique aqui para acessar o README PT-BR
Med Voll API is a robust healthcare management system built with Java and Spring Boot 3. This project was developed as part of the course "Spring Boot 3: Document, Test, and Prepare an API for Deployment". It provides comprehensive functionality for managing patients, doctors, and medical appointments, offering seamless operations for registration, listing, updating, and deletion of records.
- Java: Core programming language
- Jakarta Validation: Data validation
- Spring Boot 3: Latest version of the application framework
- Spring Data JPA: Database operations
- Spring Security: Authentication and authorization
- Flyway: Database migration tool
- Maven: Dependency management and build automation
- MySQL: Database management system
- Swagger: API documentation
- IntelliJ IDEA: Integrated development environment
- Insomnia: API testing and development tool
src/main/java/med/voll/api/
βββ controller/ # API endpoints
βββ domain/ # Business logic and repositories
βββ infra/ # Configurations and infrastructure
| Method | Endpoint | Description |
|---|---|---|
/pacientes |
Register new patient | |
/pacientes |
List active patients | |
/pacientes/{id} |
Get patient details | |
/pacientes |
Update patient info | |
/pacientes/{id} |
Deactivate patient |
| Method | Endpoint | Description |
|---|---|---|
/medicos |
Register new doctor | |
/medicos |
List active doctors | |
/medicos/{id} |
Get doctor details | |
/medicos |
Update doctor info | |
/medicos/{id} |
Remove doctor |
| Method | Endpoint | Description |
|---|---|---|
/consultas |
Schedule appointment | |
/consultas |
Cancel appointment |
Access the API documentation through Swagger. Configuration example:
@Configuration
public class SpringDocConfigurations {
@Bean
public OpenAPI customerOpenAPI() {
return new OpenAPI()
.components(new Components()
.addSecuritySchemes("bearer-key",
new SecurityScheme()
.type(SecurityScheme.Type.HTTP)
.scheme("bearer")
.bearerFormat("JWT")));
}
}- Java 17+
- Maven
- MySQL Server
- IntelliJ IDEA (recommended) or your preferred IDE
To quickly set up the project using Spring Initializr:
- Go to Spring Initializr
- Select the following options:
- Project: Maven Project
- Language: Java
- Spring Boot: 3.0.0 (or the latest stable version)
- Project Metadata:
- Group:
med.voll - Artifact:
api - Name:
medvoll-api - Package Name:
med.voll.api - Packaging: Jar
- Java: 17+
- Group:
- Add the following dependencies:
- Spring Web
- Spring Data JPA
- Spring Security
- MySQL Driver
- Flyway Migration
- Spring Boot DevTools
- Click on Generate to download the project as a zip file.
- Extract the zip file and open it in IntelliJ IDEA.
- Create a MySQL database for the project
- Create a
.envfile in the project root with the following variables:
DB_ADDRESS=YOUR_DATABASE_ADDRESS
DB_NAME=YOUR_DATABASE_NAME
DB_USER=YOUR_DATABASE_USER
DB_PASSWORD=YOUR_DATABASE_PASSWORD
JWT_SECRET=YOUR_JWT_SECRETThe project uses the following configuration in application.properties:
spring.config.import=file:.env[.properties]
spring.datasource.url=jdbc:mysql://${DB_ADDRESS}/${DB_NAME}
spring.datasource.username=${DB_USER}
spring.datasource.password=${DB_PASSWORD}
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
server.error.include-stacktrace=never
api.security.token.secret=${JWT_SECRET:12345678}- Clone the repository:
git clone https://github.com/zlucasftw/alura-curso-java-spring-boot-3-documente-teste-deploy.git- Navigate to project directory:
cd alura-curso-java-spring-boot-3-documente-teste-deploy-
Create and configure the
.envfile as described above -
Run the application:
mvn spring-boot:runThe application will start and Flyway will automatically run the database migrations.
- The application will be available at
http://localhost:8080 - Access the Swagger documentation at
http://localhost:8080/swagger-ui.html - Test the endpoints using Insomnia or your preferred API testing tool
Contributions are welcome! Feel free to:
- Open issues
- Submit pull requests
- Suggest improvements
This project is licensed under the AGPL V3 License - see the LICENSE file for details.