How tngoman/store-pos works
Project type and purpose
• This is a desktop Point-of-Sale (POS) application built on Electron.
• It bundles a Node.js/Express “backend” (in server.js + api/) with a browser-based “frontend” (in index.html + assets/) inside an Electron shell.
• It connects to a central database on the network, offers receipt printing and file uploads, and manages products, users, transactions, etc.
File structure
• Top-level Electron entrypoints:
• start.js (or build.js) to bootstrap Electron
• server.js: spins up an Express server and mounts api/*.js endpoints
• renderer.js: handles renderer-process scripts or IPC
• “api” folder: REST routes for categories, customers, inventory, settings, transactions, users.
• “assets” + “public”: static UI (CSS, JS, fonts, plugins, images, public/uploads) served to the renderer.
• “installers”: Windows packaging hooks
• package.json: dependency list and build scripts
Extract architecture insights from the README
• Multi-PC support via a single central database
• Receipt printing (access to OS print APIs)
• Electron packaging as an MSI installer
• UI communicates with local Express API, which in turn communicates with the DB
a. Electron Shell
• Main Process (start.js)
• Renderer Process (index.html loaded into BrowserWindow)
b. Local Express Server
• server.js + api/*.js (REST API)
c. Database
• Central DB (MySQL, Postgres, or SQLite on network)
d. File System / Uploads
• public/uploads for product images
e. OS Services
• Print Service for receipts
f. Plugins & Static Assets
• assets/js, assets/css, assets/plugins
Relationships & data flows
• Renderer → (HTTP / IPC) → Local Express Server → Central Database
• Express → File System (uploads)
• Express → OS Print Service → Printer hardware
• Renderer ↔ Main Process via Electron IPC (for privileged operations)
• Packaging: build.js / package.json → creates installers
Architectural patterns & design principles
• Desktop MVC:
• View – assets + index.html
• Controller – api/*.js
• Model – Database access layer within api modules
• Layered architecture:
• Presentation (Renderer)
• API (Express)
• Persistence (DB + FS)
• Separation of concerns: UI vs. business logic vs. data storage
Technologies & frameworks
• Electron (start.js, build.js)
• Node.js + Express (server.js, api/)
• Static web tech: HTML5, CSS3, Vanilla JS + jQuery + plugins (DataTables, datepicker, Chosen, etc.)
• Central DB (configure in settings.js)
• MSI installer (installers/)