Polaris retail operations illustration

Polaris ERP

Polaris is a retail operations system that covers the parts teams touch all day: invoices, quotations, refunds, stock, customer credit, supplier purchasing, reporting, and the admin surface around all of that. It is the kind of product where a small mistake can turn into a stock problem, a bad balance, or a support mess by the end of the day. Tech Stack: Vue 3, Pinia, TanStack Query, Django, Django REST Framework, PostgreSQL, Redis, Celery ...

February 10, 2025 · 3 min · Muhammad Hassan Raza
Bonnet brand workflow illustration

Bonnet AI

Bonnet is an AI brand-development product built around a clear delivery flow. A user starts with a creative brief, then the system pushes that work through research, strategy, creative direction, moodboards, and exportable outputs. The interesting part is not chat. It is the orchestration needed to turn a messy brief into something a team can actually review and ship. Tech Stack: Next.js, React, Django, Channels, PostgreSQL, OpenRouter, Supabase Source: Private (commercial product) ...

January 15, 2025 · 3 min · Muhammad Hassan Raza
Abstractions and Regrets

Every Abstraction I Regret

The best code I ever deleted was a utility function called format_response. It accepted a response object, a format string, a fallback value, an optional transformer function, and a boolean for whether to strip whitespace. It was used in exactly one place. I wrote it because I thought I’d need it again. I didn’t. It sat in utils.py for eight months, collecting type: ignore comments and confusing every developer who opened the file. ...

February 20, 2026 · 7 min · Muhammad Hassan Raza
Production War Stories

I Shipped a Race Condition That Double-Charged Customers (And Other War Stories)

Nobody writes blog posts about the bugs they shipped. The internet is full of “how I built X” and suspiciously empty of “how I broke X and spent 14 hours pretending it wasn’t my fault.” Here are mine. The Race Condition: Two Cashiers, One Item This one happened in Polaris, the ERP system I built for retail businesses. Real money, real transactions, real angry shop owners. The setup: two cashiers at different terminals. Both scan the same product. Both hit “Complete Sale” within 200ms of each other. The inventory says there’s one left. ...

November 15, 2025 · 8 min · Muhammad Hassan Raza
Django ORM optimization diagram

Optimizing Django ORM Queries for Large Applications

Introduction As my POS system scaled, performance bottlenecks became increasingly apparent. Customers began complaining about slow bill generation times, which made checkout frustratingly sluggish. After profiling my Django APIs, I discovered that inefficient ORM queries were causing unnecessary database overhead, leading to significant slowdowns. This prompted a deep dive into ORM optimizations to reduce query execution time and improve the overall user experience. In this post, I’ll share how I optimized my Django ORM queries using select_related, prefetch_related, bulk operations, and query profiling tools to enhance the efficiency of my refund API and bill generation process. ...

February 17, 2025 · 3 min · Muhammad Hassan Raza

PixelCryptor: Hiding Executables Inside Images

PixelCryptor is a Django app that lets you embed an executable file inside an image. Upload both files, it concatenates them with a delimiter, and stores the result on Azure Blob Storage. You can later extract the original files back out. How It Works The approach is deliberately simple: append the executable bytes to the image bytes with a known delimiter between them. def obfuscate_images(image_blob_name, executable_blob_name): image_data = image_blob_client.download_blob().readall() executable_data = executable_blob_client.download_blob().readall() delimiter = b"---EXECUTABLE_BOUNDARY---" obfuscated_data = image_data + delimiter + executable_data obfuscated_blob_client.upload_blob(obfuscated_data, overwrite=True) Image formats like JPEG and PNG store their data length in headers. Most viewers stop reading at the image data boundary, so the appended executable bytes are invisible when you open the file as an image. Deobfuscation finds the delimiter and splits the bytes back apart. ...

February 16, 2025 · 2 min · Muhammad Hassan Raza
Django signal optimization diagram

Optimizing Django Signals for Efficient Ledger Recalculations

Introduction When dealing with financial transactions in Django applications, maintaining an accurate ledger is critical. However, inefficient signal handling can lead to performance bottlenecks. In this article, we’ll explore an optimized approach to recalculating ledger balances while ensuring minimal database impact. The Problem A typical ledger system requires recalculating balances when transactions are inserted, updated, or deleted. Using Django signals, many implementations trigger redundant recalculations, causing excessive database queries and slowing down the application. ...

February 15, 2025 · 2 min · Muhammad Hassan Raza