La Comanda is a three-tier web application composed of a React single-page application, an Express REST API, and a MySQL relational database — all orchestrated by Docker Compose. The frontend communicates exclusively with the backend over HTTP, the backend uses Prisma ORM to read and write data, and Clerk provides authentication as an external service that both tiers rely on for identity. This document walks through each layer in detail, including the routing structure, auth flow, color system, and internationalization setup.Documentation 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.
System Overview
Frontend
React 19 SPA built with Vite, styled with Tailwind CSS v3, routed by react-router-dom v7, authenticated via Clerk React, and internationalized with i18next.
Backend
Express 5 REST API with CORS and JSON body parsing enabled. Uses Prisma ORM to interface with MySQL. Runs on port 3000.
Database
MySQL 8.0 container with a persistent named Docker volume (
mysql_data). Schema managed by Prisma migrations.Auth
Clerk handles sign-in, session management, and token issuance. Protected routes use a
ProtectedRoute wrapper built on Clerk’s SignedIn / SignedOut / RedirectToSignIn components.Frontend
The frontend is a React 19 single-page application built and served by Vite 8. TypeScript (~6.0) is used throughout for type safety, and ESLint with thereact-hooks and react-refresh plugins enforces code quality during development.
Routing
Client-side navigation is handled by react-router-dom v7 using aBrowserRouter and a flat Routes tree. The application defines eight routes:
| Path | Component | Protected |
|---|---|---|
/ | LoginPage | No |
/dashboard | Dashboard | Yes |
/tables | TableView | Yes |
/kitchen | KitchenMonitor | Yes |
/inventory | Inventory | Yes |
/staff | StaffControl | Yes |
/settings | Settings | Yes |
/403 | AccessDenied | Yes |
ProtectedRoute component defined in App.tsx:
App.tsx:
Styling
Tailwind CSS v3 is configured withdarkMode: "class" and a comprehensive set of Material Design 3-inspired color tokens defined in tailwind.config.js. The design system uses semantic role names rather than raw color values, making it straightforward to apply theme changes globally. The font stack defaults to Inter across all type scales.
Key color tokens from tailwind.config.js:
DEFAULT: 0.125rem, lg: 0.25rem, xl: 0.5rem, full: 0.75rem) to match Material Design’s slightly rounded aesthetic.
Backend
The backend is an Express 5 server written in TypeScript and compiled byts-node in development (via nodemon) and tsc for production builds.
Server Setup
Current Endpoints
| Method | Path | Description |
|---|---|---|
GET | / | Welcome message — confirms the API is reachable |
GET | /api/health | Health check — returns status: ok and an ISO timestamp |
The backend is under active development. Additional REST endpoints for tables, orders, inventory, and staff will be added as features are built out.
ORM
Prisma 7 is used as the ORM. The@prisma/client package is generated from the Prisma schema and used in route handlers to issue type-safe queries against MySQL. The DATABASE_URL environment variable is injected by Docker Compose at runtime.
Database
La Comanda uses MySQL 8.0 running in a dedicated Docker container. Data is persisted in a named Docker volume so it survives container restarts.Docker Compose Services
The fulldocker-compose.yml defines three services:
Connection Details
| Parameter | Value |
|---|---|
| Host (from backend container) | db |
| Host (from host machine) | localhost |
| Port | 3306 |
| Root password | rootpassword |
| Database name | la_comanda |
| Connection string | mysql://root:rootpassword@db:3306/la_comanda |
Auth Flow
La Comanda delegates all identity management to Clerk. The frontend is wrapped in aClerkProvider at the application root, which makes Clerk’s hooks and components available throughout the tree.
- A user navigates to any protected route (e.g.,
/dashboard). - The
ProtectedRoutewrapper renders<SignedIn>and<SignedOut>children side-by-side. - If the Clerk session is inactive,
<SignedOut>renders<RedirectToSignIn />, which redirects the browser to Clerk’s hosted sign-in flow. - After the user authenticates, Clerk redirects back to the originally requested route.
<SignedIn>now renders, and the protected page component mounts.
useAuth hook from @clerk/clerk-react is available inside any component to access the current session token, user ID, and sign-out function when needed for API calls.
Internationalization (i18n)
The frontend is fully internationalized using i18next (^26.3) and react-i18next (^17.0). Translation resources are stored as JSON files undersrc/locales/:
| File | Language |
|---|---|
src/locales/en.json | English |
src/locales/es.json | Spanish |
| Namespace | Covers |
|---|---|
sidebar | Navigation menu labels |
header | Top bar and global UI text |
login | Authentication page content |
dashboard | Analytics and metrics labels |
tables | Table view and floor plan |
kitchen | Kitchen display system |
inventory | Inventory management interface |
staff | Staff management panel |
settings | System settings page |
access_denied | 403 error page content |
useTranslation hook with a specific namespace keeps translation keys scoped and avoids collisions as the application grows: