About this software
About Counterly — POS & Inventory
Counterly is a browser-based point of sale and inventory app for small shops. Sell products and services, adjust stock with movement logs, manage customers, issue printable receipts, process full refunds with stock returns, and export reports as CSV. Settings cover shop branding, currency, locale and tax.
Built with React, TypeScript and Vite, backed by Cloudflare Workers and D1. Private owner login protects saved shop data; anonymous visitors can explore a read-only sample workspace. Payments are recorded manually; no payment gateway, native mobile app or staff invitation system is included.
Includes full source, database schema and ordered migrations, five screenshots, setup and deployment guides, tests, third-party licence notices and dependency audit reports. Production dependencies have no reported vulnerabilities in the included audit; build/lint tooling advisories are disclosed separately.
Why Counterly — POS & Inventory
What makes it better
than the alternatives
- 01
Cloudflare-native stack
One root npm project and lockfile cover the React frontend and the Worker API, with D1 migrations and a wrangler deploy flow with production preflight checks.
- 02
Owner-only protected setup
First-owner creation and password recovery require a private SETUP_KEY, and the setup step is a transactional singleton.
- 03
Hardened authentication
Passwords are hashed with a server-side pepper, sessions are stored hashed, recovery revokes all prior sessions, and auth attempts are rate limited.
- 04
Integer-money and stock rules
Prices are stored in integer minor units, checkout references are idempotent, receipt lines are immutable, and saves use versioned compare-and-swap.
- 05
Tested and documented
Unit, storage and API acceptance tests are included, along with a verification doc, a production dependency audit and a source manifest with SHA-256 hashes.
Checkout
- Point-of-sale screen for products and services
- Idempotent checkout references with pending-checkout recovery
- Manual payment records
- no gateway
- Printable receipts built from receipt snapshots
Inventory
- Physical products and services in a catalog view
- Whole-unit stock bounds
- Stock adjustments with stock logs
- Services do not decrement physical stock
Sales and Refunds
- Sales table and sales view
- Full refunds that return stock
- Immutable receipt lines
Customers
- Customer records and a customers view
Reports
- Analytics view and reports
- CSV export via a download helper
Settings
- Branding
- currency
- locale and tax settings
- Currency locks once records exist
- JPY zero-decimal handling
Authentication
- Owner email/password login
- Protected first-owner setup
- Recovery with private key
- Hashed sessions and rate limiting
Demo and Deployment
- Anonymous read-only sample workspace
- Local D1 emulation via npm run db:local
- Cloudflare deployment scripts and production check
- Fresh schema.sql plus ordered Drizzle migrations
| Language | Version | Framework | Used for | Share of code |
|---|---|---|---|---|
| CSS | — | — | Styling | 45.2% |
| TypeScript (React) | — | — | Front-end | 31.5% |
| TypeScript | — | — | Front-end | 19% |
| SQL | — | — | Database | 4.2% |
| HTML | — | — | Front-end | 0.1% |
- Primary language
- TypeScript 5.9 (React 19.3 UI, Cloudflare Worker API)
- Framework
- React 19.3 + Vite 8 with Cloudflare Workers, Wrangler 4
- Database
- Cloudflare D1 (SQLite); no minimum D1 version stated in the source
- Authentication
- Owner email/password with peppered PBKDF2 hashes, hashed server-side sessions, and a private setup/recovery key
- Licence
- Single-site
- Screens
- 8
- Database tables
- 14
- Supported languages
- English UI; locale and currency set in Settings; no RTL support evidenced
- Browser support
- Modern evergreen browsers (no versions specified)
| Minimum | Recommended | |
|---|---|---|
| CPU | 2 vCPU | 4 vCPU |
| RAM | 4 GB (build machine; runtime is Cloudflare Workers) | 8 GB (build machine; runtime is Cloudflare Workers) |
| OS | Node.js 22.18.0+ for build and tests; Cloudflare Workers runtime; any OS that runs Node | Node.js 22.18.0+ for build and tests; Cloudflare Workers runtime; any OS that runs Node |
| Est. monthly hosting | $5 | $5 |
Install Node.js 22.18.0+ and npm, then run:
```sh
npm ci
cp .dev.vars.example .dev.vars
node -p "require('node:crypto').randomBytes(32).toString('base64url')"
```
Run the random-secret command twice. Put two different results into AUTH_PEPPER and SETUP_KEY in .dev.vars. Never commit these values. Keep APP_ORIGIN blank and the placeholder D1 UUID for local development.
```sh
npm run db:local
npm run dev -- --port 5200
```
Open http://127.0.0.1:5200/login and create the first owner using your private SETUP_KEY. Anonymous visitors see sample data; API writes require owner login.```sh npm ci npx wrangler login npx wrangler d1 create counterly-db ``` Replace placeholder database_id in wrangler.toml with the new buyer-owned D1 UUID. Set vars.APP_ORIGIN to the exact final HTTPS origin without trailing slash. Create a private secrets.json with new AUTH_PEPPER and SETUP_KEY values, each different and at least 32 characters. Protect and back up that file; never include it in source uploads. ```sh npm run db:remote npm run build npm run check:production npm run deploy -- --secrets-file path/to/secrets.json ``` Open the deployed /login page and create your owner account with that deployment's SETUP_KEY. Change shop branding in Settings. Full instructions and optional configuration variables are documented in HowToSetup.md.
Quality report
Manually reviewedHow to read the quality report
What this is. Every project on Vibe96 goes through an automated audit of its source code before a reviewer in Dubai checks it by hand. The score is out of 100; 75 is the minimum to be listed, and any single failing check blocks a listing regardless of the score.
- Security
- No real credentials in the code, every data-changing route protected, admin areas role-gated, no SQL built from user input.
- Code structure
- A developer can navigate and extend it: clear module boundaries, no giant files, little copy-paste.
- Docs & completeness
- The setup guide, example config, schema and required files the builder committed to are actually in the archive.
- Dependency health
- Packages pinned, no known critical vulnerabilities, no abandoned libraries in production paths.
- Build & deploy
- A clean machine can restore, build and start it by following the shipped instructions.
Warnings are problems that didn't block the listing; they stay visible here until a later version clears them. The audit reads the code — it does not run it — so always try the live demo before you buy. Lines of code are counted from the same audited archive.
Reviewer notes (3 minor)
Structure is mostly sensible, but app/page.tsx (112 kb) is a monolithic view and server auth code is densely packed; auth sql is parameterized and scoped; schema and workspace sql could not be fully verified; build mostly reproducible; setup doc unseen and some config/script references unverifiable; auth design is strong, but routes in worker/workspace are not visible, so guards cannot be fully verified. None of these stop the software from working; the developer has been told and improvements come in a future update.
Versions & updates
No updates yet. New versions appear here with a changelog.
Buyers receive updates free for 1 year.
What you get
- </>Full source codeThe complete audited source, delivered as a download from your account. No obfuscation.
- ▤DocumentationSetup guide, architecture notes, CLAUDE.md and AGENTS.md.
- ↻One year of updatesEvery new version the builder publishes, free for 12 months.
- ♧30 days of supportInstallation and defect support through Vibe96 tickets.