A RESTful API that allows you to validate Brazilian CPF (Cadastro de Pessoa Física) numbers.
How to build
docker build ./ -t cpf-restrito
How to run
docker-compose up
How to access
The application will be available at http://localhost:8080/cpf/
Tests
Unit tests were made with the JUnit and Mockito frameworks. To run the tests, just execute the command:
mvn test
Technologies used
- Java 17
- Spring Boot
- Spring Data JPA
- PostgreSQL
- Docker
- Docker Compose
- Maven
- JUnit
- Mockito
- Postman (for request testing)
Project organization
The project was organized in layers, being: Controller, Service, Repository and Model. Based on Clean Architecture, it was possible to separate the responsibilities of each layer, making the code cleaner and easier to maintain.
Choice of technologies
I chose these technologies because they are the ones I have the most experience with and the ones I use most in my day-to-day work. With the exception of the Mockito test framework and Docker, which I took as a challenge to learn how to use them in this project.
docker build ./ -t cpf-restrito
docker-compose up
A aplicação estará disponível em http://localhost:8080/cpf/
Os testes unitários foram feitos com os frameworks JUnit e Mockito.
Para rodar os testes, basta executar o comando:
mvn test
- Java 17
- Spring Boot
- Spring Data JPA
- PostgreSQL
- Docker
- Docker Compose
- Maven
- JUnit
- Mockito
- Postman (para testes de requisições)
O projeto foi organizado em camadas, sendo elas: Controller, Service, Repository e Model. Tomando como base a Clean Architecture, foi possível separar as responsabilidades de cada camada, deixando o código mais limpo e de fácil manutenção.
Escolhi essas tecnologias por serem as que tenho mais experiência e por serem as que mais utilizo no meu dia a dia. Com exceção do framework de testes Mockito e do Docker, que tomei como desafio para aprender a utilizá-las nesse projeto.