Skip to main content

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

ComponentTechnology
FrameworkNestJS 11
DatabasePostgreSQL 17
ORMDrizzle ORM
AuthenticationJWT + Passport
Real-timeSocket.IO (WebSockets)
ContainerDocker + Docker Compose
RuntimeNode.js 22 LTS
LanguageTypeScript 5.7

Base URL

All REST endpoints are prefixed with /api:
http://localhost:3000/api
The interactive Swagger UI is available at:
http://localhost:3000/api

Roles

The API uses two roles enforced via JWT claims and a RolesGuard:
RoleDescription
adminFull access — can create/update/delete dishes, products, ingredients, users, and close registers
cajeroOperational 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.

Build docs developers (and LLMs) love