A comprehensive Python desktop application for business management with Clean Architecture, featuring company registration, product management, and sales order processing with external API integrations.
PYSYSTEM is a modern desktop business management application built with Python and Tkinter, implementing Domain-Driven Design (DDD) and Clean Architecture principles. The system provides comprehensive CRUD operations for companies, products, and sales orders, with advanced features like address autocomplete and document validation through Brazilian APIs.
- Complete CRUD Operations - Create, read, update, and delete companies
- Smart Validation - CPF/CNPJ validation with verification digits
- Address Autocomplete - Automatic address completion using CEP via BrasilAPI
- Contact Management - Email and phone validation with proper formatting
- Document Integration - Real-time CNPJ lookup with company data retrieval
- Excel Integration - Import products from .xlsx/.xls files with validation
- Inventory Control - Real-time stock management with oversell prevention
- Advanced Search - Search by name, SKU, or any product attribute
- Bulk Operations - Mass updates and data management capabilities
- Category Management - Product categorization and organization
- Complete Order Processing - From creation to completion
- Stock Integration - Automatic inventory updates and validation
- Dynamic Calculations - Real-time subtotals and totals
- Multi-item Orders - Support for complex orders with multiple products
- Order History - Complete audit trail and order tracking
- BrasilAPI Integration - CEP, CNPJ, and bank data validation
- Intelligent Caching - Performance optimization with automatic cache management
- Fallback Mechanisms - Robust error handling with offline capabilities
- Rate Limiting - Respectful API usage with built-in throttling
- Corporate Theme - Professional and consistent design
- Responsive Layout - Adaptive to different screen sizes
- Intuitive Navigation - Clear workflow and user experience
- Real-time Feedback - Immediate validation and status updates
- Python 3.8+
- Virtual environment (recommended)
-
Clone the repository
git clone https://github.com/teusdrz/PYSYSTEM.git cd PYSYSTEM -
Create virtual environment
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Run the application
python run_system.py
PYSYSTEM/
βββ src/
β βββ application/ # Use cases and DTOs
β β βββ dtos/ # Data Transfer Objects
β β βββ use_cases/ # Business logic
β βββ domain/ # Core business entities
β β βββ entities/ # Domain models
β β βββ repositories/ # Repository interfaces
β β βββ services/ # Domain services
β βββ infrastructure/ # External concerns
β β βββ external_services/ # API integrations
β β βββ persistence/ # Data storage
β β βββ report_generators/ # Report services
β βββ presentation/ # UI layer
β β βββ controllers/ # Application controllers
β β βββ gui/ # Tkinter interface
β βββ shared/ # Common utilities
βββ data/ # JSON data files
βββ assets/ # Icons and resources
βββ tests/ # Test suite
βββ requirements.txt # Python dependencies
This project follows Clean Architecture principles:
- Domain Layer: Core business logic and entities
- Application Layer: Use cases and application services
- Infrastructure Layer: External services and data persistence
- Presentation Layer: User interface and controllers
- Companies: Manage customer and supplier information
- Products: Track inventory with stock levels and pricing
- Sales Orders: Create orders and manage order items
- BrasilAPI: Automatic address lookup and data validation
- Use the tab interface to switch between different modules
- All forms include validation and error handling
- Data is automatically saved to JSON files in the
data/directory
The project includes comprehensive test suites:
# Run ultra comprehensive tests
python ultra_comprehensive_gui_tests.py
# Run automated GUI tests
python automated_gui_tests.pyTest Results: 82.3% success rate (93/113 tests passing)
The system uses JSON files for data storage located in the data/ directory:
companies.json- Company dataproducts.json- Product catalogsales_orders.json- Sales order records
BrasilAPI Integration:
- CEP address lookup
- CNPJ validation
- Bank information retrieval
- Product categorization suggestions
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Matheus Souza
- GitHub: @teusdrz
- β Core functionality implemented
- β GUI interface complete
- β Data persistence working
- β API integration functional
β οΈ Minor optimizations pending
Built with β€οΈ using Python and Clean Architecture principles