Both applications in the UZDI monorepo are configured through environment variable files that are never committed to version control. The backend reads its variables viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Zapiony/PUCE_UZDI_2026/llms.txt
Use this file to discover all available pages before exploring further.
@nestjs/config (which wraps dotenv), and the frontend reads its variables through Vite’s built-in import.meta.env mechanism. This page documents every variable, its purpose, and the exact format expected.
Backend Environment Variables (UZDI_BACK/.env)
Create a file named .env inside the UZDI_BACK directory. This file is loaded automatically by ConfigModule.forRoot({ isGlobal: true }) registered in AppModule.
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | ✅ Yes | — | Full PostgreSQL connection string used by TypeORM |
PORT | ❌ No | 3000 | TCP port the NestJS HTTP server listens on |
Example UZDI_BACK/.env
DATABASE_URL format follows the standard libpq URI scheme:
PORT is consumed in main.ts as process.env.PORT ?? 3000:
Frontend Environment Variables (UZDI_FRONT/.env or .env.local)
Create a file named .env or .env.local inside the UZDI_FRONT directory. Vite processes this file at build/serve time and inlines matching variables into the client bundle.
Vite only exposes variables whose names begin with
VITE_ to browser code via import.meta.env. Variables without the VITE_ prefix are intentionally kept server-side and will be undefined in client code.| Variable | Required | Description |
|---|---|---|
VITE_API_BASE_URL | ✅ Yes | Base URL of the NestJS backend, without a trailing slash |
Example UZDI_FRONT/.env
src/services/api.ts to construct the axios instance base URL:
/api/v1, matching the global prefix set by app.setGlobalPrefix('api/v1') in the NestJS bootstrap.
CORS Configuration
The NestJS backend hardcodes the allowed CORS origin tohttp://localhost:5174 for development. This is the port configured in UZDI_FRONT/vite.config.ts:
UZDI_BACK/src/main.ts:
origin value in main.ts to match.
Production Deployment Notes
Before deploying to a production or staging environment, the following changes are required:Update CORS Origin
Change the
origin in main.ts from http://localhost:5174 to the deployed frontend domain, for example https://uzdi.puce.edu.ec. Consider reading this value from an environment variable like FRONTEND_URL for flexibility.Secure DATABASE_URL
Use production PostgreSQL credentials in
DATABASE_URL. Prefer a secrets manager or platform-specific secrets injection (e.g., Railway, Heroku Config Vars, AWS Secrets Manager) over a plain .env file on the server.JWT Secret Variable
The current authentication flow uses a mock token string. When a proper JWT library (e.g.,
@nestjs/jwt) is introduced, its signing secret must also be provided as an environment variable — never hardcoded.Set VITE_API_BASE_URL for Build
When building the frontend for production (
npm run build), ensure VITE_API_BASE_URL points to the production API domain, e.g., https://api.uzdi.puce.edu.ec. Vite inlines this value at build time.Security: Protecting .env Files
The recommended approach is to keep a .env.example file in each project directory with placeholder values (no real credentials) committed to the repository, so new developers know exactly which variables to set: