This guide walks you through cloning the AirGuide Backend, wiring up your environment variables, seeding the database, and completing a full authentication flow — from registering a new account to receiving a JWT token via two-factor verification.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/luiss811/Backend-Airguide/llms.txt
Use this file to discover all available pages before exploring further.
Clone the repo and install dependencies
Clone the repository and install all dependencies. The
--legacy-peer-deps flag is required to resolve peer dependency conflicts in the current package set.Set up environment variables
Create a
.env file in the project root with the following values. Replace placeholder credentials with your own before deploying to production.The
SMTP_* variables are required. The auth service sends a one-time password to the user’s email address during every login attempt.Run database migrations
Generate the Prisma client, apply migrations to your database, and seed it with initial data.
prisma:generate— builds the type-safe Prisma client from your schema.prisma:migrate— applies all pending SQL migrations to the target database.prisma:seed— populates the database with buildings, rooms, and other reference data.
Start all services
The Once running, the gateway is available at
dev script uses concurrently to launch the API Gateway and all five microservices with hot reload.http://localhost:3001. You can confirm it is healthy with:Make your first API call
The authentication flow has three steps: register, log in to receive an OTP, then verify the OTP to obtain a JWT token.1. Register a new account2. Log in to receive a one-time passwordOnce your account is active, send your credentials to receive an OTP by email.3. Verify the OTP to obtain a JWT tokenSubmit the six-digit code delivered to your email inbox.Pass the returned
New accounts are created with
estado: "pendiente". You cannot log in until an administrator approves the account by setting its state to "activo" via PUT /api/auth/validate/:id.token as a Bearer token in the Authorization header for all subsequent requests.