How michaelnic505/proyecto-lyra-erp-completo- works
1. Repository shape
This is a Java ERP suite organized as a multi-module system rather than a single app. The active architecture is split into lyra-gui (desktop client), lyra-service (backend), and lyra-shared (transport/domain contracts). The app module is a large older/legacy monolithic variant that still contains the original client, resources, database metadata, and custom Swing components.
2. Top-level runtime model
The intended production flow is: desktop client → network request/response layer → server → MySQL database. The client and server do not share business logic directly; they communicate through shared request/response DTOs and exception types in lyra-shared.
3. Client boundary
lyra-gui is the user-facing Swing application. Its entry point is com.simplecore.erp.client.main.LyraClient, with the main navigation centered around a login screen, splash screen, and a workspace shell (MainFrame, Workspace, TreeMenu). Most screens are custom Swing forms, not browser pages.
4. Client presentation and navigation
The client is built around a workspace + tree menu + panel loader pattern. The tree menu drives transaction selection, and the selected transaction is loaded into a central content area. The codebase includes reusable UI primitives for search boxes, match-code dialogs, custom tables, tabs, popups, panels, and window customization.
5. Client business modules
The client groups functionality into business domains such as:
- System access: users, roles, transactions, permissions, sessions
- Financial accounting: companies, chart of accounts, account classes/models/subclasses, account setup
- Logistics / plant maintenance: master data, locations, plants, equipment, maintenance plans, work orders, strategies, routine sheets
Many modules follow the same structure: controller, service, UI form, auxiliary search/list windows, and DTO injection/mapping helpers.
6. Client-side interaction pattern
Most client features follow a pattern of form controller → validation/filtering → service call → server request → DTO response → UI refresh. The client has many reusable abstractions for form state, list selection, match-code lookup, DTO injection, and table editing. That suggests a strong emphasis on consistent CRUD workflows across modules.
7. Server boundary
lyra-service is the backend runtime. Its entry points are LyraServer, LyraConsole, and ClientHandler. Incoming client requests are routed by RequestDispatcher to specific request handlers, which then delegate to managers/services. This is the main server-side separation: transport/dispatch → handler → manager/service → persistence.
8. Server business services
The backend mirrors the client’s key domains, especially around:
- authentication and sessions
- system users and transactions
- financial accounting entities
- countries, currencies, tax schemas, time zones
- company and cost-center setup
- account models, classes, subclasses, and account ranges
The handler/service split is fairly granular, with one request type often mapping to one handler and one service.
9. Shared contract layer
lyra-shared is the architectural glue. It defines:
- request/response envelopes and request types
- DTOs for business entities
- shared exceptions
- session and user models
- query filter models
This module is what keeps client and server aligned without duplicating protocol definitions.
10. Persistence and configuration
Database access is centered on MySQL, with pooled connections and generated/handwritten table metadata classes. The repo contains connection/config files, database descriptors, and SQL helper utilities. The server also has JSON-based configuration, while the client/legacy app retains .ly connection files and local preference resources.
11. Security and access control
Authentication is a first-class subsystem. Login/logout and session management exist on both sides of the client-server boundary, and the system access module models users, roles, transactions, and role-transaction permissions. There are also dedicated handlers/services for session state and permission-driven UI behavior.
12. Localization and presentation assets
The UI is internationalized with resource bundles for multiple locales, and the client includes extensive icon, sound, and style resources. This matters architecturally because the UI is designed to be highly localized and interactive, not minimal or data-only.
13. Reporting and document workflows
There are Jasper report templates and report/data-source helpers in the client, especially around maintenance work orders. That indicates a secondary output path besides CRUD screens: structured document/report generation from business data.
14. Legacy monolith
The app module is effectively a historical snapshot of the same ERP concepts in a more monolithic form. It contains older database configs, many legacy Swing forms, and extensive domain modules. For an architecture diagram, it should be treated as a legacy/previous-generation client application that overlaps functionally with the newer split lyra-gui / lyra-service / lyra-shared architecture.
Main entry points: LoginService.java Client service · LoginHandler.java Handlers · AuthenticationService.java Services · AbstractFormController.java Form layer
Components 25
lyra-gui
Current desktop client runtime and UI modules.
- LyraClient · Desktop client entrypoint.
lyra-gui/src/main/java/com/simplecore/erp/client/main/LyraClient.java - Login UI · Login and splash presentation.
lyra-gui/src/main/java/com/simplecore/erp/client/gui/login/Login.java - Workspace · Main frame, workspace, and tree menu navigation.
lyra-gui/src/main/java/com/simplecore/erp/client/gui/workspace/frontend/Workspace.java - Tree menu · Transaction tree and menu routing.
lyra-gui/src/main/java/com/simplecore/erp/client/gui/workspace/frontend/TreeMenu.java - Panel loader · Loads selected transactions into the workspace.
lyra-gui/src/main/java/com/simplecore/erp/client/controllers/gui/PanelLoader.java - Form layer · Reusable controllers, DTO injectors, validators, and persistence abstractions.
lyra-gui/src/main/java/com/simplecore/erp/client/abstractions/AbstractFormController.java - Financial · Financial accounting and company/account setup flows.
lyra-gui/src/main/java/com/simplecore/erp/client/gui/workspace/modules/financial/financialaccounting/chartofaccount/controller/ChartOfAccountController.java - Logistics · Master data for locations, plants, and maintenance setup.
lyra-gui/src/main/java/com/simplecore/erp/client/gui/workspace/modules/logistics/masterdata/locations/create/Location.java - Access UI · User, role, and transaction permission management.
lyra-gui/src/main/java/com/simplecore/erp/client/gui/workspace/modules/financial/financialaccounting/company/controller/FICompanyController.java - Client service · Client-side services that talk to server contracts and dispatch.
lyra-gui/src/main/java/com/simplecore/erp/client/services/login/LoginService.java
lyra-service
Backend request handling, services, and persistence coordination.
- Server main · Server entrypoints and dispatcher.
lyra-service/src/main/java/com/simplecore/erp/server/optionalmain/LyraServer.java - Dispatcher · Client handler and request dispatcher.
lyra-service/src/main/java/com/simplecore/erp/server/main/RequestDispatcher.java - Handlers · Request-specific handlers for login, company, account, and lookup operations.
lyra-service/src/main/java/com/simplecore/erp/server/handlers/LoginHandler.java - Managers · Business managers coordinating requests and domain logic.
lyra-service/src/main/java/com/simplecore/erp/server/managers/AuthenticationManager.java - Services · Domain services for accounting, company, access, and lookup data.
lyra-service/src/main/java/com/simplecore/erp/server/services/AuthenticationService.java - DB access · Server database config, pooled connections, and SQL utilities.
lyra-service/src/main/java/com/simplecore/erp/server/config/PooledConnectionService.java - Security · Password hashing and session/authentication support.
lyra-service/src/main/java/com/simplecore/erp/server/security/HashSecurity.java
lyra-shared
Shared protocol, DTO, and exception contracts.
- Requests · Base request model and request types.
lyra-shared/src/main/java/com/simplecore/erp/shared/requests/base/Request.java - Responses · Base response model and response types.
lyra-shared/src/main/java/com/simplecore/erp/shared/responses/base/Response.java - DTOs · Business DTOs, sessions, users, and query filters.
lyra-shared/src/main/java/com/simplecore/erp/shared/models/dto/ChartOfAccountDTO.java - Exceptions · Shared exception types used across client and server.
lyra-shared/src/main/java/com/simplecore/erp/shared/exceptions/DatabaseException.java
app
Older monolithic ERP client and legacy support code.
- Legacy app · Older monolithic ERP client with embedded configs and modules.
app/src/main/java/com/simplecore/erp/main/App.java - Legacy workspace · Older workspace, tree menu, and custom Swing shell.
app/src/main/java/com/simplecore/erp/gui/workspace/LyraWorkspace.java - Legacy modules · Legacy business modules and custom CRUD screens.
app/src/main/java/com/simplecore/erp/modules/logistics/plantmaintenance/workorders/legacy/orders/o01_creation_of_orders/O01_Creacion_Ordenes_Trabajo.java - Legacy DB cfg · Old database metadata, connection files, and SQL helpers.
app/src/main/java/com/simplecore/erp/config/database/DatabaseConfig.java
Connections 29
- LyraClient → Login UI: starts · Client launches the login flow.
- LyraClient → Workspace: opens · Successful login leads to the main workspace.
- Workspace → Tree menu: navigates · Workspace exposes transaction navigation.
- Tree menu → Panel loader: loads · Tree selections load screens into the content area.
- Panel loader → Form layer: uses · Screen loading relies on shared form/controller abstractions.
- Financial → Form layer: builds on · Financial workflows use the common form pattern.
- Logistics → Form layer: builds on · Logistics workflows use the common form pattern.
- Access UI → Form layer: builds on · Access screens use the common form pattern.
- Client service → Requests: sends · Client services issue shared request types.
- Client service → Responses: receives · Client services consume shared responses.
- Client service → DTOs: maps · Client maps forms and DTOs.
- Client service → Exceptions: handles · Client handles shared exception types.
- Client service → Dispatcher: calls · Client service boundary talks to the server dispatcher.
- Server main → Dispatcher: hosts · Server runtime hosts request dispatch.
- Dispatcher → Handlers: routes · Dispatcher routes requests to handlers.
- Handlers → Managers: delegates · Handlers delegate business work to managers.
- Managers → Services: coordinates · Managers coordinate domain services.
- Services → DB access: queries · Services persist and query through pooled DB access.
- Handlers → Requests: binds · Handlers decode shared request contracts.
- Handlers → Responses: emits · Handlers produce shared responses.
- Handlers → DTOs: uses · Handlers and services work with shared DTOs.
- Services → Security: authenticates · Security supports login and session management.
- Services → Exceptions: throws · Shared exceptions represent domain and protocol failures.
- Legacy app → Legacy workspace: contains · Legacy app contains the older workspace shell.
- Legacy workspace → Legacy modules: opens · Legacy navigation loads many domain screens.
- Legacy modules → Legacy DB cfg: queries · Legacy modules use old DB helpers and table metadata.
- Legacy app → Workspace: overlaps · Legacy architecture overlaps the newer split client.
- Legacy app → DB access: shares schema · Legacy and current server share database-oriented metadata.
- DTOs → Services: contracts · Shared DTOs align client and server data models.