POS System

A browser-based POS for daily retail transactions. The React 19 + TypeScript client renders the product catalog, cart, checkout flow, and receipts, while the PHP REST API owns the money-sensitive business rules — pricing, stock deduction, and order totals — so they cannot be bypassed from the client. Order confirmation and inventory deduction run in the same MariaDB transaction, keeping stock levels consistent with every completed sale, and sales records are stored as structured rows that support daily and historical reporting.
Why a PHP REST API backed by MariaDB?
Keeping pricing, stock deduction, and order totals in a server-side API means money-sensitive rules live where they can be audited and cannot be tampered with from the client. PHP + MariaDB also deploy on standard shared hosting without heavy infrastructure.
Why React 19 + TypeScript on the frontend?
TypeScript gives the cart, product, and order models predictable types across components, while React's component model keeps the catalog, cart, and checkout flows modular and reusable.
Define the API contract before either side
Agreeing on the order and inventory endpoints up front let the client and server be built and tested independently, and storing currency amounts as integers avoided floating-point rounding in totals.
Orders and inventory are one atomic operation
Order confirmation and stock deduction run in a single database transaction, so a failure on either side can never leave inventory levels out of sync with recorded sales.