OpenTill is a robust, offline-first Point of Sale (POS) system engineered for the modern hospitality industry. From bustling cafes to fine dining restaurants, OpenTill provides a seamless experience for staff and powerful insights for owners—completely open source.
🔗 Live Demo: https://open-till-imaj.vercel.app/
- Quick Service & Dining Modes: Toggle between fast-casual counter service and full tableside ordering with a visual table map.
- Atomic Transactions: Utilizing PostgreSQL RPCs (
sell_items) to ensure stock deduction, financial recording, and staff attribution happen in a single, fail-safe database transaction. Zero race conditions.- Prevents overselling even during high-traffic periods.
- Accurate Tax Calculation: Built-in logic handles complex tax scenarios reliably.
- Multi-Branch Support: Tenant isolation logic ensures orders, stock, and tables are siloed by branch ID, preventing data leaks in multi-location setups.
- True Offline Resilience: Built on Dexie.js and Workbox, the POS works completely offline.
- Orders are stored locally in IndexedDB.
- Auto-Sync: Background synchronization pushes offline sales and kitchen tickets the moment connectivity returns.
- Real-Time Fire: Orders appear instantly on kitchen screens via Supabase Realtime websockets.
- Smart Routing: Items are routed to specific stations (e.g., Drinks bar vs. Hot Food).
- Syncs with Offline POS: Even if the POS loses internet, it continues to function and will push queued tickets to the KDS once reconnected.
- Recipe-Based Deduction: Define ingredients (e.g., "Coffee Bean", "Milk", "Sugar") for products. Selling a "Latte" automatically deducts 18g of beans and 200ml of milk.
- Low Stock Alerts: Visual warnings when ingredients dip below thresholds.
- Supplier Management: Create and track Purchase Orders (PO) to restock efficiently.
- Self-Service Menu: A dedicated customer-facing interface for QR code ordering at the table.
- Secure: Pricing is calculated server-side to prevent tampering.
- Integrated Loyalty: Earn points per transaction and redeem for discounts.
- Gift Cards: Issue, redeem, and recharge gift cards with secure balance tracking.
- Delivery Webhooks: Ready-to-use Supabase Edge Functions to ingest orders from UberEats/Deliveroo webhooks directly into your POS.
- Developer Friendly: Full TypeScript codebase, strict typing, and a documented SQL schema.
- Frontend: React 18, TypeScript, Vite
- State Management: React Query (Server state), Context API (App state)
- Database: Supabase (PostgreSQL)
- Offline Storage: Dexie.js (IndexedDB wrapper)
- Authentication: Supabase Auth
- Styling: CSS Modules, Lucide React Icons
- Hosting: Vercel (Frontend), Supabase (Backend/Database)
| POS Interface | Admin Dashboard |
|---|---|
| Kitchen Display | Inventory |
|---|---|
- Node.js (v18+)
- npm or yarn
- A free Supabase account.
Clone the repository and install dependencies:
git clone https://github.com/drafthacker2889/OpenTill.git
cd OpenTill
npm installCreate a .env file in the root directory:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key- Navigate to your Supabase Dashboard -> SQL Editor.
- Open the file
database_schema.sqlfrom this repository. - Copy and paste the contents into the SQL Editor and run it. This will create all tables, stored procedures, and triggers.
Start the development server:
npm run devVisit http://localhost:5173 to launch the app.
This project is optimized for Vercel.
- Push your code to GitHub.
- Import the project into Vercel.
- Add the Environment Variables (
VITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEY) in Vercel Settings. - Deploy!
To deploy the Delivery Webhook edge function:
supabase login
supabase functions deploy delivery-webhook --project-ref your-project-refWebhook URL: https://[project-ref].supabase.co/functions/v1/delivery-webhook
Contributions are welcome! Please fork the repository and submit a pull request for review.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.