
Tokyo Night Theme (Dark & Light Modes)
- β Features
- πΈ Screenshots
- ποΈ Technical Implementation
- βοΈ Technologies
- π Getting Started
- π§ͺ Testing
- π License
- π₯ Authors
Industrial-grade Brazilian document validation:
- β
Dual Validation Modes
Single Mode: Real-time validation with instant feedbackBatch Mode: Process multiple documents (one per line)
- π Two-Step Validation
- Finite Automaton: Format verification via DFA (5 RG patterns β’ 5 CPF patterns)
- Check Digit: Mathematical validation using modulo 11
- π¨ Modern Interface
- Responsive design with Tailwind CSS
- Smooth dark/light mode transitions
Valid RG Patterns
111111111 β’ 11.111.111-1 β’ 11111.111-1 β’ 11.11111-1 β’ 11111111-1
Valid CPF Patterns
11111111111 β’ 111.111.111-11 β’ 111111.111-11 β’ 111.111111-11 β’ 111111111-11

Finite State Machine with Transition Rules
π₯ Download JFLAP Project File
π Complete Transition Table (Enum-based States)
| State | 0-9 | x | . | - |
|---|---|---|---|---|
| β Q0 | Q1 | β | β | β |
| Q1 | Q2 | β | β | β |
| Q2 | Q3 | β | Q12 | β |
| Q3 | Q4 | β | Q22 | β |
| Q4 | Q5 | β | β | β |
| Q5 | Q6 | β | Q20 | β |
| Q6 | Q7 | β | Q29 | β |
| Q7 | Q8 | β | β | β |
| Q8 | Q9 | Q19 | β | Q21 |
| Q9 * | Q10 | β | β | Q30 |
| Q10 | Q11 | β | β | β |
| Q11 * | β | β | β | β |
| Q12 | Q13 | β | β | β |
| Q13 | Q14 | β | β | β |
| Q14 | Q15 | β | β | β |
| Q15 | Q16 | β | Q20 | β |
| Q16 | Q17 | β | β | β |
| Q17 | Q18 | β | β | β |
| Q18 | Q19 | Q19 | β | Q21 |
| Q19 * | β | β | β | β |
| Q20 | Q16 | β | β | β |
| Q21 | Q19 | Q19 | β | β |
| Q22 | Q23 | β | β | β |
| Q23 | Q24 | β | β | β |
| Q24 | Q25 | β | β | β |
| Q25 | Q26 | β | Q29 | β |
| Q26 | Q27 | β | β | β |
| Q27 | Q28 | β | β | β |
| Q28 | Q10 | β | β | Q30 |
| Q29 | Q26 | β | β | β |
| Q30 | Q10 | β | β | β |
(Implemented using Java Enums and HashMaps)

Single-document Text Input Validation

Multi-document Text Input Validation
src/
βββ main
βΒ Β βββ java/br/edu/fesa/validator
βΒ Β βΒ Β βββ ValidatorApplication.java # Main class
βΒ Β βΒ Β βββ controller/DocumentController.java # REST endpoints
βΒ Β βΒ Β βββ model/DocumentResultModel.java # Validation result DTO
βΒ Β βΒ Β βββ service/DocumentService.java # Business logic
βΒ Β βΒ Β βββ utils
βΒ Β βΒ Β βββ AFDValidator.java # State machine implementation
βΒ Β βΒ Β βββ CheckDigitValidator.java # Digit calculation
βΒ Β βββ resources
βΒ Β βββ templates/index.html # Thymeleaf template
βΒ Β βββ static/css/styles.css # Tailwind styles
βββ test
βββ java/br/edu/fesa/validator
βββ service/DocumentServiceTest.java # 13 Tests
βββ utils
βββ AFDValidatorTest.java # 13 Tests
βββ CheckDigitValidatorTest.java # 12 Tests- Backend: Spring Boot 3.4.2 + Java 17
- Frontend: Thymeleaf + Tailwind CSS
- State Machine: Enum-based DFA with HashMap transitions
- Build: Maven 3.9+
- Testing: JUnit 5 + Mockito (38 Total Tests)
- JDK 17
- Maven 3.9+
git clone git@github.com:Rutpiv/cpf-rg-validator.git
cd cpf-rg-validator
mvn clean installmvn spring-boot:runAccess: π http://localhost:8080
Comprehensive validation coverage:
mvn test- β 13 Service Tests (Business logic)
- β 13 Automaton Tests (State transitions)
- β 12 Check Digit Tests (Mathematical validation)
Distributed under BSD 3-Clause License.
β‘οΈ View Full License Text
Students from Engenheiro Salvador Arena College:
β‘οΈ Complete Contributors List
Compilers Course Project β’ 2025 Semester