Dilshan Bookshop POS
An API-first inventory and point-of-sale system for a bookshop, covering everything from purchase orders to the receipt printer.

About the Project
Dilshan Bookshop POS is an inventory and point-of-sale system built for a retail bookshop. It covers the full cycle: products and variants, suppliers and purchase orders, goods receiving, a stock ledger, counter sales, returns, and reporting.
It's built as a Next.js modular monolith with a documented OpenAPI 3.1 REST API, so a future Flutter POS app can use exactly the same endpoints. Every price and stock rule is enforced on the server, never trusted to the client.
Project Type
Retail Inventory & POS
Status
Ongoing Development
Role
Full Stack Developer
Platform
Web (Next.js) + OpenAPI REST
Live URL
dilshan-pos.vercel.appWhat It Does
Web POS
Barcode scanning, split payments, hold and resume, and voids with a reason.
Purchasing
Purchase orders, goods receiving, and supplier returns.
Inventory Ledger
Every stock change is a movement, with stock counts and adjustments.
Roles & Permissions
28 permission codes across 4 roles, with per-role discount caps.
Reports & Dashboard
Sales, inventory, purchases, and profitability, net of returns.
Returns Approval
Manager approval for returns, and damaged goods never go back on the shelf.
Hardware Support
Thermal receipt printing, cash drawer trigger, and a barcode scanner tester.
API Documentation
OpenAPI 3.1 spec generated from the Zod schemas, with Swagger UI.
Audit Log
An append-only log of sensitive changes, written inside the same transaction.
Technologies Used
Next.js
TypeScript
PostgreSQL
Prisma
Neon
Tailwind CSS
Vercel
Additional Tools
TanStack Query
Zod
Swagger
Vitest
Playwright
Project Preview
Challenges & Solutions
Key Challenges
- Stopping the client from setting prices, totals, or discounts
- Keeping stock consistent across sales, returns, and purchases
- Printing receipts and opening the cash drawer from a browser
- Making sure a deactivated user loses access straight away
How I Solved It
- Checkout only accepts item IDs and quantities; the server prices everything
- Routed every stock change through one ledger inside a single transaction
- Rendered one receipt document to both browser print and raw ESC/POS over Web Serial
- Found the gap in a 54-probe security audit and now check account status on every request
Results & Impact
Secure by Design
54 attack probes blocked, with the one real issue found and fixed.
Thoroughly Tested
229 unit, 111 integration, and 4 end-to-end tests passing.
Ready for Mobile
A documented API ready for a Flutter POS app.
Interested in this project?
Feel free to reach out if you'd like to know more or discuss a similar project.