The Restaurant Equis API is built with FastAPI and serves as the single backend for the entire restaurant management system — covering the POS cashier, kitchen display, inventory, supplier directory, and reporting dashboards. All endpoints live under theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/teofilobetancourt/Restaurant-Equis/llms.txt
Use this file to discover all available pages before exploring further.
/api/ path prefix, return JSON responses, and are automatically documented through Swagger UI at /api/docs and a raw OpenAPI 3.x spec at /api/openapi.json.
Base URL
The frontend TypeScript layer resolves the base URL from theVITE_API_URL environment variable:
| Environment | Base URL |
|---|---|
| Local development | http://localhost:5000 |
| Production (same-origin) | (empty string — Nginx proxies /api/ to the backend) |
/api/ to the Uvicorn process on port 5000. In local development, set VITE_API_URL=http://localhost:5000 in a .env.local file at the project root.
Endpoints Summary
| Method | Endpoint | Description |
|---|---|---|
GET | /api/ | Health check — returns API version |
GET | /api/ordenes | List all orders |
GET | /api/ordenes?estatus=activo | Active orders only (kitchen view) |
GET | /api/ordenes/{num_ticket} | Get a single order by ticket number |
POST | /api/ordenes | Create a new order |
PUT | /api/ordenes/{num_ticket} | Update an order’s status |
DELETE | /api/ordenes/{num_ticket} | Cancel (delete) an order |
GET | /api/platos | List all menu dishes (canonical route) |
POST | /api/platos | Create a new dish |
GET | /api/productos | Alias for /api/platos — same data, compatible field names |
GET | /api/inventario | List all inventory items (insumos) |
POST | /api/inventario | Create a new inventory item |
PUT | /api/inventario/{id} | Update an inventory item by ID |
DELETE | /api/inventario/{id} | Delete an inventory item by ID |
GET | /api/proveedores | List all suppliers |
POST | /api/proveedores | Create a new supplier |
PUT | /api/proveedores/{id_proveedor} | Update a supplier by ID |
DELETE | /api/proveedores/{id_proveedor} | Delete a supplier by ID |
GET | /api/reportes/resumen | KPI summary (revenue, order counts, trends) |
GET | /api/reportes/pedidos | Filtered orders report |
GET | /api/debug | Database connection debug info |
Interactive Documentation
FastAPI auto-generates interactive documentation from the route definitions and Pydantic schemas. No extra configuration is needed.- Swagger UI
- OpenAPI JSON
Navigate to
/api/docs in your browser for the full Swagger UI. You can inspect every endpoint, view request/response schemas, and execute live test requests directly from the interface.Response Format
All responses are JSON. Successful responses return the resource or list of resources directly as a JSON object or array. The health check endpoints are the simplest examples.GET /api/ returns the versioned health response:
GET / (root, without the /api/ prefix) returns a slightly different response that includes the db_integration key instead of version:
Use
GET /api/ (with the /api/ prefix) for the versioned health check. The root GET / endpoint exists for platform-level liveness probes and returns db_integration rather than version.Error Handling
The API registers a global exception handler that catches any unhandled Python exception and returns a structured500 response. This makes it straightforward to trace backend errors from the frontend or from API logs.
500 — Unhandled server error
The handler in backend/main.py uses traceback.format_exc().splitlines() to produce a JSON-serialisable list of strings:
HTTPException with a 404 status produces the standard detail envelope:
422 Unprocessable Entity with a detail array describing each validation failure:
CORS
Cross-Origin Resource Sharing is configured inbackend/main.py using FastAPI’s CORSMiddleware. The middleware is currently hardcoded to allow all origins ("*"), with the CORS_ORIGINS environment variable parsed but reserved for a future tighter configuration: