{"id":51511125,"url":"https://github.com/bilals2008/depot-pos","last_synced_at":"2026-07-08T06:30:23.212Z","repository":{"id":368443277,"uuid":"1282733905","full_name":"bilals2008/depot-pos","owner":"bilals2008","description":"Desktop POS \u0026 Inventory Management System — Electron, React 19, SQLite. Bilingual (EN/UR), offline-first, thermal receipt printing, and optional cloud sync.","archived":false,"fork":false,"pushed_at":"2026-06-30T14:54:17.000Z","size":7495,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-30T16:27:57.786Z","etag":null,"topics":["bilingual","desktop-app","electron","inventory-management","point-of-sale","pos-system","react","sqlite"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bilals2008.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-28T06:14:02.000Z","updated_at":"2026-06-30T14:54:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bilals2008/depot-pos","commit_stats":null,"previous_names":["bilals2008/depot-pos"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bilals2008/depot-pos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilals2008%2Fdepot-pos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilals2008%2Fdepot-pos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilals2008%2Fdepot-pos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilals2008%2Fdepot-pos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bilals2008","download_url":"https://codeload.github.com/bilals2008/depot-pos/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilals2008%2Fdepot-pos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35255327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bilingual","desktop-app","electron","inventory-management","point-of-sale","pos-system","react","sqlite"],"created_at":"2026-07-08T06:30:22.282Z","updated_at":"2026-07-08T06:30:23.194Z","avatar_url":"https://github.com/bilals2008.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Orion Orbit\n\nA modern, cross-platform **Desktop Point-of-Sale (POS) \u0026 Inventory Management System** built with Electron, React 19, and SQLite. Designed for retail environments with bilingual support (English/Urdu), offline-first architecture, and optional cloud synchronization.\n\n---\n\n## 🚀 Features\n\n### Point of Sale\n- **Keyboard-first workflow** — F1/F2/F3 shortcuts for instant navigation\n- **Barcode scanning** — jsbarcode integration for product lookup\n- **Cart management** — Real-time totals, quantity controls, discount support\n- **Multiple payment methods** — Cash, Card, Mobile wallet\n- **Thermal receipt printing** — 58mm ESC/POS compatible\n- **Returns \u0026 Exchanges** — Full/partial returns with reason tracking\n\n### Inventory Management\n- **Product CRUD** — Name, barcode, price, stock, category\n- **Stock tracking** — Real-time levels with history audit trail\n- **Low-stock alerts** — Visual indicators on dashboard\n- **Bulk import/export** — Excel (xlsx) support via SheetJS\n- **Category organization** — Flexible product grouping\n\n### Reporting \u0026 Analytics\n- **Sales dashboard** — Revenue, transactions, average order value\n- **Sales history** — Paginated, searchable, date-filtered\n- **Stock movement history** — Complete audit trail\n- **Recharts visualizations** — Area, bar, and pie charts\n- **Export to Excel** — One-click report downloads\n\n### Technical Highlights\n- **Offline-first** — SQLite via better-sqlite3 + Drizzle ORM\n- **Optional cloud sync** — Supabase integration (toggleable)\n- **Bilingual UI** — English/Urdu with RTL support \u0026 Nastaleeq font\n- **Dark/Light themes** — System-aware with manual toggle\n- **Soft deletes** — Audit-safe data retention\n- **Auto-updates ready** — Electron builder compatible\n\n---\n\n## 🛠 Tech Stack\n\n| Layer | Technology |\n|-------|------------|\n| **Desktop Shell** | Electron 42 (main + preload) |\n| **UI Framework** | React 19 |\n| **Build Tool** | Vite 8 |\n| **Styling** | Tailwind CSS 4 (`@theme inline` tokens) |\n| **Component Library** | shadcn/ui (Radix UI primitives) |\n| **Database** | SQLite via better-sqlite3 |\n| **ORM** | Drizzle ORM |\n| **Cloud Sync** | Supabase (optional, off by default) |\n| **Charts** | Recharts |\n| **Icons** | lucide-react |\n| **State Management** | React Context |\n| **Routing** | State-based (`activePath`) — no React Router |\n| **Barcodes** | jsbarcode |\n| **Export** | SheetJS (xlsx) |\n| **Forms** | React Hook Form + Zod |\n| **Notifications** | sonner |\n\n---\n\n## 📦 Project Structure\n\n```\norion-orbit/\n├── electron/                    # Main process (Node.js)\n│   ├── main.js                  # Entry point, window management, IPC\n│   ├── preload.mjs              # Secure IPC bridge (contextBridge)\n│   ├── db/\n│   │   ├── db.js                # Drizzle instance \u0026 queries\n│   │   └── schema.js            # Database schema (Drizzle)\n│   └── services/\n│       └── supabase.js          # Cloud sync service\n├── src/                         # Renderer process (React)\n│   ├── components/\n│   │   ├── ui/                  # shadcn/ui primitives (DO NOT MODIFY)\n│   │   ├── layout/              # AppLayout, Sidebar, Header\n│   │   ├── pos/                 # POS-specific components\n│   │   ├── inventory/           # Inventory-specific components\n│   │   ├── sales/               # Sales-specific components\n│   │   ├── dashboard/           # Dashboard widgets\n│   │   └── WelcomeScreen.jsx\n│   ├── context/\n│   │   ├── CartContext.jsx      # POS cart state\n│   │   ├── SalesContext.jsx     # Sales data \u0026 actions\n│   │   ├── SettingsContext.jsx  # App settings (lang, theme, etc.)\n│   │   ├── ThemeContext.jsx     # Dark/light mode\n│   │   └── NavigationContext.jsx # History stack\n│   ├── hooks/\n│   │   ├── useProducts.js       # Product data \u0026 mutations\n│   │   ├── useReports.js        # Analytics queries\n│   │   └── useStockHistory.js   # Stock movement queries\n│   ├── pages/                   # Route-level components\n│   │   ├── HomePage.jsx\n│   │   ├── SalesPage.jsx\n│   │   ├── InventoryPage.jsx\n│   │   ├── ReportsPage.jsx\n│   │   ├── ReturnsPage.jsx\n│   │   ├── SalesHistoryPage.jsx\n│   │   ├── StockHistoryPage.jsx\n│   │   ├── SettingsPage.jsx\n│   │   └── SetupPage.jsx\n│   ├── lib/\n│   │   ├── utils.js             # cn() className merger\n│   │   ├── translations.js      # EN/UR translation map\n│   │   └── data.js              # Static/mock data\n│   ├── index.css                # Tailwind v4 + @theme tokens\n│   ├── App.jsx                  # Root component, routing, providers\n│   └── main.jsx                 # React entry point\n├── public/                      # Static assets\n│   ├── fonts/                   # Jameel Noori Nastaleeq\n│   └── logo-sq.png\n├── components.json              # shadcn/ui config\n├── vite.config.js               # Vite + Tailwind + aliases\n├── eslint.config.js\n└── package.json\n```\n\n---\n\n## ⚡ Quick Start\n\n### Prerequisites\n- **Node.js** 20+\n- **npm** 10+ (or pnpm/yarn)\n\n### Installation\n\n```bash\n# Clone repository\ngit clone \u003crepository-url\u003e\ncd orion-orbit\n\n# Install dependencies\nnpm install\n\n# Start development (Vite + Electron with hot reload)\nnpm run dev\n```\n\n### Available Scripts\n\n| Command | Description |\n|---------|-------------|\n| `npm run dev` | Start dev server + Electron (hot reload) |\n| `npm run build` | Production build to `dist/` |\n| `npm run preview` | Preview Vite build |\n| `npm run electron` | Run packaged Electron app |\n| `npm run lint` | ESLint check |\n\n---\n\n## ⚙️ Configuration\n\n### Environment Variables\n\nCreate `.env` in project root (see `electron/main.js` for Supabase config):\n\n```env\n# Supabase (optional - sync disabled by default)\nVITE_SUPABASE_URL=your-project-url\nVITE_SUPABASE_ANON_KEY=your-anon-key\nSUPABASE_SERVICE_ROLE_KEY=your-service-role-key\n```\n\n### Enable Cloud Sync\n\nEdit `electron/main.js`:\n\n```javascript\n// Line 12: Change to true\nconst SYNC_ENABLED = true;\n```\n\nSync runs automatically every 2 minutes when enabled.\n\n### Database Location\n\nSQLite database stored at:\n- **Windows**: `%APPDATA%/Orion Orbit/database.sqlite`\n- **macOS**: `~/Library/Application Support/Orion Orbit/database.sqlite`\n- **Linux**: `~/.config/Orion Orbit/database.sqlite`\n\n---\n\n## 🎨 Design System\n\n### Semantic Tokens Only\n\n**Never use hardcoded colors, spacing, or radii.** Use Tailwind v4 semantic tokens defined in `src/index.css`:\n\n```jsx\n// ✅ Correct\n\u003cdiv className=\"bg-background text-foreground border-border\" /\u003e\n\u003cButton variant=\"destructive\" className=\"rounded-lg\" /\u003e\n\u003cdiv className=\"text-muted-foreground\" /\u003e\n\n// ❌ Wrong\n\u003cdiv className=\"bg-white text-black border-gray-200\" /\u003e\n\u003cButton className=\"bg-red-500\" /\u003e\n\u003cdiv className=\"text-gray-500\" /\u003e\n```\n\n### Available Tokens\n\n| Token | Purpose |\n|-------|---------|\n| `bg-background` / `text-foreground` | Primary surface \u0026 text |\n| `bg-card` / `text-card-foreground` | Card surfaces |\n| `bg-popover` / `text-popover-foreground` | Popovers/dropdowns |\n| `bg-primary` / `text-primary-foreground` | Primary actions |\n| `bg-secondary` / `text-secondary-foreground` | Secondary actions |\n| `bg-muted` / `text-muted-foreground` | De-emphasized content |\n| `bg-accent` / `text-accent-foreground` | Hover/focus states |\n| `bg-destructive` / `text-destructive-foreground` | Destructive actions |\n| `border-border` / `border-input` | Borders |\n| `ring-ring` | Focus rings |\n| `rounded-[radius]` via `--radius` | Border radius |\n| `chart-1` … `chart-5` | Chart colors |\n\n### shadcn/ui Components\n\nAll primitives in `src/components/ui/`. Import and compose — **never modify**:\n\n```jsx\nimport { Button } from \"@/components/ui/button\";\nimport { Dialog, DialogContent, DialogTitle } from \"@/components/ui/dialog\";\nimport { Input } from \"@/components/ui/input\";\nimport { Card, CardContent } from \"@/components/ui/card\";\nimport { toast } from \"sonner\";\n```\n\nUse `cn()` from `@/lib/utils` for className merging.\n\n---\n\n## 🌐 Bilingual Support (EN/UR)\n\n### Translations\nDefined in `src/lib/translations.js` with flat key structure:\n\n```javascript\nexport const translations = {\n  en: { \"pos.title\": \"Point of Sale\", ... },\n  ur: { \"pos.title\": \"پوائنٹ آف سیل\", ... }\n};\n```\n\n### Usage\n```jsx\nconst { t, language } = useSettings();\n\u003cbutton\u003e{t(\"pos.checkout\")}\u003c/button\u003e\n```\n\n### Urdu Rendering\n- **Font**: \"Jameel Noori Nastaleeq\" (bundled in `public/fonts/`)\n- **Direction**: RTL via `html[lang=\"ur\"]`\n- **Class**: Apply `text-urdu` or `dir=\"rtl\"` for Urdu text\n\n---\n\n## ⌨️ Keyboard Shortcuts\n\n| Key | Action |\n|-----|--------|\n| **F1** | Navigate to POS (`/sales`) |\n| **F2** | Navigate to Inventory (`/inventory`) |\n| **F3** | Navigate to Reports (`/reports`) |\n\nDefined in `src/App.jsx` global keydown listener.\n\n---\n\n## 🗄 Database Schema\n\n### Tables\n\n| Table | Description |\n|-------|-------------|\n| `products` | Product catalog (id, name, barcode, price, stock, category, sync fields) |\n| `sales` | Sale records (id, totalAmount, paymentMethod, status, sync fields) |\n| `sale_items` | Line items per sale (saleId, productId, quantity, priceAtSale) |\n| `stock_history` | Audit trail (productId, previousStock, currentStock, changeAmount, reason) |\n| `sync_state` | Key-value checkpoints for sync resume |\n\n### Soft Deletes\nAll tables use `deletedAt` timestamp — **never hard delete**. Queries filter `WHERE deletedAt IS NULL`.\n\n---\n\n## 🔌 Electron IPC API\n\nRenderer → Main via `window.electron`:\n\n```javascript\n// Products\nwindow.electron.getAllProducts()\nwindow.electron.addProduct({ id, name, barcode, price, stock, category })\nwindow.electron.updateProduct({ id, name, barcode, price, stock, category })\nwindow.electron.deleteProduct(id)\n\n// Sales\nwindow.electron.createSale({ id, totalAmount, paymentMethod, items })\nwindow.electron.getSales(startDate, endDate)\nwindow.electron.getSalesPaginated({ page, pageSize, sortBy, sortOrder, searchTerm })\nwindow.electron.deleteSale(id)\n\n// Inventory\nwindow.electron.getStockHistory()\n\n// Returns\nwindow.electron.processReturn({ saleId, returnedItems, exchangeItems, returnMode, reason })\n\n// Printing\nwindow.electron.printReceipt(receiptData)\n\n// Sync\nwindow.electron.checkConnection()\n```\n\n---\n\n## 📦 Build \u0026 Distribution\n\n### Development Build\n```bash\nnpm run build\nnpm run electron  # Runs from dist/\n```\n\n### Production Packaging\nConfigure `package.json` → `build` section for [electron-builder](https://www.electron.build/):\n\n```json\n\"build\": {\n  \"appId\": \"com.orion.orbit\",\n  \"productName\": \"Orion Orbit\",\n  \"files\": [\"dist/**/*\", \"electron/**/*\"],\n  \"extraResources\": [\"public/**/*\"],\n  \"win\": { \"target\": \"nsis\" },\n  \"mac\": { \"target\": \"dmg\" },\n  \"linux\": { \"target\": \"AppImage\" }\n}\n```\n\nThen:\n```bash\nnpx electron-builder\n```\n\n---\n\n## 🧪 Code Quality\n\n```bash\n# Lint\nnpm run lint\n\n# Type checking (if TypeScript added)\n# npx tsc --noEmit\n```\n\n### Conventions\n- **Imports**: React → libraries → shadcn → app components → local\n- **Aliases**: `@/` maps to `src/` (configured in `vite.config.js`)\n- **Components**: Feature folders under `src/components/{feature}/`\n- **Context**: Providers wrap `AppContent` in `App.jsx`\n- **Routing**: State-based via `activePath` — no React Router\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilals2008%2Fdepot-pos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbilals2008%2Fdepot-pos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilals2008%2Fdepot-pos/lists"}