How stredes/app_control_negocio works
Project type and purpose
• This is a standalone, desktop‐based management system (“Control de Tu Negocio”) written in Python.
• It follows an MVC-like layering: a UI layer (views), a controller layer (business logic), a model/data layer (ORM and database), plus auxiliary utilities (exporter, DB checker).
File structure
• Top-level scripts:
• main.py – application entry point (initializes UI and orchestrates startup)
• verificar_db.py – checks/initializes the SQLite database
• app/db – database setup module (app/db/database.py) pointing at app/data/negocio.db
• app/models – domain models (Cliente, Producto, Venta, Compra, Inventario, etc.)
• app/controllers – controllers that implement use cases by invoking models and DB routines
• app/ui – view classes for each screen (clientes_view, ventas_view, inventario_view, etc.) plus main_window
• app/utils – helper modules (e.g., exportador.py for data export)
• ControlNegocio.spec – a specification/test file
Key insights from README
• “Sistema de gestión integral en Python” implies full coverage of business workflows (sales, purchases, inventory, finances)
• No external services – data is stored locally in an SQLite file
Detailed breakdown of components
– UI Layer: main_window.py (launches the app), individual “*_view.py” screens
– Controllers: one controller per domain area (clientes, productos, ventas, etc.)
– Models: one class per table (Cliente, Producto, Compra, Venta, Inventario, Proveedor, Finanzas, etc.)
– DB Access: database.py exposing get_session() or execute_query() methods
– Utilities: exportador.py (generates CSV/Excel), verificar_db.py (handles migrations or initial schema check)