The Challenge
Small and medium restaurants in Latin America face an operational gap: physical menus that can’t be updated, manual order-taking prone to errors, fragmented payment collection via cash or transfer, and zero integration between the customer ordering experience and back-of-house operations. Post-pandemic QR ordering raised expectations, but existing solutions were either too expensive for small businesses or lacked the depth needed for real restaurant workflows — especially integration with thermal printers and local payment processors like Mercado Pago.
Our Approach
We built Deminut as a multi-repo ecosystem of 3 independent applications:
- API Backend — Express with Sequelize/MySQL: 79 endpoints across 16 route modules, 28 database tables, 77 migrations. Layered architecture (Routes → Controllers → Services → Models) with workers for auto-rejection of stale orders (15min) and log cleanup
- SPA Frontend — Next.js 14 with dual interface: a public QR menu where diners browse, customize, and pay; and an admin dashboard where restaurants manage menus, approve orders, configure printers, and connect Mercado Pago
- Print Bridge — Desktop application (Windows/macOS) running locally at the restaurant, connecting via WebSocket to the browser and sending ESC/POS commands to thermal printers over TCP or USB
Communication: REST API (SPA ↔ API), WebSocket (SPA ↔ Bridge), TCP/USB (Bridge ↔ Printer).
Automated Printing (Print Bridge)
An end-to-end system connecting the web to physical thermal printers without complex network configuration:
- Auto-Discovery — Scans the local network and discovers thermal printers automatically
- Dual Tickets — Kitchen tickets (no prices, preparation-focused) and customer tickets (prices, payment details) generated on order approval
- Real-Time WebSocket — Instant ticket printing when orders transition to APPROVED in the dashboard
- Multi-Protocol — Supports TCP and USB connections with automatic fallback to Windows print spooler
- Builder Pattern — Composable ESC/POS command construction for flexible ticket layouts
- Monitoring — Printer status tracking (paper, errors) with remote logging to the API for diagnostics
- Native Distribution — Packaged as standalone executables via
pkg, distributed as.pkg(macOS) and.exe(Windows) through GitHub Releases and Cloudflare R2
Mercado Pago Split Payments (Marketplace)
Complete online payment integration using Mercado Pago’s Marketplace model:
- OAuth PKCE Flow — Each restaurant connects their own Mercado Pago account from the admin dashboard
- Split Payments — The platform automatically collects a commission per transaction via the Marketplace model
- Order State Machine — Orders transition through states:
PENDING → PENDING_PAYMENT → PAID → APPROVED → DELIVEREDwith webhook-driven payment status synchronization - Automatic Reconciliation — Payment confirmation triggers order approval and kitchen notification in real-time
Technical Highlights
- Hierarchical Menus — Menu → Section → Item → Option Group → Option, with bulk import/export via Excel and Zod validation
- Order State Machine — 5-state workflow with automatic transitions, 15-minute auto-rejection worker via
node-schedule - Redux Architecture — 43 async thunks with custom
useActionStatushook for loading/error tracking, Redux Persist for offline-capable state - Image Pipeline — Sharp-based WebP optimization with automatic resizing, stored on Cloudflare R2
- Multi-Channel Notifications — Resend for transactional emails, Twilio for SMS order alerts
- AdminJS Backoffice — Super admin panel for platform-wide operations
- Soft Deletes — Sequelize paranoid mode across all models, with atomic transactions for bulk operations
Architecture
deminut/
├── deminut-api/ # Express REST API (Node.js 20)
│ ├── routes/ # 16 route modules, 79 endpoints
│ ├── controllers/
│ ├── services/
│ ├── models/ # 28 Sequelize models
│ └── migrations/ # 77 migrations
├── deminut-spa/ # Next.js 14 SPA (React 18 + Redux)
│ ├── components/ # 192 components in 77 directories
│ ├── store/ # Redux Toolkit, 43 async thunks
│ └── pages/ # 25 routes
└── deminut-printer-bridge/ # Desktop app (WebSocket + ESC/POS)
├── printer/ # TCP/USB drivers
├── websocket/ # WS server
└── installers/ # pkg builds (macOS/Windows)
The Results
Deminut is live in production:
- 79 API endpoints across 16 route modules with 27 integration docs
- 938+ tests — 530+ backend (Vitest) + 408+ Print Bridge (Jest, 17 suites)
- 221+ merged PRs with 40+ active feature branches
- 77 database migrations evolving 28 models over 4 months of development
- Native Print Bridge — macOS and Windows installers for automatic thermal printing
- Mercado Pago Marketplace — Split payments with per-transaction commission
- Production deployment — Coolify with GitHub Actions CI/CD
- Expansion roadmap — Active in Uruguay, planned for Argentina, Brazil, Chile, Mexico, Colombia, Peru