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 was still relying on paper notebooks and basic manual records to track daily sales. This workflow created several operational issues: inaccurate transaction records, slower checkout processes, fragmented data, and limited visibility into overall sales performance.
More importantly, the business owner had no data-driven way to anticipate future demand. Inventory planning was mostly based on intuition, making it difficult to prepare for demand spikes during high-sales periods such as Idul Fitri, Christmas, payday cycles, and other seasonal events. For a business dealing with high-value products like gold, poor forecasting could lead to missed sales opportunities, inefficient stock planning, or unnecessary capital being tied up in inventory.
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





