The project aims to connect musicians and managers, with the aim of helping the new musicians to get known. The interaction takes place at the Admin level in the beginning, while working on a future version where both Musicians and Managers can create their own profiles and manage them as well.
To run this project locally:
- Clone the repository:
git clone <https://github.com/Bootcamp-Factoria-F5/Free_API_Only.git>
- Navigate to the project directory:
cd Free_API_Only
- Run the application with Maven:
mvn spring-boot:run
The project was built with SpringBoot Initializr version 3.3.6, JAR Packaging, 21 Java
- Spring
- Spring Boot Dependencies:
- spring-boot-starter-data-jpa
- spring-boot-starter-web
- spring-boot-starter-validation
- jackson-datatype-jsr310
- Springdoc OpenAPI (springdoc-openapi-starter-webmvc-ui)
- Lombok
- MySQL
- H2
- PostgreSQL
- Database Drivers:
- mysql-connector-j
- postgresql
- h2
- Spring Boot Testing Dependencies:
- spring-boot-starter-test
- junit-jupiter-api
- junit-jupiter-engine
- mockito-core
- mockito-junit-jupiter
- IntelliJ IDEA Community Edition
- Java
- Maven
- Postman
- GIT
- GitHub
- GitHub Projects
- GitLab Actions
- Mermaid
- PlantUML Plugin
- Swagger
- Docker
- Register Musicians, Search entire list, List by Name, Update and Delete
- Register Managers, Search entire list, List by ID, Update and Delete
- Connects to an API through JPA and H2
- Each musician added to JPA receives an unique ID
- CRUD tested with Postman
- Using DTO Classes
- Search by Status using Enum Class
erDiagram
MANAGER ||--o{ MUSICIAN : has
MANAGER {
int id
String name
String company
String email
String seeking_skills
}
MUSICIAN {
int id
String name
String skills
String link
String photo
LocalDate dateCreated
}
- Managers have an extra filter and can be sorted by the status Active/ Inactive.
- While retrieving data using the GET by Status endpoint, it is necessary to write the status in capslock.
- The endpoint for this application is: localhost:8080/api/get/managers/status/ACTIVE
Added application-dev.properties
, application-test.properties
, and application-prod.properties
for environment-specific configurations.
Updated application.properties
to set dev
as the default active profile, to begin with.
Configured database settings and Hibernate behavior for each profile:
dev
: In-memory H2 database with schema updates.test
: Separate H2 database for testing withcreate-drop
behavior.prod
: MySQL database with schema validation.
Verified profile switching with spring.profiles.active
and ensured correct configurations load.
- mvn spring-boot:run -Dspring-boot.run.profiles=dev
- mvn spring-boot:run -Dspring-boot.run.profiles=test
- mvn spring-boot:run -Dspring-boot.run.profiles=prod
Steps to execute the aplication and pass the tests.
- [in progress] Musician Acceptance Test
- [in progress] Tests Unitarios
- [in progress] Global Exception Handling
This project uses Swagger for documenting the API endpoints. Swagger provides an interactive interface to explore and test the APIs.
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.15</version>
</dependency>
After running the application, you can access the Swagger UI by visiting: http://localhost:8080/swagger-ui.html
- Get All Managers:
GET /api/get/managers
- Create Manager:
POST /api/post/managers
- Delete Manager:
DELETE /api/del/managers/{id}
Below is a preview of the Swagger UI interface:
- Using the DEV Profile
- Main endpoint defined in Home Controller GET("/")
- 2nd endpoint defined in MusicianController GET("/")
- docker-compose build
- docker-compose up
- docker-compose down
- docker ps - to find the container ID
- docker logs <container_id> - to check the logs
Many thanks to my teachers, for their patience and wisdom: