The La Comanda backend is an Express 5 server running on portDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JAQA20/Paradigmas-G3/llms.txt
Use this file to discover all available pages before exploring further.
3000 (configurable via the PORT environment variable). It serves a REST API consumed by the React frontend and is orchestrated alongside the frontend and a MySQL 8 database via Docker Compose. All responses are JSON; no authentication is required for the currently available endpoints.
Base URL
In local development the backend container is exposed at:http://localhost:5173) communicates with the backend using the VITE_API_URL environment variable, which Docker Compose sets to http://localhost:3000.
Configuration
CORS is enabled globally so that the frontend origin can call the API without browser restrictions. JSON body parsing is also wired in as a top-level middleware, making request bodies available onreq.body for all routes. The complete src/index.ts bootstrap is:
dotenv is declared as a production dependency so that a .env file in the backend root can supply PORT and DATABASE_URL without modifying Docker Compose. The TypeScript compiler targets ES2022 with strict checks enabled (tsconfig.json "strict": true).
Endpoints
GET /
Returns a static welcome message. Use this to confirm the server process is reachable. Authentication: None required. Response shape:GET /api/health
Health check endpoint. Returns a fixed"ok" status and the server’s current UTC timestamp in ISO 8601 format. Suitable for container health probes and uptime monitors.
Authentication: None required.
Response shape:
timestamp field is generated server-side via new Date().toISOString() on every request, so it always reflects the actual wall-clock time at the moment of the call.
Development
The backendpackage.json exposes three npm scripts:
| Script | Command | Purpose |
|---|---|---|
dev | nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts | Hot-reloading dev server via ts-node |
build | tsc | Compile TypeScript to dist/ |
start | node dist/index.js | Run the compiled production bundle |
.ts files under src/ and restarts automatically on save. For a production build:
ES2022, outputs CommonJS modules ("module": "commonjs"), and enforces strict mode — all source files live under src/ and output lands in dist/.
Docker Compose
The full stack (frontend + backend + MySQL 8) is defined indocker-compose.yml. Relevant backend service configuration:
DATABASE_URL connection string follows Prisma’s MySQL format and targets the lacomanda_db MySQL 8 container. The db service uses a named Docker volume (mysql_data) for data persistence across container restarts.
Prisma
The backend ships with@prisma/client (^7.8.0) and the prisma CLI as a dev dependency, but no schema or migrations have been committed to the repository yet. To begin defining data models:
prisma/schema.prisma (configure the datasource block to use provider = "mysql" and the DATABASE_URL env var) and a .env template. After editing the schema, generate the client with:
The API is under active development. Currently only two endpoints exist (
GET / and GET /api/health); additional resource endpoints covering tables, kitchen tickets, products, and staff will be added as the backend expands to match the frontend data model.