# RetailEdge Complete System Specification & LLM Knowledge Document Author: RetailEdge Engineering Canonical URL: https://retailedge.yashdeeppalace.com/ Version: 2026.11 License: Proprietary SaaS (Free Tier & Enterprise Cloud) ## System Architecture ### 1. Technology Stack - **Frontend Framework**: React 19 (`react`, `react-dom`), TypeScript 6 (`tsc`), Vite 7 (`vite`) - **Styling**: Tailwind CSS v4 (`@tailwindcss/vite`), Framer Motion 12, Lucide React icons - **State Management**: React Context (`AppContext.tsx`) with optimistic local UI state and offline sync queue - **Database & Backend**: Supabase (PostgreSQL 15+) with Row Level Security (RLS) policies, atomic stored procedures (RPCs), and PostgREST - **AI Gateway**: Google Gemini (`gemini-3.5-flash-lite`, `gemini-3.1-flash-lite`, `gemini-flash-lite-latest`, `gemini-3.6-flash`) with multi-tier model fallback - **Offline & PWA Engine**: Workbox Service Worker, IndexedDB transaction queue (`syncQueue.ts`), automatic background sync - **Audio Feedback Engine**: Zero-latency Web Audio API synthesizer (`soundEffects.ts`) generating 1760Hz barcode scan chirps, payment chords, and cash drawer chimes without external media assets ### 2. Multi-Tenant Row Level Security (RLS) Every primary database table (`products`, `orders`, `customers`, `expenses`, `outlets`, `categories`, `stock_movements`, `subscription_invoices`) contains `business_id` and `outlet_id`. PostgreSQL security policies execute the kernel function `public.is_business_member(business_id UUID)` against `team_users`. Cross-tenant data leakage is prevented at the database kernel level. ### 3. Atomic Database Invariants All mutations that alter inventory or financials execute via atomic database RPCs: 1. `create_order_with_items`: Decrements variant and parent product stock, writes signed rows into `stock_movements`, creates order items, and updates customer loyalty points. 2. `process_order_return`: Restores inventory to `products` and `product_variants`, logs return movements, calculates refund based on net effective prices, and updates customer lifetime value. 3. `commit_supplier_invoice_stock_in`: Ingests OCR supplier tax bills, increases stock, updates purchase cost price, and registers audit trails. 4. `fn_place_online_order`: Concurrency-safe online checkout using row-level locking (`SELECT ... FOR UPDATE`) to prevent inventory overselling. ### 4. Internationalization (i18n) & RTL Layouts RetailEdge provides native translation across 14 languages: - English (`en`), Hindi (`hi`), Tamil (`ta`), Telugu (`te`), Kannada (`kn`), Malayalam (`ml`), Marathi (`mr`), Gujarati (`gu`), Bengali (`bn`), Punjabi (`pa`), Urdu (`ur`), Arabic (`ar`), French (`fr`), Spanish (`es`). - Bidirectional layout engine: Automatically sets `dir="rtl"` and switches CSS logical properties when switching to Arabic (`ar`) or Urdu (`ur`). ### 5. Business Intelligence & Reporting Architecture - **Shared Export Engine**: RFC-4180 UTF-8 BOM CSV exports and lazy-loaded A4 `jsPDF` + `jspdf-autotable` PDF downloads across all reporting modules (`Reports`, `StockMovement`, `Taxation`, `Expenses`, `OutstandingBills`, `Orders`, `Customers`, `Inventory`, `Loyalty`). - **Category & Revenue Intelligence**: Net-of-returns aggregation (`useTopCategories`) powering Top 10 Best Selling Categories on both Dashboard and Reports. - **Audit & Compliance Reports**: Inventory Valuation & Dead Stock, GST Slab & B2B Register, POS Shifts & Cashier Reconciliation (`pos_shifts`), Expenses & Khata Receivable Aging, and Peak Hours & Returns Analytics. ### 6. Agent & Search Discovery Endpoints (AXO / AEO / GEO) - `https://retailedge.yashdeeppalace.com/robots.txt` — Explicit AI crawler allowlist (`GPTBot`, `OAI-SearchBot`, `PerplexityBot`, `ClaudeBot`, `Google-Extended`, `Applebot-Extended`, `cohere-ai`). - `https://retailedge.yashdeeppalace.com/llms.txt` — Concise LLM & answer-engine grounding summary. - `https://retailedge.yashdeeppalace.com/llms-full.txt` — Full system architecture specification. - `https://retailedge.yashdeeppalace.com/ai-capabilities.json` — Machine-readable JSON schema of pricing, capabilities, and public endpoints. ## Pricing & Subscription Model - **Basic Plan**: ₹0 / month Free Forever (1 Outlet, 3 Users, Core POS, Thermal Receipt Printing, Customer Khata, Offline Checkout). - **Professional Plan**: ₹1,499 / month (Up to 5 Outlets, 25 Users, Statutory GST Invoices, Inter-Store Transfers, Customer Loyalty). - **Business Plan**: ₹3,999 / month (Up to 25 Outlets, 50 Users, Branded Online Storefront, Custom Domain CNAME, Gemini AI Suite). - **Enterprise Plan**: ₹9,999 / month (Unlimited Outlets & Staff, BI Copilot, Custom ERP Integrations, Dedicated SLA). ## Hardware Compatibility - Printers: Standard ESC/POS 58mm and 80mm thermal receipt printers (Epson, TVS, NGX, Everycom, Retsol, Posiflex) via USB, Bluetooth, LAN/Wi-Fi. - Scanners: 1D and 2D handheld, wireless, and presentation barcode scanners. - Cash Drawers: RJ11/RJ12 drawer kick interface connected via thermal receipt printer. - Scales: Standard serial weighing scale input interfaces. ## Contact & Developer Inquiries - Official Website: https://retailedge.yashdeeppalace.com/ - Privacy Policy (DPDP Act 2023): https://retailedge.yashdeeppalace.com/privacy - Terms of Service: https://retailedge.yashdeeppalace.com/terms - Support & Sales Concierge: WhatsApp +91-9871692790