This project is the final assessment for the Squadra New Thinkers Bootcamp. It consists of an API for managing addresses, people, and related geographic data, supporting CRUD operations for states, cities, neighborhoods, addresses, and people.
- Java 21
- Maven 3.9.9
- Docker
To run the project, follow these steps:
- Clone the repository and enter the project directory:
git clone git@github.com:clintonbrito/address-management-api.git
cd address-management-api- Now you need to start the Oracle database. To do this, run the following command:
docker-compose up -dNote
In case you'd like to see the logs, you can run the command without the -d flag or run the following command:
docker-compose logs -f- Now you can start the application. To do this, run the following command:
mvn spring-boot:runNote
The application will be available at http://localhost:8080.
The API has the following endpoints:
/uf: CRUD operations for states/municipio: CRUD operations for cities/bairro: CRUD operations for neighborhoods/pessoa: CRUD operations for people
The database is an Oracle database. After starting the docker container, the user C##JAVA will be created automatically with its credentials and permissions. The file criar_usuario_c##java_com_suas_permissões.sql contains the SQL script to create the user and grant the necessary permissions.
And the file script_sql_criar_tabelas.sql contains the SQL script to create the tables.
- Java
- Spring Boot
- Spring Data JPA
- Oracle Database
- Docker
- Maven
- Lombok
- MapStruct
The project follows the MVC architecture. The project is divided into the following packages:
Each entity has its own package with the following structure:
controller: Contains the controllers for the API endpointsdto: Contains the DTOs for the APImapper: Contains the mappers for the DTOsmodel: Contains the entities for the applicationrepository: Contains the repositories for the entitiesservice: Contains the services for the entitiesutil: Contains utility classesvalidator: Contains the validator classes
Besides the entity packages, the project has the following packages:
common: Contains common classes for the applicationcommon.exception: Contains the exception classes for the applicationGlobalExceptionHandlerfile: Contains the global exception handler for the application
Besides the packages, the project has the following files:
application.properties: Contains the application propertiescriar_usuario_c##java_com_suas_permissões.sql: Contains the SQL script to create the user and grant the necessary permissionsscript_sql_criar_tabelas.sql: Contains the SQL script to create the tablesdocker-compose.yml: Contains the Docker Compose file to start the Oracle database
This project is licensed under the MIT License - see the LICENSE file for details.