Part 1 of 10 · Cloth Store Software

Why I Built Software for a Clothing Shop That Ran on Paper

A billing screen with a search box showing instant matching product results as you type

A clothing shop runs on memory and paper, and that is exactly the problem. Prices in the owner’s head. Stock counted by looking at the shelves. Sales written in a register, if they are written at all. And profit? Most small shops have no real idea what their actual profit is. They know money comes in and money goes out, and they hope the gap is good. I built software to replace that hoping with knowing, and this series is the honest story of building it.

Before writing any code I forced myself to name, precisely, what the software had to do. Not features, jobs. It had to bill a customer at the counter quickly, because a queue does not wait. It had to know the stock, so the shelves stop being the database. It had to record every sale automatically, so the register cannot be forgotten. And it had to answer the one question paper never answers: what is the real profit, item by item, day by day.

That last job dictated something technical on day one. Profit is selling price minus cost price, so the software had to store both for every product. A paper register almost never records the cost next to the sale, which is exactly why shops cannot see their margin. In my product table, the two prices sit side by side from the start:

self.cursor.execute('''
    CREATE TABLE IF NOT EXISTS products (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        name TEXT NOT NULL,
        cost_price REAL NOT NULL,
        selling_price REAL NOT NULL,
        stock_quantity INTEGER NOT NULL
    )
''')

Two REAL columns, cost and selling. That is the entire secret of profit reporting, captured at the moment a product is entered, not reconstructed later from guesses. Stock is an INTEGER the software itself decreases on every sale, so the count on screen is the count in reality, without anyone walking to the shelf.

I also decided early what this software would not be. Not a cloud system, a shop with unreliable internet cannot bill customers through someone else’s server. Not a subscription, a small shop should own its tool. A single desktop program with its whole database in one local file, working offline, forever. Those constraints chose my tools for me, which is the next post.

A few things people ask me about this

Why can a paper register not show profit? Because it records what was sold and for how much, but not what each item cost the shop. Without cost beside every sale, margin is guesswork. Software fixes this by storing cost_price and selling_price together on the product itself.

Why offline desktop software instead of a web system? Because the counter must work when the internet does not. A local program with a local database bills customers in a power cut with a laptop battery. For a small shop, that reliability beats every advantage of the cloud.

Next

Jobs named, constraints set. The next decision was the foundation, which language, which kind of app, and which database, and why a database that lives in a single file was exactly right for a shop. That is the next post.

Leave a Reply

Your email address will not be published. Required fields are marked *