Classic Bag

Overview
An Algerian bag retailer's online shop, in-store point of sale and customer loyalty wallet, running on one stock count and one customer record.
Classic Bag is the online shop, in-store point of sale and customer wallet of an Algerian bag retailer. It covers the whole path of a sale: the catalogue on the website, the cash drawer at the counter, the delivery company that carries the parcel, and the loyalty card that brings the customer back. I built it alone, from the first migration to the printed receipt, and I still maintain it as the shop keeps changing how it sells.


The problem
The shop sells through a website and over a counter, and those two worlds usually drift apart. The website thinks it has three of a bag in stock, the counter sells the last one, and the next online customer is promised something that is no longer there. The same customer is a name on an order online and an anonymous face at the till, so a loyalty scheme cannot follow them between the two. Delivery is its own headache: Algeria has 69 wilayas, each with communes, home delivery and stop-desk delivery, and three different carriers with three different price tables. Someone at the shop was typing those prices by hand, commune by commune, and a wrong number meant either a loss on the order or an argument with the customer. Add returns, exchanges, gift cards and promotions that must not stack in the customer's favour, and the spreadsheet stops being an option.
The solution
One system where a product exists once, with its variations, its stock and its barcodes, and every channel reads the same record. An online order reserves stock while it waits for confirmation; a counter sale or a confirmed order deducts it; a return puts it back through the same service. The counter runs on cash sessions, so the drawer is counted at opening and closing and every movement has a name and a time. The customer carries a wallet with two balances, one spendable and one cashback that unlocks later, and the same wallet works online and at the till. Delivery prices are fetched from the carriers and stored per commune, so checkout is a lookup rather than a phone call.
Goals
Never oversell: one stock ledger behind the website, the counter and the packs, with an explicit rule for when an order reserves and when it deducts.
Make the counter accountable: every sale belongs to a cash session, every drawer movement is recorded, and receipts and invoices print on the shop's own hardware.
Recognise the customer everywhere: one account, one wallet and one order history whether the sale happened online, by phone or at the counter.
What I built
Catalogue and storefront
Products with real variations: a product is generated from option sets, and each variation keeps its own stock, price, barcode and secondary options, so a colour and a size are not two fake products.
Collections, brands and packs: curated collections and ordered brands sit beside packs that group several items at a package price, with the discount calculated from the pack contents.
A storefront that answers questions: search, colour filters, a wishlist, a waiting list for sold-out items, FAQ and static pages, and order tracking by reference without an account.
Promotions with scope: codes can be a percentage or a fixed amount, global or limited to one customer, with a use cap and a date window. They can include or exclude products, categories and collections, and the discount is always computed on the server.
Orders and stock
One order lifecycle: draft, pending, confirmed, shipped, returned, cancelled, completed and return-pending, with the sales channel and every shipping, tracking and return timestamp kept on the order.
Reserve versus deduct: a pending online order holds stock without taking it, while a counter sale or a confirmed order deducts it. Returns are received line by line and go back through the same stock service, which is what keeps the count honest after a busy weekend.
Purchasing and stock entries: purchase orders from vendors become stock entries, and the totals and statuses update as goods arrive, so the shop knows what it ordered and what actually landed.
Exchanges and pack history: an exchange links back to its source order, and a pack keeps the price and discount it was sold at, so changing the pack tomorrow never rewrites a past sale.
Counter and cash


Sessions, not just sales: a cashier opens a session with a counted amount, every sale and drawer movement attaches to it, and closing records the counted cash. A shortfall has a session, a person and a list of movements.
A counter built for speed: product search, packs, stock checks, customer search and creation, deposits, open-cart reservations and buy prices for staff, all on one screen.
Printing as hardware: receipts at receipt width, invoices at A4, barcode labels and loyalty cards are rendered on the server and sent to the printer, instead of depending on the browser's print dialog.
Signed print links: an order can be printed from a link that carries a signature, so a shared link cannot be replayed forever.
Wallet, loyalty and gifts

Two balances: spendable credit and cashback that is still pending are separate, so the customer can spend what is available without touching what has not unlocked yet.
A ledger, not a counter: every earn, unlock, spend and adjustment writes a row with both balances after the movement and a link to the order or gift that caused it, which makes a statement a range read rather than a replay.
PIN protection: the card has a hashed PIN, an attempt counter and a temporary lockout, and staff can suspend a card without deleting its history.
Gift cards as transfers: a gift moves value from one wallet to another with a claim token and a share image, so it can be sent before the recipient has an account, and an expired or cancelled gift is rejected.
Delivery, documents and administration

Three carriers behind one client: states, cities, stop desks, fees, parcel creation and status sync are adapted per carrier, with a shared rate limiter so a bulk sync cannot hammer an API.
Per-commune prices, stored: fees are fetched and persisted for every commune, including the wilayas that were missing before, so checkout does not call a carrier three times per page.
Documents that number themselves: orders and other documents get human-readable sequences per key and year, with a lock and a retry so two simultaneous sales cannot receive the same number.
An admin for the whole shop: resources for items, orders, customers, loyalty, promotions, sessions, media and settings, plus a support history from the chat widget.
Architecture
One Laravel 12 application serves three surfaces: a Vue 3 and Inertia storefront, a counter app that runs Inertia with server-side rendering disabled, and a Filament 3 admin. All three read the same Eloquent models and domain services. Stock decisions live in one service that encodes the matrix of channel and status, so an online pending order reserves while a counter sale deducts; returns call the same service. Loyalty is a small ledger system with two balances and a polymorphic reference to whatever caused the movement. Delivery is one abstract client with three adapters and a rate limiter, and commune fees are written to the database by a queued job. Document numbers use a row lock with a retry on a unique violation. Slow work, such as invoice mail, stock sync and fee sync, runs on the queue. The test suite covers orders, stock, loyalty, promotions, sessions, barcodes and back-office authorisation. Built in 2025–2026 (235 commits).
Result
Live and still being developed. The shop uses it for online orders, counter sales, the loyalty wallet, gift cards and delivery across the country, and the website and the till now see the same stock and the same customer.
Back-office screens are from a demo copy with sample data.
Interactive preview
Scroll inside the browser window — every page is a real screenshot of the app.









