Skip to main content

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.

La Comanda uses environment variables to configure three separate concerns: Clerk authentication (publishable key on the frontend, future secret key on the backend), database connectivity via Prisma’s DATABASE_URL, and the API base URL that tells the React client where to send requests. Setting these correctly is required before the application can authenticate users or persist any data.

Frontend variables

The frontend is built with Vite. Only variables prefixed with VITE_ are embedded into the client bundle at build time — any other variable is ignored by Vite and never exposed to the browser. Place these in a file named frontend/.env.local (which is automatically excluded from version control by Vite’s default .gitignore template).
VariableRequiredDescription
VITE_CLERK_PUBLISHABLE_KEY✅ YesYour Clerk publishable key from the Clerk Dashboard. The VITE_ prefix is mandatory — without it Vite will not expose the value to browser code.
VITE_API_URLOptionalBase URL of the Express backend. When running via Docker Compose this defaults to http://localhost:3000, which is already set in docker-compose.yml. Override it here to point at a staging or production API.

Backend variables

The backend uses the dotenv package to load variables from backend/.env at startup. These values are never sent to the browser.
VariableRequiredDescription
DATABASE_URL✅ YesMySQL connection string in Prisma URL format. When running inside Docker Compose, the hostname is the service name db, not localhost. Example: mysql://root:rootpassword@db:3306/la_comanda
PORTOptionalPort on which the Express 5 server listens. Defaults to 3000. Must match the port mapping in docker-compose.yml if changed.

Database (MySQL) variables

These variables are consumed directly by the mysql:8.0 Docker image and are set in docker-compose.yml under the db service. They are applied only on the first boot when the container initialises the data directory — changing them after the volume already exists has no effect unless you run docker compose down -v first.
VariableRequiredDescription
MYSQL_ROOT_PASSWORD✅ YesRoot password for the MySQL container. The default value in docker-compose.yml is rootpassword.
MYSQL_DATABASE✅ YesDatabase name to create automatically on first boot. La Comanda uses la_comanda. This name must match the database segment of DATABASE_URL.
The MYSQL_ROOT_PASSWORD value in docker-compose.yml is set to rootpassword as a convenience for local development only. You must change this to a strong, randomly generated password before deploying to any environment accessible over a network. Store the production value in a secret manager or a .env file that is never committed to version control.

Setup instructions

1

Create the frontend environment file

Inside the frontend/ directory, create a file called .env.local and add your Clerk publishable key:
frontend/.env.local
VITE_CLERK_PUBLISHABLE_KEY=pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The VITE_API_URL is optional when using Docker Compose — the default http://localhost:3000 is already injected via docker-compose.yml. Add it here only if you need to override it (e.g. to point at a remote staging API):
frontend/.env.local
VITE_CLERK_PUBLISHABLE_KEY=pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
VITE_API_URL=https://api.staging.example.com
2

Create the backend environment file

Inside the backend/ directory, create a file called .env and add the database connection string and port:
backend/.env
DATABASE_URL=mysql://root:rootpassword@db:3306/la_comanda
PORT=3000
When running inside Docker Compose, the hostname in DATABASE_URL must be db (the Docker Compose service name), not localhost.
3

Add both files to .gitignore

Ensure neither file is ever committed to version control. Add the following lines to the root .gitignore (and to frontend/.gitignore and backend/.gitignore if they exist separately):
.gitignore
.env
.env.local
.env.*.local
How to get your Clerk publishable key:
  1. Sign up or log in at https://clerk.com.
  2. Create a new application (choose a name and select your preferred sign-in methods).
  3. In the left sidebar of your application dashboard, navigate to Configure → API Keys.
  4. Copy the value labelled Publishable key — it begins with pk_test_ for development or pk_live_ for production.
Paste this value as VITE_CLERK_PUBLISHABLE_KEY in frontend/.env.local. The publishable key is safe to embed in client-side code; it is not a secret.

Build docs developers (and LLMs) love