How mevaktecno-vane/sistema_bancario works
Project Type and Purpose
• This is a Python-based desktop/GUI banking application (not a web app) that models a bank’s core operations (clients, accounts, cards, transactions) with an interactive Flet interface, PDF reporting via FPDF, and comprehensive unit tests.
File Structure Analysis
• Top level:
• main.py – application entry point that initializes the Flet GUI and binds UI events to business logic.
• requirements.txt – lists flet, fpdf, pytest.
• src/ – core application code:
– app_banco.py (orchestrator/controllers)
– cliente.py, cuenta.py, cuenta_ahorro.py, tarjeta.py, transaccion.py (domain model classes)
– exportar_datos_a_pdf.py (infrastructure/service for PDF generation)
• tests/ – pytest unit tests for each domain class.
• README.md – describes architecture, POO principles, tools.
Key Architectural Insights from README
• Layered design using OOP: abstraction, inheritance, polymorphism, encapsulation.
• Presentation layer built with Flet (main.py + app_banco.py hooking into domain services).
• Domain layer composed of Cliente, Cuenta (+ CuentaAhorro subclass), Tarjeta, Transaccion.
• Infrastructure service layer for PDF export (FPDF).
• No external database—data is held in memory and exported to PDF.
a. Main Components
• Presentation Layer (UI): Flet framework, main.py, app_banco.py
• Domain Layer: Cliente, Cuenta, CuentaAhorro, Tarjeta, Transaccion classes
• Service/Infrastructure Layer: exportar_datos_a_pdf.py + FPDF library
• External Libraries: Flet, FPDF
• Tests: pytest modules (for completeness, shown as a parallel “Validation” component)
b. Relationships and Interactions
• UI triggers controller methods in app_banco.py (e.g., create_client(), perform_deposit()).
• Controller uses domain classes to execute operations; domain classes record Transaccion objects.
• Upon user request, controller calls exportar_datos_a_pdf to produce PDF.
• Tests exercise domain classes directly.
c. Architectural Patterns and Principles
• Layered architecture (Presentation → Domain → Infrastructure)
• OOP principles:
– Inheritance (CuentaAhorro extends Cuenta)
– Polymorphism (overriding interest calculation)
– Encapsulation (private attributes with getters)
• MVC-style separation: Flet UI acts as View, app_banco.py as Controller, domain classes as Model.
d. Technologies and Frameworks
• Flet (UI)
• FPDF (PDF generation)
• pytest (unit testing)
• Python standard library
Detailed Element Capture
• Six domain classes plus the export module.
• Main.py as the bootstrap component instantiating the Flet app.
• Dependency on requirements.txt libraries.
• Test suite as a separate validation layer to emphasize quality assurance.
• Optionally, include the git/GitHub workflow in an appendix if version-control integration is part of the desired system context.