Skip to content

KMW Stock

  • Laravel
  • PHP
  • MariaDB
  • Tailwind CSS
  • Alpine.js
  • Pest

A stock, sales and instalments platform rebuilt from the old app's data exports in two days: the same screens, menus and French labels the staff use, on a codebase that can be maintained.

Intro

The problem

An old PHP app ran a shop's stock, sales and instalments. It had to move to a codebase that can be maintained, with the same workflow, starting from its CSV exports.

Mission
Move a shop's daily tool onto a modern stack without changing how anyone works, and prove that not one sale or instalment was lost on the way.
Built with
Laravel, PHP, MariaDB, Tailwind CSS, Alpine.js, Pest
My role
Sole developer: data migration, backend, UI, security, infrastructure and CI/CD · 2026
Reconciliation checks
27/27
Tests in CI
72
From first commit to deploy
2 days

What I built

KMW Stock is the tool a shop uses every day: products tracked by serial number, sales paid in cash or by instalments, reservations, instalment payments, delivery and exit notes, and reports. Many customers buy through their employee association (amicale). The old PHP app worked, but it could not be maintained, so I rebuilt it in Laravel from its data exports.

  • Migration: a re-runnable importer rebuilds the database from the CSV exports, and 27 out of 27 reconciliation checks match the old app, from item counts to every total. Anything odd goes to a "Données à vérifier" list for a person to review; money data is never corrected silently.
  • Same screens: every old screen, in the same menu order, with the same French labels, columns and actions. Only the look changed, so nobody needs retraining.
  • Roles: Développeur (technical screens only), Administrateur and Vendeur, with per-person switches, login by CIN number and an audit log. Accounts are created disabled, with a temporary password shown once.

The platform is deployed with the real data imported and checked on the server. Next, the staff get their accounts and start using it.

Engineering notes

The database itself guards the rules that matter: a product can only be in one active sale, and an instalment can only be paid once. Cancelling a sale is a soft cancel that puts the products back in stock and keeps every paid instalment on record.

Deploys come from a kit with a health check and a rollback. Backups are encrypted every day, pulled off-site to another machine, and the restore has been tested. No real data ever enters the repository: exports, dumps and secrets are git-ignored and refused by CI.

The stack

Laravel 13 on PHP 8.5 in production with MariaDB 11.8, Blade with Tailwind CSS and Alpine.js. Tested with Pest (72 tests) and Larastan at level 6, on PHP 8.3 and 8.4 against MariaDB in GitHub Actions.

More projects