All runtime configuration for the Agencia de Habilidades para el Futuro API is provided through environment variables loaded by theDocumentation 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.
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.
Variable reference
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.Your Firebase project’s API key. Found in the Firebase console under Project Settings → General → Your apps → SDK setup and configuration → apiKey.
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.The unique identifier for your Firebase project (e.g.
my-agency-app). Visible in Project Settings → General → Project ID.The Firebase Cloud Storage bucket associated with your project. Typically
your-project-id.appspot.com. Found in the SDK configuration block as storageBucket.The numeric sender ID used by Firebase Cloud Messaging. Found in the SDK configuration block as
messagingSenderId.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.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.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.
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:
- Create or open a project. Go to the Firebase console and either create a new project or open an existing one.
- 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. - Copy the config object. After registering, the console shows a
firebaseConfigobject. Each key in that object maps directly to one of the environment variables documented above. - 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 athttps://proyecto-final-26-6tn2.vercel.app. To deploy your own instance or update an existing Vercel deployment with the correct configuration:
- Go to your project in the Vercel dashboard.
- Navigate to Settings → Environment Variables.
- 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. - Redeploy the project — Vercel injects the variables at build and runtime automatically. You do not need to set
PORTon 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.