This guide walks you through everything needed to get the Agencia de Habilidades para el Futuro API running on your machine and start interacting with applicant data. By the end you will have cloned the repository, configured your Firebase and JWT environment variables, started the local server, obtained an admin token by logging in, listed existing applicants from the public endpoint, and created a new applicant record using an authenticated request.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.
Clone the repository and install dependencies
Clone the project from GitHub and install its Node.js dependencies with The install step pulls in Express 5, the Firebase SDK,
npm install.jsonwebtoken, bcryptjs, cors, and dotenv — everything listed in package.json.Configure your environment variables
Copy the provided example file to create your own Open
All Firebase values come from your Firebase project’s Project Settings → General → Your apps panel. See the Configuration page for a step-by-step guide.
.env:.env in your editor and fill in every variable. The full list of required values is:| Variable | Description |
|---|---|
PORT | HTTP port the server listens on (default 3000) |
APY_KEY | Firebase project API key |
AUTH_DOMAIN | Firebase auth domain (e.g. your-project.firebaseapp.com) |
PROJECT_ID | Firebase project ID |
STORAGE_BUCKET | Firebase storage bucket (e.g. your-project.appspot.com) |
MESSAGING_SENDER_ID | Firebase messaging sender ID |
APP_ID | Firebase App ID |
JWT_SECRET | Secret key used to sign and verify JWT tokens |
ADMIN_EMAIL | Email address of the admin user |
ADMIN_PASSWORD | Password for the admin user |
Start the development server
Launch the API with the You should see the server URL printed to your terminal:The server listens on
start script defined in package.json:PORT from your .env, falling back to 3000 if the variable is not set.Confirm the server is running
Hit the health-check endpoint to verify the process started correctly:Expected response:Any other response (connection refused, 404, etc.) indicates a configuration problem — double-check that the server process is still running and that you are using the correct port.
Log in and retrieve a JWT token
Authenticate as the admin user to get a signed JWT. Replace the email and password with the values you set in Expected response:Copy the
ADMIN_EMAIL and ADMIN_PASSWORD in your .env.token value — you will include it in the Authorization header for all write operations. Tokens expire after 1 hour; simply call /api/auth/login again to get a fresh one.If the credentials are incorrect the API returns 401 Credenciales inválidas. Make sure your .env values match exactly what you are sending in the request body.List all applicants (public)
The list endpoint is public — no token needed. Fetch all applicant records currently stored in Firestore:Example response:An empty Firestore collection returns
[]. The id field is the Firestore document ID and is used by the single-record endpoints (GET /api/postulantes/:id, PUT /api/postulantes/:id, DELETE /api/postulantes/:id).Create a new applicant (authenticated)
Creating an applicant requires the JWT you obtained in step 5. Pass it in the Expected response:The
Authorization header as a Bearer token:application_date is set automatically to the current date and time, and status defaults to "pending" — you do not need to include either field in the request body unless you want to override the defaults.