Skip to content

maxtortecnoreparaciones/LionCore

Repository files navigation

🦁 LionCore POS

Offline-first modular Point of Sale system built with React + TypeScript + Electron + IndexedDB.
Runs as a desktop app (Windows portable) and a PWA in the browser β€” no internet required.

TypeScript React Electron Tailwind CSS Vite Express License PRs Welcome


✨ Features

πŸͺ Multi-Business

Create unlimited businesses with dedicated templates: POS, Restaurant, Dehydrated Foods, Fruit & Vegetable, Service Store.

πŸ’° Sales & Transactions

  • Quick item entry with auto-calculation
  • Multiple transaction modes: Sale, Purchase, Expense, Production
  • Invoice preview with print support
  • WhatsApp receipt sharing

πŸ“¦ Inventory Management

  • Real-time stock tracking per product
  • Low-stock alerts & negative stock prevention
  • Inventory adjustments with reason logging
  • Warehouse management with inter-warehouse transfers
  • Fruver module: waste registration & freshness tracking

🏭 Production Module

Track raw material β†’ finished product conversion with:

  • Yield percentage auto-calculation
  • Batch history & cost tracking
  • Per-batch metadata (weight, time, notes)

πŸ”§ Service Orders (CRM)

Complete service management:

  • Client registration with WhatsApp contact
  • Device & problem tracking
  • Status workflow: Received β†’ Diagnosing β†’ Repairing β†’ Ready β†’ Delivered
  • Cost & price estimation

🍽️ Restaurant Module

Multi-device architecture for restaurants:

  • Table management with move/merge support
  • Kitchen view β€” real-time order status (pending β†’ preparing β†’ ready)
  • Waiter station via browser on local network
  • WebSocket-based real-time sync across devices

πŸ“Š Reports & Analytics

  • Daily / Weekly / Monthly summaries
  • Net profit calculation (revenue βˆ’ costs)
  • CSV export

πŸ” License System

  • FREE plan: Sales + Inventory + Production + Export
  • PRO plan: Everything + Expenses + Purchases + Config
  • Offline grace period: 72 hours
  • Device-based activation via Google Sheets
  • Registration webhook with auto-licensing

🧰 Tech Stack

Layer Technology
Frontend React 19, TypeScript 6, Tailwind CSS 4, Vite 8
Desktop Electron 33, electron-builder (portable .exe)
Offline DB IndexedDB via Dexie.js (schema v7)
Server Express 5 (embedded in Electron)
Real-time WebSocket (ws) for restaurant sync
PWA Service Worker, manifest.json, offline-first
Licensing Google Sheets API + Device ID
QR QR code generation + payment QR

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Electron                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  Vite/React  │◄─────►│ Express Server β”‚   β”‚
β”‚  β”‚  (Renderer)  β”‚       β”‚  (port 3456)   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚         β”‚                       β”‚            β”‚
β”‚         β–Ό                       β–Ό            β”‚
β”‚   IndexedDB (Dexie.js)    WebSocket Server   β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚   β”‚ 5 Business Types β”‚    β”‚ Real-time    β”‚    β”‚
β”‚   β”‚ 10+ Tables      β”‚    β”‚ Sync (Mesas) β”‚    β”‚
β”‚   β”‚ CRUD + Business β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚   β”‚ Logic           β”‚                        β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β–²                    β–²
         β”‚                    β”‚
    Browser (LAN)        Browser (LAN)
   (Waiter / Kitchen)   (Another device)

πŸš€ Getting Started

Prerequisites

  • Node.js 20+
  • npm

Install & Run (Development)

git clone https://github.com/maxtortecnoreparaciones/LionCore.git
cd LionCore
npm install
npm run dev          # Web only at http://localhost:5173
npm run electron:dev # Desktop + Express server

Build for Production

npm run build                 # Web build (dist/)
npm run electron:build        # Windows portable .exe

πŸ“¦ Project Structure

src/
β”œβ”€β”€ App.tsx                    # Main UI orchestrator (~1,739 lines)
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ layout/               # AppHeader
β”‚   β”œβ”€β”€ modals/               # 19 modal components (License, Payment, Product, etc.)
β”‚   β”œβ”€β”€ pos/                  # TransactionForm
β”‚   β”œβ”€β”€ restaurant/           # 8 components (MesaCard, CocinaView, etc.)
β”‚   └── views/                # 8 view components (History, Summary, Inventory, etc.)
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ db.ts                 # Dexie.js schema v7 + CRUD + business logic (~1,266 lines)
β”‚   β”œβ”€β”€ license.ts            # License validation, device ID, plan management
β”‚   └── registration.ts       # User registration webhook
└── utils/
    └── format.ts             # formatCOP, formatDate, getTypeStyle

electron/
β”œβ”€β”€ main.js                   # Electron entry point
└── server.js                 # Express + WebSocket + API endpoints

πŸ”‘ License Plans

Feature FREE PRO
Sales βœ… βœ…
Inventory βœ… βœ…
Production βœ… βœ…
Fruver Dashboard βœ… βœ…
Service Orders βœ… βœ…
Warehouses βœ… βœ…
Export CSV βœ… βœ…
Expenses ❌ βœ…
Purchases ❌ βœ…
Config (costs, margins) ❌ βœ…
Net Profit Reports ❌ βœ…

πŸ§ͺ Test Status

npm run build   # tsc + vite build β€” clean (cosmetic warnings only)

πŸ”„ Versioning

Version Date Highlights
1.0.0 2026-05-02 Initial release
2.0.0 2026-05-20 Full refactor: 37 components extracted from App.tsx, Kitchen status flow, Express v5, QR fix, Cash payment option

🀝 Contributing

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/amazing)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push (git push origin feature/amazing)
  5. Open a Pull Request

πŸ“± Contact


Built with ❀️ in Colombia

About

Offline-first modular POS system built with TypeScript, designed for small businesses to manage sales, inventory and financial tracking

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors