Restaurante API
A production-ready backend for restaurant management systems, built with NestJS 11, PostgreSQL 17, and Drizzle ORM. Handles the complete restaurant operations stack: from table orders and kitchen display to cash register reconciliation and inventory tracking.Quick Start
Get the API running locally in under 5 minutes with Docker Compose
Authentication
JWT-based auth with role-based access control for admin and cajero roles
API Reference
Complete endpoint documentation with request/response schemas
Architecture
Understand the module structure, database schema, and WebSocket design
What this API covers
Order Management
Create and manage transactions (pedidos) with items, extras, and partial payments. Support for dine-in, takeaway, and delivery.
Cash Register
Full cash register lifecycle: open with denomination counts, record expenses, close with automatic reconciliation.
Kitchen Display
Real-time kitchen queue via Socket.IO WebSocket. Kitchen staff mark orders complete and POS updates instantly.
Menu & Inventory
Manage dishes (platos) with ingredient recipes. Products and ingredients tracked with minimum stock alerts.
User Management
Create users with roles (admin, cajero). Soft-delete and audit timestamps on all entities.
Dashboard
Real-time stats: transactions today, open orders, daily revenue, and recent activity feed.
Tech stack
| Component | Technology |
|---|---|
| Framework | NestJS 11 |
| Database | PostgreSQL 17 |
| ORM | Drizzle ORM |
| Authentication | JWT + Passport |
| Real-time | Socket.IO (WebSockets) |
| Container | Docker + Docker Compose |
| Runtime | Node.js 22 LTS |
| Language | TypeScript 5.7 |
Base URL
All REST endpoints are prefixed with/api:
Roles
The API uses two roles enforced via JWT claims and aRolesGuard:
| Role | Description |
|---|---|
admin | Full access — can create/update/delete dishes, products, ingredients, users, and close registers |
cajero | Operational access — can open/close cash registers, create transactions, and record payments |
All endpoints require a valid JWT token unless otherwise noted. Include it as a Bearer token in the
Authorization header.