How poolborges/unicenta-pos works
Project type and purpose
• This is a full-stack, desktop Point-Of-Sales (POS) application written in Java (Swing UI), organized as a multi-module Maven project.
• The README (“Kriol Open Source Point Of Sales”) confirms it’s a fork of Unicenta/OpenbravoPOS, with modules for the core app, domain model, data access, hardware abstraction, internationalization, templates, and third-party libraries.
File structure
• Top-level pom.xml defines the multi-module build.
• Modules under the root:
• kriolos-opos-app: the Swing application (UI, forms, StartPOS)
• kriolos-opos-base: foundational utilities (beans, data loader/persistence, GUI helpers)
• kriolos-opos-domain: business-domain entities and DataLogic classes (catalog, customers, sales, suppliers, etc.)
• kriolos-opos-hardware: hardware SPI for printers, displays, scales, scanners
• kriolos-opos-i18n / i18n_pt: resource bundles (locales)
• kriolos-opos-template: XML/Velocity templates for printing tickets, reports
• kriolos-opos-thirdparty: embedded JARs (OneWire, WebLaF)
• docker-compose.yml and README describe spinning up a MySQL/MariaDB container for development.
• CI/CD workflows (.github/workflows/ci.yml, Travis, crowdin.yml) and docs under docs/ confirm build and publication pipelines.
Key insights from README
• Launch path: mvnw exec:java -pl kriolos-opos-app com.openbravo.pos.forms.StartPOS
• Dependencies: MySQL/MariaDB (JDBC), Liquibase for schema migrations, no heavyweight framework—custom DataLogic + JDBC loader.
Main components & interactions
a. User Interface (kriolos-opos-app)
• Swing panels & forms (com.openbravo.pos.forms, com.openbravo.pos.panels, …)
• Starts in StartPOS → AppViewConnection → JRootApp → various JPanels
• Renders menus, catalog, ticketing, reports
b. Business Domain (kriolos-opos-domain)
• DataLogic* classes handle business rules and queries (DataLogicSales, DataLogicCustomers, etc.)
• Domain entities (CustomerInfo, TicketInfo, ProductInfo, etc.)
• BeanFactory and script engines (BeanFactoryScript, ScriptEngineVelocity, etc.)
c. Persistence Layer (kriolos-opos-base)
• JDBC-based Data Loader (SessionDBMySQL, PreparedSentence, SerializerRead/Write)
• DataParams, SentenceExec, Transaction abstractions
• Liquibase XML changelogs (src/main/resources/pos_liquidbase)
d. Hardware Abstraction (kriolos-opos-hardware)
• SPI interfaces (DevicePrinter, DeviceFiscalPrinter, DeviceDisplay, DeviceScale, DeviceScanner)
• ESC/POS, JavaPOS, screen‐simulator implementations
• CommStream abstraction for serial/USB communication
e. Templates & Reports (kriolos-opos-app & crisolos-opos-template)
• Velocity/XML templates in resources/com/openbravo/pos/templates
• JasperReports jrxml files under resources/com/openbravo/reports
f. Internationalization (kriolos-opos-i18n, kriolos-opos-i18n_pt)
• Resource bundles for UI and reports (Bundle.properties, *_pt.properties)
g. Third-Party Libraries (kriolos-opos-thirdparty)
• OneWireAPI.jar, WebLaF for look-and-feel
Architectural patterns & design principles
• Layered architecture:
• Presentation(UI) → Service/Business (DataLogic) → Persistence (JDBC/Data Loader) → Database
• Hardware layer accessed via SPI (inversion of control, factory patterns)
• Modularization via Maven multi-module: clear separation of concerns
• Factory & Strategy patterns:
• BeanFactory for entity creation
• PaymentPanelFactory, MagCardReaderFac
• ScriptEngineFactory
• Extensibility points:
• SPI for plugging hardware devices
• Script templates for custom business logic
• Clear labels on all modules and packages
• Related packages (e.g., com.openbravo.pos.sales → Domain → DataLogicSales)