Case Study: 01

Perfect Traders: Point of Sale and Inventory Management System

Project Overview in Plain Language

Perfect Traders needed a reliable way to ring up sales and manage wholesale inventory without relying on paper ledgers. I built a custom point-of-sale system that runs in any web browser, updates stock counts as items are sold, and tracks customer credit automatically. Today, the store uses this platform daily to process customer orders and issue instant receipts without bookkeeping errors.

Live Product Demo: ringing up items, selecting customer, and completing sale Live Application Walkthrough: recording supplier purchases, ringing up sales, and printing invoices

01. The Problem

The business was managing customer sales, incoming supplier deliveries, and customer credit using physical paper notebooks. Cashiers frequently spent several minutes per order manually calculating partial payments and outstanding balances for regular customers. This created long lines at the checkout counter, discrepancies between recorded stock and actual shelf inventory, and hours of frustrating reconciliation work at the close of business every day.

Technical Context

Technical context: Paper ledgers and disconnected spreadsheets lacked atomic transaction guarantees, causing ledger drift between cash drawer totals, customer receivables, and inventory counts.

02. The Approach and System Design

I built a clean, browser-based counter application connected to a secure database that handles all calculations automatically: • Automatic Stock Adjustment: The moment a sale is completed, inventory numbers update immediately so cashiers always know what is on hand and never oversell. • Customer Credit and Supplier Balances: The system records whether a sale was paid in full, taken on credit, or partially paid with cash. It recalculates remaining balances instantly without manual math. • Instant Browser Receipts: Invoices and receipts generate right inside the cashier's web browser, allowing staff to print or download receipts in seconds without paying recurring cloud file-storage fees.

Technical Implementation

Technical implementation: Built with Next.js 14 App Router, Supabase, and PostgreSQL. Critical transactional logic was moved directly into PostgreSQL functions and triggers (pos_adjust_inventory, pos_recalc_sale, pos_recalc_purchase) to enforce single-source-of-truth calculations. Client-side PDF synthesis was implemented using jsPDF to eliminate cloud storage costs.

03. The Result and Business Impact

The system is deployed and in active daily use for commercial wholesale and retail counter operations. Cashiers can ring up sales and hand customers print-ready receipts in seconds. Manual arithmetic errors have been eliminated, and the business owner has a clear, real-time overview of daily revenue, customer credit owed, and active inventory levels from any device.

Technical Outcome

Technical outcome: Production deployment on Vercel with zero database desync issues. Free-tier cloud architecture maintained by eliminating server-side binary storage.

Technology Stack
Next.js 14ReactTypeScriptSupabasePostgreSQLTailwind CSSjsPDFRadix UI