Pasal
About the project
Inspiration
Pasal (पसल) is Nepali for “shop”. Walk into almost any corner shop in Nepal, the kind that sells Wai Wai, rice, cooking oil and soap, and you’ll find the records kept in a paper notebook and in the owner’s head. That works until it doesn’t. The fast-selling items run out before anyone notices, cash sits tied up in stock nobody buys, and when the month ends, nobody can really say whether the shop made money.
There’s no shortage of inventory apps. The problem is that they all assume someone will sit down and type every item into a form, and a shopkeeper with a line of customers at the counter isn’t going to do that. So we built around what shopkeepers already do: snap a photo of the supplier’s bill, or type “sold 3 Wai Wai and 2 Coke”, and let the app handle the rest.
What it is
Pasal is a stock and sales tracker for small shops, built for the phone. It has three tabs.
Record is where most of the work happens. You type something, say it, or take a photo of a handwritten note, a supplier bill or a receipt. Gemma reads it, figures out whether it’s a sale or new stock, matches each item to one of your products, and fills in quantities and prices. You look it over, fix whatever it got wrong, and hit Save. Recent entries can be undone if you slip up.
Stock shows what’s left, what’s running low, and what your stock is worth right now.
Insights has daily revenue and profit charts for the last 30 days, a reorder list, your best sellers, and the items that are just sitting on the shelf. It also has Ask Gemma, where you can ask questions about your own shop’s numbers in plain language.
A few rules we stuck to while building it:
- Gemma suggests, the owner decides. The model never writes to the inventory. Nothing is saved until the owner presses Save.
- The data stays with the shop. Everything lives in a single SQLite file. The only thing sent to Gemma is the photo, note or question being processed at that moment.
- The numbers have to be right. Prices are in NPR, and profit uses the cost at the time of the sale, not whatever the item costs today.
- Keep it simple. A PIN protects the app. Open it on a laptop and it shows a QR code, so you can scan it and carry on from your phone.
How we built it
Stack: Next.js 16 (App Router and server actions), React 19, TypeScript, Tailwind CSS 4, and SQLite through Node 24’s built-in node:sqlite. It’s deployed on Render with a persistent disk.
Stock as a ledger: We never store a stock count. Every sale and every delivery is recorded as a +/− movement, and current stock is the sum of those movements. The count can’t drift out of sync, and undo is just deleting the entry.
Gemma 4 through Google AI Studio (gemma-4-26b-a4b-it via @google/genai) does the reading. It takes text and images, turns them into structured line items, and also powers Ask Gemma. A few things we learned along the way:
- We treat everything the model returns as untrusted input. Each reply is validated with Zod, and any item that doesn’t hold up is dropped before the owner sees it.
- Setting the thinking level to minimal cut text parsing from about 19s to 2–4s, with no drop in accuracy on our prompts.
- Gemma wasn’t reliable at division, so we stopped asking it to do the math. Our code works out unit prices from the line totals printed on the bill.
- Gemma on AI Studio doesn’t accept audio, so voice input uses the browser’s speech recognition, with keyboard dictation as a fallback.
We also wrote tests with node:test for the parser, the stock ledger and the insights, plus a seed script that fills the app with 30 days of realistic demo data.
AI usage disclosure
- In the product: Google’s Gemma 4 reads photos and notes and answers questions about the shop. The owner reviews every suggestion before anything is saved.
-
While building it: We used Claude Code (Anthropic’s Claude) as a coding assistant to plan the architecture, write and refactor code, and write tests and docs. The product and design decisions were ours, we tested against a live API key, and we reviewed everything before it went in. Commits written with Claude are marked
Co-Authored-By: Claudein the git history.
Conclusion
Pasal takes the notebook behind the counter and turns it into records that can tell the owner what to restock, what’s selling, and whether they’re actually making a profit. Logging a sale is as quick as writing it down. Next, we want to add direct camera capture on phones (right now photos come from the gallery) and get it in front of more real shopkeepers.
Thanks to MLH, the organizers and the mentors for running the event, and to Google for making Gemma available through AI Studio. 🙏
Built with
AI tools
Prize Categories Entered
- Submitted
Best Use of Gemma 4