Skip to content

dGreatNoob/simple-pos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-pos

Offline-first point-of-sale designed for small and medium retail stores.

A POS system that works without internet. Local-first writes hit IndexedDB immediately so the cashier never waits on the network; a background sync manager pushes changes to the Laravel API and reconciles conflicts when connectivity returns.

Why offline-first

Retail counters in the Philippines (and most of the world) lose connectivity often — flaky LTE, brownouts, ISP downtime. A POS that freezes when the network drops is a POS that loses sales. This one keeps selling.

Stack

Layer Tech
Frontend SvelteKit (PWA, adapter-static)
Local DB Dexie.js (IndexedDB wrapper, reactive queries, version-migrated schema)
Styling Tailwind CSS (JIT, strict purge — bundle target < 1MB)
Backend Laravel 12 + Laravel Sanctum (SPA auth)
API RESTful, versioned at /api/v1/

Architecture

[UI Action] → [Local DB Write] → [Sync Queue] → [Sync Manager] → [Laravel API]
                ↓                                     ↓
        [Immediate UI Update]                [Background Sync]

Core principle: every write succeeds locally first, then syncs asynchronously. The UI never waits on the network.

Conflict resolution

Entity Strategy
Products Last-write-wins by updated_at
Transactions Append-only — no conflicts (immutable once created)
Stock adjustments Server-side reconciliation against the queue
Settings Client-push with server validation

Project layout

backend/    Laravel API — products, transactions, stock, sync endpoints
frontend/   SvelteKit PWA — local Dexie store, sync manager, cashier UI
docs/       Architecture, implementation plan, API contracts

Status

In active development. See IMPLEMENTATION_PLAN.md for the phased roadmap and docs/ for architecture detail.

Running locally

Backend

cd backend
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate
php artisan serve

Frontend

cd frontend
npm install
npm run dev

License

MIT. Use it, fork it, ship it.

About

Offline-first POS for small/medium retail stores. SvelteKit + Dexie (IndexedDB) + Laravel.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors