Welcome to LocalizaCNPJ, a slick Java GUI app that lets you query Brazilian CNPJ data with ease! Powered by the BrasilAPI, this app fetches key details like company name, opening date, address, and postal code in a snap. Perfect for developers, entrepreneurs, or anyone curious about Brazilian businesses! ๐
- CNPJ Lookup: Enter a valid CNPJ and get instant info! ๐
- Data Display: Shows company details like:
- ๐ Opening date
- ๐ข Legal name (razรฃo social)
- ๐ Full address
- ๐ฎ Postal code (CEP)
- Sleek UI: Built with FlatLaf for a modern, polished look. โจ
- Real-Time Queries: Fetches live data from BrasilAPI. ๐
- Error Handling: Graceful handling of invalid inputs or API errors. ๐ก๏ธ
- Java: JDK 24 โ
- Build Tool: Maven 3.9.11 ๐ ๏ธ
- HTTP Client: Apache HttpClient 5.5 ๐ก
- JSON Parsing: Jackson Databind 2.15.2 ๐งฉ
- Logging: SLF4J Simple 2.0.9 ๐
- UI Theme: FlatLaf 3.6.1 ๐จ
- API: BrasilAPI ๐
- JDK 24: Make sure you have Java 24 installed. Download here. โ
- Maven 3.9.11: Get Maven to build the project. Install guide. ๐ ๏ธ
- Internet: Required to connect to BrasilAPI. ๐
- Clone the repo:
git clone https://github.com/willmayrink/LocalizaCNPJ.git
- Navigate to the project folder:
cd LocalizaCNPJ
- Build the project with Maven:
mvn clean install
- Run the app:
Or, use the generated executable JAR:
mvn exec:java
java -jar target/LocalizaCNPJ-1.0.jar
- Fire up the app. ๐ฅ
- Enter a valid CNPJ (e.g.,
12345678000195
) in the input field. โ๏ธ - Hit the query button to fetch data from BrasilAPI. ๐
- Check out the results: company name, opening date, address, and CEP displayed in the GUI. ๐
All dependencies are managed in the pom.xml
. Key libraries include:
- Apache HttpClient 5.5: For making HTTP requests to BrasilAPI.
- Jackson Databind 2.15.2: For parsing JSON responses.
- SLF4J Simple 2.0.9: For lightweight logging.
- FlatLaf 3.6.1: For a modern, flat UI theme.
See the full pom.xml
in the repo for details. ๐
The project uses the Maven Shade Plugin to create an executable JAR with all dependencies included. The main class is com.rjoliveira.localizacnpj.view.Main
. Run mvn package
to generate the JAR in the target/
directory. ๐๏ธ
This app queries the BrasilAPI endpoint /api/cnpj/v1/{cnpj}
to fetch CNPJ data. Check out the BrasilAPI docs for more details. ๐ก
Want to make this app even cooler? Contributions are welcome! ๐
- Fork the repo: https://github.com/willmayrink/LocalizaCNPJ
- Create a feature branch:
git checkout -b feature/awesome-feature
- Commit your changes:
git commit -m "Add awesome feature"
- Push to your branch:
git push origin feature/awesome-feature
- Open a pull request and letโs make it happen! ๐
This project is licensed under the MIT License. See the LICENSE
file in the repo for details. ๐ณ๏ธ
- BrasilAPI for providing free, open CNPJ data. ๐
- FlatLaf for the sleek UI theme. ๐จ
- All contributors who make this project shine! ๐
Got questions or ideas? Open an issue on GitHub or ping me there! ๐ฉ
Happy coding! ๐ป