Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Manuelfg1985/Proyecto_Final_26/llms.txt

Use this file to discover all available pages before exploring further.

All runtime configuration for the Agencia de Habilidades para el Futuro API is provided through environment variables loaded by the dotenv package at startup. There are no hardcoded credentials anywhere in the codebase — src/config/db.js reads the Firebase config object directly from process.env, and the auth controller reads ADMIN_EMAIL, ADMIN_PASSWORD, and JWT_SECRET the same way. Before running the server locally you must create a .env file in the project root; on Vercel the same variables are set through the dashboard.

Environment variable template

Copy the following template into a new file named .env at the project root. Fill in each value before starting the server — the application will fail to connect to Firestore or sign tokens if any variable is missing.
PORT= 
APY_KEY= ""
AUTH_DOMAIN= ""
PROJECT_ID= ""
STORAGE_BUCKET= ""
MESSAGING_SENDER_ID= ""
APP_ID= ""
JWT_SECRET=""
ADMIN_EMAIL=""
ADMIN_PASSWORD="MiPassword123"
ADMIN_PASSWORD is pre-filled with MiPassword123 in the example file as a placeholder only. You must replace it with a strong, unique password before running the server in any environment — including local development.
JWT_SECRET must be a long, random string (at least 32 characters recommended). A weak or guessable secret allows anyone to forge valid tokens and perform write operations on your applicant data. Generate one with node -e "console.log(require('crypto').randomBytes(48).toString('hex'))" or a similar tool.

Variable reference

PORT
number
The TCP port the Express server listens on. Defaults to 3000 if not set. On Vercel this variable is typically omitted and the platform controls the port automatically.
APY_KEY
string
required
Your Firebase project’s API key. Found in the Firebase console under Project Settings → General → Your apps → SDK setup and configuration → apiKey.
AUTH_DOMAIN
string
required
The Firebase Authentication domain for your project. Typically in the form your-project-id.firebaseapp.com. Found alongside APY_KEY in the SDK configuration block.
PROJECT_ID
string
required
The unique identifier for your Firebase project (e.g. my-agency-app). Visible in Project Settings → General → Project ID.
STORAGE_BUCKET
string
required
The Firebase Cloud Storage bucket associated with your project. Typically your-project-id.appspot.com. Found in the SDK configuration block as storageBucket.
MESSAGING_SENDER_ID
string
required
The numeric sender ID used by Firebase Cloud Messaging. Found in the SDK configuration block as messagingSenderId.
APP_ID
string
required
The Firebase App ID that uniquely identifies your web app registration within the project. Found in the SDK configuration block as appId, in the format 1:000000000000:web:xxxxxxxxxxxxxxxx.
JWT_SECRET
string
required
The secret key used by jsonwebtoken to sign tokens on login and verify them on every protected request. Keep this value private — rotating it invalidates all existing tokens.
ADMIN_EMAIL
string
required
The email address of the single admin user. The login controller compares the submitted email directly against this value. There is no user database — only this one administrator account exists.
ADMIN_PASSWORD
string
required
The plain-text password for the admin account. The login controller compares submitted passwords directly against this value. Choose a strong password and never commit it to source control.

Firebase setup

To obtain all Firebase-related values (APY_KEY, AUTH_DOMAIN, PROJECT_ID, STORAGE_BUCKET, MESSAGING_SENDER_ID, APP_ID) follow these steps in the Firebase console:
  1. Create or open a project. Go to the Firebase console and either create a new project or open an existing one.
  2. Add a web app. In Project Settings → General, scroll to the Your apps section and click Add app → Web (</>). Give it a nickname and register it.
  3. Copy the config object. After registering, the console shows a firebaseConfig object. Each key in that object maps directly to one of the environment variables documented above.
  4. Enable Firestore. In the left sidebar navigate to Build → Firestore Database and click Create database. Choose a region and set your security rules. The API uses the Firebase client SDK, so Firestore security rules apply — ensure your rules permit reads and writes from authenticated sessions as needed during development.

Vercel deployment

The live version of the API is deployed at https://proyecto-final-26-6tn2.vercel.app. To deploy your own instance or update an existing Vercel deployment with the correct configuration:
  1. Go to your project in the Vercel dashboard.
  2. Navigate to Settings → Environment Variables.
  3. Add each variable from the template above (APY_KEY, AUTH_DOMAIN, PROJECT_ID, STORAGE_BUCKET, MESSAGING_SENDER_ID, APP_ID, JWT_SECRET, ADMIN_EMAIL, ADMIN_PASSWORD) one by one, targeting the Production, Preview, and Development environments as appropriate.
  4. Redeploy the project — Vercel injects the variables at build and runtime automatically. You do not need to set PORT on Vercel; the platform manages the port internally.
Never commit your .env file to version control. The repository’s .gitignore already excludes it. Always use Vercel’s Environment Variables panel (or a secrets manager) for production credentials.

Build docs developers (and LLMs) love