How omada-k/retailhub works
Project Type & Purpose
• This is a standalone, full-stack, desktop application (Java Swing GUI) for managing retail data (customers, orders, products, discounts, users).
• It includes both operational functionality (CRUD via DAOs) and analytics (Python scripts for segmentation, time series, cleaning, and external API data ingestion).
File Structure & README
• src/main/java/com/ui: Swing frames & forms → the Presentation Layer
• src/main/java/com/controller + com/service: orchestrates business logic, invokes Python
• src/main/java/com/dao: data access objects using JDBC & HyperSQL
• src/main/python: analytical scripts (Pandas, API fetch, cleaning)
• pom.xml & requirements.txt: Java dependencies (Maven) and Python packages
• jupiter: Jupyter notebooks (not part of the deployed app, but represent offline analytics)
a. Presentation Layer (Java Swing Client)
• BaseFrame, MainFrame, individual Entity Frames (CustomerFrame, OrderFrame, etc.)
b. Controller/Service Layer (Java)
• Controllers manage UI events → Services (DataGenerator, PythonRunner)
c. Persistence Layer
• DAOs (CustomerDAO, OrdersDAO, ProductsDAO, UserDAO)
• DataBaseConfig → JDBC connection to embedded HyperSQL
d. Analytics Layer (Python Engine)
• PythonRunner invokes checkbox1.py, get_api_data_script_main.py, etc.
• Pandas-based transformations, segmentation, time-series
e. External Systems
• External REST API (via Python get_api_data_script_main.py)
f. Database
• HyperSQL embedded DB
Relationships & Data Flows
• UI actions → Controller → Service
• Service → DAO → HyperSQL (CRUD)
• Service → PythonRunner → Python interpreter → Python scripts
• Python scripts may read/write CSV or invoke DAO indirectly if configured
• Python scripts → produce analytics results → Service → UI display
• Python scripts → optional REST API calls → external system → data ingestion
Architectural Patterns & Design Principles
• Layered architecture: Presentation → Controller/Service → Persistence
• DAO pattern for data access
• Adapter/facade (PythonRunner) to integrate Python scripts into Java
• Single monolith: all Java modules built/deployed together via Maven
• Extensibility: Jupyter notebooks for offline exploration
Technologies & Frameworks
• Java 11+, Swing (GUI)
• JDBC + HyperSQL (in-memory/embedded database)
• Maven (build lifecycle)
• Python 3.x, Pandas, Jupyter (analytics)
• Lib (Java reflection for search functionality)
Final Checklist
• [ ] All components labeled
• [ ] Container bounds for “Java Monolith” and “Analytics”