CPF Validator is a FullStack application that allows users to enter a Brazilian CPF (Cadastro de Pessoas Físicas) number and verify if it’s valid. The application provides a single route to validate CPF numbers based on Brazilian CPF validation rules.
- Length and Pattern Check: It ensures the CPF has exactly 11 digits and isn’t a sequence of repeating numbers.
- Verification Digit Calculation: Calculates two verification digits to confirm CPF validity.
- Description: Validates a CPF number provided in the request.
- Request:
- Method:
POST
- URL:
/api/validate-cpf
- Body:
{ "cpf": "string" }
cpf
: The CPF number to validate, as a string (e.g.,"12345678909"
).
- Method:
- Response:
- JSON object:
{ "isValid": true | false }
isValid
: A boolean indicating if the CPF is valid (true
) or invalid (false
).
- JSON object:
- Clone the repository:
git clone [email protected]:igorrCarvalho/CPF-Validator.git cd CPF-Validator
- Start both backend and frontend docker containers:
cd src docker-compose up -d
The app will be hosted in localhost:3000