How dils02/prueba works
Project Type and Purpose
• This is a monolithic, full-stack internal web application built with Python and Streamlit.
• Purpose: Automate the monthly calculation of production bonuses and fill out an Excel budget file for HR.
High-Level Architecture Analysis
• Single deployment unit (no microservices).
• Layers:
a. Presentation Layer (Streamlit UI)
b. Business Logic Layer (feature modules)
c. Data Access Layer (SQLite + Excel files on disk)
Main Components
A. User & Browser
• The HR user accesses the app via a browser pointing at the Streamlit server.
B. Streamlit Application
• Entry point scripts (Interfaz_DB.py, PROYECTO_MENU/Interfaz_DB.py)
• UI pages and menus under each feature folder:
• archivo_excel/visualizar_excel.py
• armado_de_tabla/interfaz.py
• calculo_de_bono/interfaz.py
• calculo_mensual/interfaz.py
• gestion_parametros/interfaz.py
• Static assets: assets/styles.css
C. Business Logic Modules
• calculos/…: core computational routines (bono.py, promedios.py, etc.)
• armado_de_tabla/: orchestrates Excel table building
• calculo_mensual/: monthly bonus & overtime calculators + JSON mappings
• calculo_de_bono/: overall bonus budget estimations
D. Data Access & Persistence
• SQLite file gestion_parametros/parametros.db for parameter storage
• Excel files on disk (input & output under archivo_excel folder)
• JSON mapping file calculo_mensual/mapeo_bonos.json
E. File System
• Stores generated Excel budgets and reads source spreadsheets.
Interactions and Data Flow
1. User → Browser → HTTP request to Streamlit server
2. Streamlit UI layer determines which feature to invoke
3. UI calls into Business Logic modules
• For parameter management: logic_parametros.py ↔ db.py ↔ SQLite
• For Excel operations: procesar_excel.py, rellenar_*.py → read/write .xlsx
• For calculations: functions in cálculos/ invoked by calculo_mensual or calculo_de_bono
4. Business Logic returns results to UI
5. UI renders results and offers download link for generated Excel
Architectural Patterns & Principles
• Layered pattern (Presentation → Logic → Data)
• Single responsibility: each folder handles one major feature
• Reuse of calculos module for all numeric computations
• File-based persistence for Excel and lightweight relational DB for parameters
Technologies & Frameworks
• Python 3.x
• Streamlit for web UI
• SQLite (sqlite3 in db.py)
• pandas / openpyxl or similar (implied by Excel processing)
• CSS for styling (assets/styles.css)