El Mallín Hardware Store Management System

Project Link:

A robust Full-Stack POS and Inventory solution engineered to modernize a traditional family business. Transforming manual ledgers into a high-performance digital ecosystem with real-time stock tracking, intelligent debt management, and atomic transaction integrity.

Technologies Employed

PHP 8.2Laravel 11React.jsInertia.jsPostgreSQLTailwind CSSSupabaseRailwaySystem Architecture
Dashboard and Inventory Interface

🛠️ The Challenge

“El Mallín” is a staple family-owned hardware store that had outgrown its analog roots. Managing over 20,000 unique items via paper ledgers created critical bottlenecks:

  • 📉 Inventory Drift: Discrepancies between actual stock and recorded values.
  • 🐌 Slow Checkout: Manual price checks and debt recording slowed down customer service.
  • 💸 Inflation Management: Updating thousands of prices manually in a volatile economy was impossible.

I architected and built a custom Digital Transformation Solution to centralize operations, strictly enforce data integrity, and provide real-time business intelligence.

🚀 Key Features

📦 Intelligent Inventory & Pricing Engine

  • High-Performance Search: Implemented optimized SKU and text-based indexing to query thousands of products in milliseconds.
  • Inflation-Proof Pricing: Built a Bulk Update Tool using database transactions to apply percentage-based price increases across entire categories instantly—a critical feature for economic adaptability.
  • Visual Stock Intelligence: Automated UI and backend alerts for low-stock items to prevent lost sales.

💳 Integrated POS & Debt Ledger

  • Atomic Transactions: Sales and debt recording are wrapped in Database Transactions (ACID compliant). A single action decrements stock, updates the customer’s balance, and logs the movement. If any part fails, the entire operation rolls back, ensuring 100% data consistency.
  • Hybrid Data Storage: Utilized PostgreSQL’s JSON columns within the account_movements table to store unstructured cart details (items, quantities) while keeping high-level financial data structured for fast reporting.
  • Smart History Pruning: Engineered a clean-up algorithm that automatically archives or deletes transaction history once a customer’s balance reaches zero, optimizing database storage and query performance over time.
  • Professional Invoicing: Integrated dompdf to generate on-the-fly, branded PDF account statements and receipts.

🔐 Enterprise-Grade Security & UX

  • Role-Based Access Control (RBAC): Granular permissions separating ‘Admin’ (sensitive financial data, deletion rights) from ‘Employee’ (sales, inventory view) scopes.
  • Mobile-First ‘Aisle’ Experience: A fully responsive interface built with Tailwind CSS, empowering staff to check stock and prices from their smartphones while assisting customers on the floor.

💻 Technical Architecture: The “Modern Monolith”

I chose a Laravel 11 + Inertia.js architecture to combine the simplicity of a monolith with the interactivity of a Single Page Application (SPA).

  • Seamless State Management: Inertia.js acts as the glue, allowing me to build a rich React frontend that is tightly coupled with the Laravel backend, eliminating the need for a complex robust API layer or client-side state stores (like Redux).
  • Database Reliability: Deployed on Supabase (PostgreSQL), leveraging connection pooling to handle concurrent POS requests efficiently.
  • Backend Robustness: Heavy use of Laravel’s Service Container and Form Requests for validation ensures that no invalid data ever enters the system.
// Example: Atomic Consistency in Debt Registration
DB::transaction(function () use ($request, $client) {
    // 1. Log the financial movement
    AccountMovement::create([
        'client_id' => $client->id,
        'amount' => $request->total_amount,
        'type' => 'debt',
        'items' => json_encode($request->items)
    ]);

    // 2. Update Stock for every item in the cart
    foreach ($request->items as $item) {
        Product::find($item['id'])->decrement('stock', $item['quantity']);
    }

    // 3. Update Client Balance
    $client->increment('balance', $request->total_amount);
});

📊 Business Impact

  • 60% Reduction in checkout time per customer, significantly improving the service flow.
  • 🎯 Zero Data Discrepancy between physical inventory and digital records since the system launch.
  • 📈 Real-time Financial Health visibility for the owners, a first in the business’s 20-year history.
  • 🚀 Economic Adaptability through instant bulk-pricing updates, protecting profit margins against inflation.