Goldies POS - Point of Sale with ML Sales Forecasting
A full-stack POS system for a gold retail business, featuring real-time transactions, barcode scanning, and invoice printing. Integrated with an ML sales forecasting engine (Ridge + Random Forest ensemble with 24+ engineered features) and Gemini AI-powered business insights.

Project Overview
The Problem
A gold retail business relied on manual sales recording using paper notebooks and Excel, leading to data inaccuracies, slow checkout processes, and zero visibility into future sales trends. The business owner had no data-driven way to plan inventory or anticipate demand spikes during seasonal events like Idul Fitri and Christmas or other events.
The Solution
I designed and built a full-stack Point of Sale system with an integrated ML forecasting engine, consisting of four interconnected components:
- Mobile App (Flutter): A feature-rich POS with barcode scanning, cart management with automatic tax/discount calculation, multiple payment methods (Cash, QRIS, Transfer, Online), and invoice printing. Built with Clean Architecture and BLoC state management.
- Backend API (Laravel): A centralized server with Sanctum token authentication, RESTful API, and MySQL database for real-time synchronization of products, categories, customers, staff, and transactions.
- Sales Forecasting Engine (Python/Flask): An AI/ML microservice using an ensemble of Ridge Regression (polynomial degree 2) and Random Forest (450 estimators). The model leverages 24+ engineered features, including lag features (10 residual lags), rolling statistics (3/7/30-day moving averages), momentum indicators, cyclical encodings (sin-transformed month/week), seasonal proximity to Idul Fitri and Christmas, and real-time gold price data from Metal API.
- Gemini AI Integration: The forecasting page feeds prediction results into Google's Gemini API to automatically generate business insights and actionable recommendations, helping the owner make data-driven decisions.

*Simplified architecture diagram, actual implementation includes additional middleware, error handling, and data validation layers.
The Results
The system successfully digitized the entire sales workflow. The forecasting model is evaluated using MAPE (Mean Absolute Percentage Error), RMSE (Root Mean Squared Error), and MAE (Mean Absolute Error) on a 30-day test set to ensure prediction reliability. The ensemble approach, where Ridge captures long-term trends and Random Forest corrects short-term residual patterns, delivers more robust predictions than either model alone.
Key Features
- Tablet view with Android and iOS Support
- Real-time POS transactions with centralized MySQL database
- Ensemble forecasting model: Ridge Regression (trend) + Random Forest (residual correction)
- 4+ engineered features: lag, rolling stats, momentum, cyclical encoding, seasonal proximity
- Model evaluation with MAPE, RMSE, and MAE
- Idul Fitri & Christmas seasonality detection for demand spike prediction
- Real-time gold price integration via Metal API for forecasting accuracy
- Automated model retraining from live database sales history
- Gemini AI-powered business insights & recommendations from forecast data
- Product & inventory management with real-time stock updates
- Staff authentication with role-based access
- Multi-payment support: Cash, QRIS, Bank Transfer, E-Wallet
Tech Stack
Tags
Project Gallery





