Wert App is a PyQt5 desktop application built around a clear separation of concerns across four layers: a presentation layer that owns all visual widgets and stylesheets, a logic layer that handles user-facing workflows, a data layer that manages a MySQL database, and an integration layer that wraps two external HTTP APIs. Each layer communicates only with the layers directly adjacent to it, keeping the codebase easy to extend without touching unrelated code.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lucavallini/wert-app/llms.txt
Use this file to discover all available pages before exploring further.
Layer breakdown
The application is divided into four distinct layers, each with a well-defined responsibility. 1. Presentation layer —Assets/windows/ and Assets/styles/
All PyQt5 UI layouts live under Assets/windows/. Three UI files define the visual skeleton of each window:
widget_login.py(uiLogin) — login form layoutwidget_register.py(uiRegister) — registration form layoutmain_window.py(uiWert) — the full main window with notes, currency converter, and economic-data panels
Assets/styles/stylesheet.py wraps each raw UI class with a styled base class (loginStyle, registerStyle, mainWindowStyle). These base classes apply Qt stylesheets (colors, fonts, border radii) and configure alignment and echo modes so the logic layer inherits a fully-styled widget tree without embedding style details in business logic.
2. Logic layer — modules/
Each module contains a single class that subclasses the corresponding style base class and wires up all signal/slot connections:
logica_login.py(ventanaLogin) — validates credentials viaDatabaseManager, then opensventanaMainorventanaRegisterlogica_register.py(ventanaRegister) — validates new-user input (non-empty fields, password length ≥ 6, password match) then callsDatabaseManager.setRegisterlogica_main_window.py(ventanaMain) — orchestrates notes CRUD, currency conversion viaChangeAPi, and economic-data lookups viaWorldBankAPI
database/
conexion.py— reads the database password frompasswordBDD.txt, providesgetConexion()to open amysql.connectorconnection, and providessetTables()to create theusuariosandnotastables if they do not already existdb_operations.py—DatabaseManagerreceives an open connection in its constructor and exposes eight methods covering user registration, login, note creation, retrieval, and deletion
api/
world_bank_api.py—WorldBankAPIqueries the World Bank REST API for country lists, economic indicators, and historical data serieschange_api.py—ChangeAPiqueries the ExchangeRate-API v6 for live currency conversion rates
Application startup flow
main.py is the single entry point. It performs three steps before the event loop starts:
Ensure database tables exist
setTables() is called first. It opens its own connection, runs CREATE TABLE IF NOT EXISTS for usuarios, and then runs CREATE TABLE for notas (skipping silently if the table already exists).Create the QApplication instance
QApplication(sys.argv) initialises the Qt runtime. No window is shown yet.Window flow
Once the event loop is running, windows open and close in a linear sequence driven by user actions.ventanaLogin (entry point)
The login window is always shown first. The user can either submit credentials or click the register button.
- Register button →
ventanaRegisteropens as a secondary window while the login window stays visible. - Successful login →
ventanaLogincloses itself and opensventanaMain, passing the sharedDatabaseManagerinstance and the authenticated username.
ventanaRegister (optional)
Opens on top of the login window. On successful registration it closes itself; the login window remains so the user can sign in immediately.
ventanaMain (authenticated session)
The main application window. It holds all three feature panels — notes, currency converter, and economic data — in a single
QMainWindow. It owns references to both API client objects (WorldBankAPI and ChangeAPi) and uses the DatabaseManager passed from the login window for all note operations.Explore further
Database design and operations
MySQL schema, table definitions, and the full
DatabaseManager API reference.External API integrations
How
WorldBankAPI and ChangeAPi wrap external HTTP services and handle errors.